My Arduino Story – Part Zero

My activities on this have so far taken five steps – each quite protracted in elapsed time because, well, there’s a lot of other stuff going on and it’s only been an hour here and an hour there.

Stage 1 (2011): In preparation for my First Project (Sending water meter readings to council as legally required every 15 mins 24 x 7) I mocked up an iPhone interface just to send meter readings entered manually. This was a year ago. Legally we had a year from installation of the mandated water meter to install telemetry that supplied the readings automatically. Until that time we were obliged to send weekly readings via email or by entering into a Microsoft web application fronting a simple database. The mock-up looked like an iPhone set of screens but was actually just a bit of web code. Using cookies, unlike the web interface provided by the council, we avoided retyping user name, password, meter id every darn week. A kind person in the council fixed me up with the credentials to use their telemetry interface whereby the readings were FTP’d to them as a small XML file. So, while I didn’t actually turn it into an iPhone app, the interface to the council is now working smoothly – although they had endless software problems over many months – and only in last couple of months has it been going like clockwork.

Stage 2 (Feb 2012): I somehow became more conscious of the Arduino project and community of enthusiasts and this was something I knew very little about – real electronics and interacting with physical things. It seemed like a good fit with the notion of doing our own telemetry for the water meter. I started by doing some Arduino tutorials and soon found that lack of the most rudimentary electronics know-how was making it very hard to do more than copy examples.

Stage 3 (August 1st – 12th): So finally in August I did a crash course in very basic electronics – a Kindle download read on a Mac. “Make Electronics – Learning Through Discovery”. I scanned the first few chapters and then did all the examples up to about half way, By then I had a lot more electronics know-how and just about enough to make using Arduino useful.

Stage 4 (August 12th – 31st): Went back to a set of Arduino tutorials and rehearsed them before embarking on The Project. In parallel spent a lot of time setting up a WiFi connection between the pump-shed (location of the water meter) and the cottage garage. Got a couple of good WiFi boxes at sale price but fluffed around for hours trying to determine if I could get a signal directly from inside the pump-shed to the cottage. My friend Graham Harvey brought his two similar boxes down and did get a connection from the garage window ledge to the inside of the pump-shed but I could only replicate that fleetingly. By the end of August I had established that with one WiFi box 4 metres up a power pole (not to worry, the 400 volt lines were at least another 2 metres higher up) and another in the apex of the gable end of the cottage garage I could get a decent signal.  The garage end was a home-brew (ie I did it) “power over ethernet” (POE) up to the WiFi box – one cable neatly snaking up 3 metres to the box. Once you practice a bit connecting ethernet plugs and sockets isn’t hard, nor are the barrel power plugs and “bulkhead sockets” (same as those on the power packs you get with lots of electronics equipment). And the POE is just a combination of these. I am really quite pleased with myself, though the failing eyesight and shaking hands do make threading the tiny ethernet wires and soldering the barrel power plugs tiring. I’ve brought in the workshop halogen lights to help but these are so fierce you need a sunhat and the room gets hot and smells of burning – a small price to pay.

Stage 5 (September): The Arduino stuff comprises some enjoyable application code to send messages over the Internet and store logs on the microSD card (4GB using 16-bit FAT thanks to Dave Mitchell) and some uncharted territory reading the water meter sensor. Much as I would like to leave that till last, mindful of a legal hard-stop at the end of September, I thought the next make-or-break (after the long-range WiFi) was whether or not I could read the meter accurately. Oh, how right I was. I have spent hours surfing the web about de-bouncing in software and hardware. Harry even pointed me to a different term for the same thing, “snubbers”. I tried and tried to get a software solution but, unlike the many online examples for Arduino sensing of switches and buttons of all sorts, I could not get a reliable reading. An acquaintance of Harry’s, Andy, has tried to help and we both decided that front-ending the Arduino with a de-bouncing circuit in hardware was essential. I tried using this, an R-C (resistor-capacitor) circuit with a Schmitt trigger,  this morning.  It certainly helped but didn’t completely fix my problems. Before I think I was swamping the Arduino with 1000s of interrupts from the noise around the opening and closing of the switch, but there are other spurious signals which I still don’t understand.

So, time is up, Either we have working telemetry by the end of September or we’re banned from irrigating the orchard. I fall quietly and one hopes with dignity on my sword and engage professionals to put in the telemetry. They expect to have it in by the end of the week and I’ll find out whether the water meter is in fact faulty or it’s my wiring, coding, and stuff.

Karola brought me out of my deep despair – all that WiFi stuff for naught, all that time spent trying to understand the water meter’s “reed switch” behaviour. Karola said she’d find it useful if I could deliver regular temperature readings from the orchard, so I will transmute The Project to that. Upside is that there’s no legal requirement, no-one going to get really upset if there’s the odd glitch. And I’ll still get practical experience of the Arduino and its capabilities.

About Ian

I am a New Zealand and EC citizen, living and working in Hastings in the North Island of New Zealand. On March 5th in 2004 I retired from exactly 30 years with IBM UK Ltd, working in the Hursley software development lab near Winchester in the south of England. I am now an IBM Distinguished Engineer emeritus, working to my own agenda while retaining access to my colleagues and information inside IBM.
This entry was posted in General. Bookmark the permalink.

Comments are closed.