Wednesday, 11 October 2017

Water Tank Depth Gauge - 1

I've got a 2000 litre rainwater tank by my garage (actual usable capacity is around 1750), but it is really difficult to know just how much water remains in it at any time, so I am going to try and build a depth gauge based on an ultrasonic sounder that I can hold at the top opening of the tank, and measure the distance from there to the surface of the water.  Once I have that, the rest is just maths.

I initially fancied mounting the sounder permanently inside the top of the tank, with the display inside my garage - but I fear that the humidity and condensation in the tank would probably very quickly render the sounder unit useless, or at the very least, it would drop into the water.  So I am now thinking of making a 'portable' unit that will be mounted to a bar that can be placed across the opening into the tank, thus providing a consistent starting point for the measurement to be taken each time.

I have ordered an HC-SR04 ultrasonic sounder from eBay, that also comes with a 4-digit 7-segment LED display.  That takes care of the measuring and displaying of the output.  I also decided to buy the cheapest xxduino device I could find, which I could therefore afford to have dedicated to this specific project... I found and ordered an Arduino Pro Mini device, without really knowing too much about them.  Luckily, it only cost $2.20, as subsequent investigations and planning my project have revealed I may have made a booboo, and could face some difficulties with it...

The Pro Mini I have purchased is by happy accident, the 5v version, so I won't have any power woes (I later found there is also a 3.3v variant, and combining the 3.3v version with the 5v requirement of the sounder and display would have meant dual voltage complications) , BUT more frightening - I suddenly realised that this board has no USB connector on it... I had ordered the wrong item in my excitement - I had meant to order a Nano which DID have the USB connector.  I had a sudden feeling of dread - how am I supposed to program and test this thing?

Well, some late night research was done so I wouldn't have to admit to my blunder, and I think I may be OK (but only time will tell).  Thankfully, I have found a couple of "Instructables" articles aimed at using my Uno as a middle man between my PC and the Pro Mini, without having to remove the ATMega chip from the Uno (there were plenty of articles that relied on removing the ATMega328 chip, but this is not really a practical proposition on mine, as it has the small form factor surface mounted chip soldered directly on the board).  One of these articles shows how to use the Uno as an ISP to burn a new bootloader to the Pro Mini if required without needing an FTDI board (sure enough, subsequent readings of the seller's notes makes no mention of a bootloader having been installed...), and the other explains how to load sketches to the Pro Mini using USB from PC to Uno, and then Serial (TX/RX) from the Uno to the Pro Mini.  So, fingers crossed, I will be able to set these connections up semi-permanently while I am testing and developing my gauge, and just disconnect them once I am happy with the final programming.

As always - having ordered these things from China, it will be about 4-6 weeks before I actually receive them (and a few other bits I ordered at the same time), so I don't know when the next instalment of this project will appear.  Watch this space...!

No comments:

Post a Comment