Arduino antics

I had heard of Arduino for a while, but it wasn't until the 2012 Linux.Conf.AU in Ballarat that I got my hands on one.  Freetronics had come up with an Arduino compatible USB stick called the LeoStick and they provided a free one to each conference attendee.  That first night I had the thing out of the packet and hooked up doing a simple blink demo.  I was impressed with the development cycle, the IDE and the ease of development. These powerful little building blocks are coupled with a huge community of developers and users and there are code samples and libraries for a plethora of interconnects.  I had dreams of doing great things with the Arduino. It then languished in the back of the electronics box for nearly 12 months.

At the moment we in western Victoria are suffering from a dry spell that is more severe than many of the drought years, although the government refuses to call it a drought as that would imply having to provide drought assistance.  So far we've been running at less than a quarter of the average rainfall with no signs of the situation improving.  Naturally thoughts come to handling water - as it is now becoming a scarce resource.  So I dusted off the LeoStick and the Arduino IDE and started tinkering.

For years I had a greywater system that I'd developed a PIC microcontroller circuit for, which included a web interface and several options for handling pumping to various outlets (like a toilet cistern and garden beds).  We then moved and the needs for the unit became a lot simpler, and  the pump driver triac died so I converted to a simple latching relay circuit, with the idea that I'd eventually update the microprocessor controller and re-install it.  With the ongoing "unusually dry period" it seemed like a good project to get something real under my belt.  As I knew exactly what I wanted to do the first cut of the code was done in a matter of hours, and I only had to wait for some components to arrive to get the hardware together.

I also decided to put together some tank sensors on our main water tanks so we didn't have to go tapping on them and listening for the change in sound where the water level sits.  I had looked at a lot of sensors out there but I figured that with an Arduino it shouldn't be that difficult.  I found this capacitive sensor library that was designed for touch sensitive plates, but could easily be adapted to measure any small capacitance.  Coupling this with a length of wire placed in the tank and a resistor, I have a reasonably reliable tank sensor.  Just to make sure I've added a float sensor at the top of the tank just below the overflow level so that I can use it as a pump cut-out.  Since then I've found some reasonably priced pressure sensors that give a far more consistent result than the capacitive sensor.

Next project was not really water related, but something that has irked me for some time.  We bought a heap of Arlec solar powered motion sensor lights a few years ago, and they worked reasonably well for a few months, but then decided to die.  Pulling one apart I found the battery case had cracked and looking further I found that the 6 volt battery was connected with just a blocking diode to the solar panel, which in full sun was generating more than 12V.  This might have worked OK in the suburbs with a few trees giving partial shade, but out here we have pretty much clear skies for more than 90% of the year.  Coupled to this was the use of a 6V 10W halogen globe.  Not really easy to replace, and the light output wasn't fantastic. I had tried putting in a charge controller and that helped, but I realised that with a few components I could put together something far more useful.

I'd purchased 5m rolls of led strip lighting that runs off 12V and you can cut it into short lengths and, with the adhesive backing, stick it up where you need it.  I'd used that for internal lighting in a coolroom and had some left over.  Coupling this with a few motion sensors (under $3 each from China), a few phototransitors and an Arduino I came up with a lighting solution that is far better both in light quality and coverage and in detection.  Almost 12 months later and it is still going strong.

Now with all of these projects I decided that knowing what was going on was important, so they all have support for XBee radio units to communicate with a control system.  This allowed me to abstract a lot of code into my own library for handling the XBee communications, configuration, remote control and a few other useful functions, leaving the sketches (as Arduino programs are called) very small and focussed only on the "business logic" rather than the lower level mechanics.   While useful, I found that unlike most of the components I had looked at, the XBees were increasing in price to the point where it was becoming uneconomic to use, and frankly their performance was pretty dreadful.  In clear line of site using peer-to-peer they work pretty well, but in a mesh network with things like trees and walls in the way they are pretty useless.  In one test I couldn't get the controller to talk to another XBee that was within 3m of it.

I have looked at alternatives and there are some promising units out there.  With some more research and tinkering I should have an answer to my communications issues.

Anyway, should you be interested in this sort of stuff, most of my code is now on GitHub in my "Smallholder Sensor Framework" repository.

No feedback yet

Form is loading...