Ultrasonic Rainwater Tank Capacity Meter

8,871

121

26

Published

Introduction: Ultrasonic Rainwater Tank Capacity Meter

If you are anything like me and have a little bit of an environmental conscience (or are just skinflints eager to save a few bucks - which is also me...), you may have a rainwater tank. I have a tank to harvest the rather infrequent rain we get in Australia - but boy oh boy, when it does rain here, it REALLY rains! My tank stands about 1.5m high and is on a plinth, meaning I need to get out steps to check the water level (or - because I am so lazy, balance precariously on top of an old gas bottle from the BBQ that has now taken up permanent residence as a 'step' beside the tank).

I wanted some way to be able to check the water level in the tank, without all the climbing and hanging onto the drainpipe with one hand (while worrying about what spiders might be behind it - you've heard about Australian spiders - right?)... So, with a renewed late in life interest in electronics, and cheap Arduino clones from China on ebay, I decided to have a go at building a 'widget' to do the job for me.

Now, my 'dream' widget was to be permanently installed in the tank, use a solar charged power source, with a remote readout in my garage, or maybe a wireless transmitter using Bluetooth that I could check from my phone, or perhaps even an ESP type device hosting an automatically updated webpage, so that I could check the level of water in my tank from anywhere in the world over the internet... but really - why do I need all that? So I dialled my grand ideals back a bit (well, quite considerably), and did away with the wirelessness of the solution, the permanently installedness, the solar charging, and the ability to check my tank's level from the back end of beyond (always assuming the back end of beyond has WiFi available, that is...)

The resulting project was downgraded into the hand-held unit seen above, that can be simply held over the opening of the tank and activated by a push button, with a digital readout, that can be read from ground level - far more practical.

Step 1: The Maths...

After toying with several ideas on how to determine the water level - I decided on an ultrasonic transmitter/receiver as the basis for my widget, and using an Arduino to take the readings and do all the maths. The readings returned from the sensor are (indirectly) in the form of a distance - from the ultrasonic sensor to the surface it has bounced off (the water surface - or bottom of the tank, if empty), and back again, so we need to do a few things with this, in order to get to a percentage remaining in the tank.

NB - in actual fact, the value returned from the sensor is really just the time taken for the signal to leave the emitter side and return to the receiver. This is in microseconds - but knowing the speed of sound is 29 microseconds per cm (What? You didn't know that? Pfft...) makes an easy conversion from a time period to a distance measurement.

First - of course, we need to divide the distance by 2 to get the sensor to surface distance. Then, subtract the constant distance from the sensor to the 'max' water depth. The remaining value is the depth of water that has been used. Next, subtract that value from the max water depth, to find the depth of water left in the tank.

This value then, is the basis for any other calculations, such as working out this depth of water as a percentage of the maximum depth, or multplying the depth by the constant 'surface area', to get a volume of water which can be displayed in litres (or gallons, or any other unit - as long as you know the maths to do it - I'm sticking to a percentage for simplicity).

Step 2: Practicalities

The unit could be hand held, but this introduces a small possibility of minor inaccuracies if the unit is not held in the same place, and at the same angle every time. Whilst it would only be a very minor error, and probably not even one that would register, it would be the kind of thing that niggled away at me.

However, being hand-held introduces the much bigger possibility that the damned thing will get dropped into the tank and never seen again. So to mitigate BOTH of these possibilities, it will be fixed onto a length of wood, which is then placed over the tank opening - so that the measurement is taken from the exact same height and angle every time (and if it IS dropped in the tank, at least the wood will float).

A push button activates the unit (thereby eliminating the need for an on/off switch, and the possibility of an accidentally flattened battery), and fires up the sketch in the Arduino. This takes a number of readings from the HC-SR04, and takes the average of them (to mitigate any erratic readings).

I also included a bit of code to check for high or low on one of the Arduino digital I/O pins, and use that to put the unit into what I called 'Calibration' mode. In this mode, the display simply shows the actual distance (divided by 2) returned by the sensor, so I could check the accuracy of it against a tape measure.

Step 3: The Ingredients

The unit consists of three main components...

  1. An HC-SR04 ultrasonic transmitter/receiver module
  2. An Arduino Pro Mini microcontroller
  3. A 4 digit 7 segment LED display or display 'module' such as a TM1637

All of the above can be easily found on ebay, by simply searching for the terms shown in bold print.

In this application, the display simply uses 3 digits to display a % value of 0-100 or 4 digits to show the number of litres (max 2000 in my case), so any 4 digit display will do - you don't have to worry about whether the module has decimal points or colons. A display 'module' (LED mounted on a breakout board, with an interface chip) is easier, as it uses fewer pin connections, but a raw LED display with 12 pins could be accommodated by the Arduino with some small modifications to the code (in fact my original design was based on this setup). Note however, that using a raw LED display also requires 7 resistors to limit current drawn by each segment. I happened to have a TM1637 clock display module available, so decided to use that.

Supplemental bits and bobs include a 9v battery clip (and battery, obviously), a 'push-to-make' momentary push button switch, a project box, header pins, connecting wires, and a length of 2"x4" timber that exceeds the diameter of the tank opening.

The supplemental bits and bobs (apart from the hunk of timber) were purchased from my local hobby electronics outlet chain - which is Jaycar in Australia. I imagine Maplin in the UK would be a viable alternative, and I think there are a few in the US, such as Digikey and Mouser. For other countries, I'm afraid I don't know, but I'm sure that if you lack a suitable high street outlet or online supplier in your country, then Chinese ebay sellers will come through for you, if you don't mind waiting a few weeks for delivery (ironically, despite being one of our closest neighbours, 6 weeks or more is not unusual for delivery to Australia from China!).

Make sure you get a project box that is big enough - I guessed at mine before having the components available, and it is a really really tight squeeze - I may need to get myself a different push button that uses less space.

Oh, and by the way, the length of timber just came from some scrap offcuts I keep in the corner of my garage (as a home for more of those lovely spiders).

Once you understand the scematic and functionality, you may decide to adapt your version, and include an on/off switch, or use an 18650 Li-Ion power source, with solar panel and charge controller to keep it constantly topped up and ready to go, or change the simple LED display for a multi-line LCD or graphical OLED with more information display options, such as showing the percentage AND litres remaining at the same time. Or you may go for the all-singing, all-dancing wireless IoT unit permanenty installed in the tank WITH solar charging. I'd love to hear of your variations and modifications.

Step 4: Testing the Prototype (and Code)

Having purchased the HC-SR04 from a cheap Chinese source on ebay, I wasn't really expecting to receive a hugely accurate unit, so I wanted to test it out on the breadboard first, in case I needed to add some distance correction code into my sketch.

At this point, I was casting around for basic info on how to connect up and use the HC-SR04, and must acknowledge jsvester's instructable "Simple Arduino and HC-SR04 example". His example and experience was a great starting point for me to start coding from.

I found the NewPing library of functions for the HC-SR04, which includes built-in functionality to take the average of multiple readings, thereby making my code a lot simpler.

I found a library for the TM1637 clock display module as well, which made displaying numbers a lot simpler. In my original code (for the 4-digit 7 segment display), I was having to split the number into individual digits, then build each individual digit on the display by knowing which segments to illuminate, and then cycling through each digit in the number, and building that number on the appropriate display digit. This method is called multiplexing, and effectively displays just a single digit at a time, but cycles through them from one digit to the next so quickly, that the human eye doesn't notice, and fools you into believing that all the digits are on at the same time. As with the HC-SR04 library making the measuring operations easier, this display library takes care of all the multiplexing, and digit handling. The Arduino Reference pages linked to above, give some examples, and of course, each library comes with sample code that can be a great help.


So, the pictures above show my test rig - I am testing it on my Arduino Uno for simplicity, as that is already setup for temporary re-usable connections for prototyping. The unit is operating in 'Calibration' mode here (notice that digital pin 10 - the white wire - is connected to ground) and accurately reading 39cm to the box I had randomly placed in front of it, as shown by the tape measure. In this mode, I display the small 'c' ahead of the measurement, just to indicate it is not the normal measurement.

As well as Vcc (5v) and Ground, the HC-SR04 needs 2 other connections - the trigger (yellow to pin 6) and echo (green to pin 7). The display also needs Vcc (5v) and Ground, and 2 more connections - clock (blue to pin 8) and DIO (purple to pin 9). As already mentioned, the operating mode is controlled by a high or low on pin 10 (white). The connections will use the same pins on the Arduino Pro Mini, but will be permanently soldered. The operating mode will be selectable using a jumper across two out of three header pins, connected to Vcc, pin 10, and ground respectively.

The official specs for the HC-SR04 claim something like a maximum error of just 3 millimeters up to the maximum designed operating distance of 4 metres, so imagine my surprise to find that my unit certainly was accurate to that degree up to 2 metres - which is well in excess of what I need. Due to limited space for a quick and dirty test setup, my test results beyond that distance were being corrupted by reflections from surfaces other than my test target, as the beam from the transmitter spread out and took in a wider area. But as long as it is good to 1.5 metres - that'll do me nicely, thank you very much :-)

Step 5: Rainwater Gauge Ino Sketch

The full code is attached, but I will include a few extracts below to explain some of the steps.

First of all, the setup...

#include <TM1637Display.h>
#include <NewPing.h>
#include <math.h>

// pins for HC-SR04
#define pinTrig 6
#define pinEcho 7
NewPing sonar(pinTrig, pinEcho, 155); // 400cms is max for HC-SR04, 155cms is max for tank

// LED Module connection pins (Digital Pins)
#define CLK 8
#define DIO 9
TM1637Display display(CLK, DIO);

// Other pins
#define opMode 10

As well as the TM1637 and NewPing libraries, I have also included a Math library, which gives me access to the 'rounding' function. I use this in some of the maths to allow me to display the percentage to the nearest 5% for example.

Next the pins for the two devices are defined, and the devices initiated.

Finally, I define pin 10 for the operation mode.



// set all segments off for all digits
  uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x00 };
  display.setSegments(bytes);

This section of code demonstrates one way to control the display module, allowing individual control of each segment in each digit. I have set the 4 elements in the array called bytes, to all be zero. That means that each bit of each byte is zero. The 8 bits are used to control each of the 7 segments and the decimal point (or the colon in a clock type display). So if all the bits are zero, then none of the segments will be lit. The setSegments operation sends the contents of the array to the display and shows (in this case) nothing. All segments are off.



The most significant bit in a byte controls the DP, and then the remaining 7 bits control the 7 segments from G to A in reverse order. So to display the number 1 for example, requires segments B and C, so the binary representation would be '0b00000110'. (Thanks to CircuitsToday.com for the image above).



  // Take 10 readings, and use median duration.
  int duration = sonar.ping_median(10);  // duration is in microseconds
  if(duration == 0)   // Measuring Error - inconclusive or no echo
  {
    uint8_t bytes[] = { 0x00, 0b01111001, 0b01010000, 0b01010000 }; // Segments to spell "Err"
    display.setSegments(bytes);
  }

Here, I am telling the HC-SR04 to take 10 readings, and give me the average result. If no value is returned, then the unit is out of range. I then use the same technique as above to control specific segments on the 4 digits, to spell out the letters (blank), E, r, and r. Using binary notation makes it a little easier to relate the individual bits to the segments.

Step 6: Loading Code to an Arduino Pro Mini (without USB)

As I said earlier, items from Chinese ebay sellers often take 6 weeks or more to arrive, and a lot of my prototyping and code writing was done while waiting for some of the components to arrive - the Arduino Pro Mini being one of them.

One thing I didn't notice about the Pro Mini, until I had already ordered it, is that it doesn't have a USB port on it for downloading the sketch. So, after some frantic googling, I found that there are two ways to load a sketch in this case - one requires a special cable that goes from the USB on your PC, to 6 specific pins on the Pro Mini. This group of 6 pins are known as the ISP (in-system programmer) pins, and you can actually use this method on any Arduino if you wanted to - but as the USB interface is available on pretty much all the other Arduino variants (I think), using that option is much simpler. The other method requires you to have another Arduino with a USB interface on it, to act as a 'go-between'.

Luckily, having my Arduino Uno meant that I could use the second method, which I will outline for you below. It is called using the 'Arduino as ISP'. In a nutshell, you load a special sketch onto your 'go-between' Arduino, that turns it into a Serial Interface. Then load your actual sketch, but instead of the normal upload option, you use an option from the IDE menu that uploads 'using the Arduino as ISP'. The 'go-between' Arduino then takes your actual sketch from the IDE, and passes it on to the ISP pins of the Pro Mini, rather than loading it to its own memory. It isn't difficult once you get your head around how it works, but it is an extra layer of complexity that you might want to avoid. If that's the case, or you don't have another Arduino you can use as the 'go-between', then you might want to buy an Arduino Nano, or one of the other small form factor models, that does include the USB interface and makes programming a simpler prospect.

Here are a couple of resources that you might find helpful in understanding the process. The Arduino Reference is specifically referring to burning a new bootloader to the target device, but you can just as easily load a sketch in the same way. I found Julian Ilett's video makes the concept a lot clearer, though he skips the part in the Arduino reference that explains how to wire the two Arduinos together, and programs a bare chip on a breadboard instead.

As the Pro Mini does not have the 6 ISP pins conveniently grouped together, you need to decode which of the digital pins relate to the 4 programming pins (the other two connections are just Vcc and Gnd - so are pretty straightforward). Luckily for you, I've already been through this - and am willing to share the knowledge with you - what a generous person I am!!

The Arduino Uno, and many others in the Arduino family, have the 6 pins handily arranged in a 3x2 block, like this (image from www.arduino.cc).

Unfortunately, the Pro Mini doesn't. As you can see below, they are actually quite easy to identify and are still arranged in 2 blocks of 3 pins. MOSI, MISO, and SCK are the same as digital pins 11, 12, and 13 respectively on both the Pro Mini and Arduino Uno, and for ISP programming, simply connect 11 to 11, 12 to 12, and 13 to 13. The Pro Mini's Reset pin should be connected to the Uno pin 10, and the Pro Mini's Vcc (5v)/Ground should be connected to the Arduino +5v/Ground. (Image from www.arduino.cc)

Step 7: Assembly

As I mentioned, I took a punt on the case, and regretted it. To fit all the components in was a real squeeze. In fact I had to bend the push button contacts out sideways, and put some packing on the outside to lift it a bit further so that it would fit in the depth of the box, and I had to grind 2-3mm off each side of the display module board for it to fit too.

I drilled 2 holes in the case for the ultrasonic sensors to poke through. I drilled the holes a little too small and then gradually increased them using a small rotary grinder, so I could get them to be a nice 'push fit'. Unfortunately, they were too close to the sides to be able to use the grinder from inside the box, and this had to be done from outside, resulting in many scratches and skate marks where the grinder slipped - oh well, that's all on the bottom anyway - who cares..?

I then cut a slot in one end that is the right size for the display to poke through. Again - my guess on the box size bit me on the rear as the slot left me with a very slim piece above the display, which inevitably broke while I was filing it smooth. Oh well - that's what super-glue was invented for...

Finally, with all the components roughly positioned in the box, I measured where to put the hole in the lid, so that the body of the push button would fall into the final available space. JUST!!!

Next, I soldered all the components together to test they all still worked after my bending and grinding and trimming, before assembling them all into the case. You can see the jumper connection just below the display module, with pin 10 on the Arduino (white lead) connected to Gnd, thus putting the unit in calibration mode. The display reads 122cms up from my bench - it must have picked up a signal reflected back from the top of the window frame (its too low to be the ceiling).


Then it was a case of breaking out the hot glue gun, and shoe-horning all the components into place. Having done that, I found that the tiny clearance between the top of the display module and the lid, once the module was glued in place, left a bit of a bulge where the lid won't quite fit as snugly as I'd like. I might try and do something about that one day - or more likely, I won't...

Step 8: The Finished Article

After a few post-assembly tests, and a correction to my code to account for the depth of the chunk of wood I'd screwed the device to (which I completely overlooked in my calculations - d'oh!!), it's all done. Finally!

Assembled testing

With the unit just sitting face down on my bench, obviously there will be no reflected signal, so the unit correctly shows an error condition. The same would be true if the closest reflecting surface is beyond the unit's range.

Looks like from my bench top to the floor is 76cms (well, 72cms plus the 4cm depth of the chunk of wood).

The underside of the unit, showing the transmitter and receiver overhanging the chunk of wood - I should really stop calling it a chunk of wood - it will henceforth be referred to as the Gauge Stabilisation and Precision Placement Platform! Thankfully, this is probably the last time I'll mention it ;-)

Ooh - you can see all those nasty scratches and skate marks in this one...

... and here is the finished item, placed in normal operating mode, actually measuring the capacity of my tank to the nearest 5%. It was a (very) rainy Sunday afternoon that saw me finish this project off, hence the raindrops on the unit, and the very pleasing 90% reading.

I hope that you've enjoyed reading this instructable, and that you learned a little about Arduino programming, physics and the use of sonar/ultrasonic reflection, the pitfalls of using guesswork in your project planning, and that you have been inspired to make your own rainwater tank gauge - and then to install a rainwater tank to use it on, while helping the environment a little and saving on your water bill.

Please read on - for what happened the next day...!

Step 9: Postscript - One Hundred (and Five) Percent?

So, on the Monday after the rainy Sunday, the tank was absolutely as full as it could possibly be. As it is one of the very few times I have ever seen it completely full, I thought it would be the ideal time to benchmark the gauge, but guess what - it registered as 105%, so there was obviously something wrong.

I got out my dipstick and found that my original assumptions of 140cms as the maximum depth of water, and 16cms of headroom (based on visual guesstimates made from outside the tank), were both a little off the actual measurements. So armed with the real data for my 100% benchmark, I was able to tweak my code and reload the Arduino.

The maximum water depth turns out to be 147cms, with the measuring point sitting at 160cms, giving 13cms of headroom (the sum of the headroom within the tank, the height of the neck of the tank, and the depth of the chunk of... whoa, no, what?! I mean depth of the Gauge Stabilisation and Precision Placement Platform!).

After correcting the maxDepth and headroom variables accordingly, as well as resetting the maximum range of the sonar object to be 160cms, a quick retest showed 100% that dropped to 95% as I lifted the gauge a little (to simulate a small amount of the water having been used).

Job done!

PS - this is my first attempt at an instructable. If you like my style, sense of humour, honesty to admitting mistakes (hey - even I am not perfect...), etc - let me know and it may give me the boost to do another one.

Step 10: Afterthoughts

Usable Capacity

So it has been a few weeks now since I published this Instructable, and I have had many comments in response, some of which have been suggesting some alternative mechanisms - both electronic and manual. But this got me thinking, and there is something I should probably have pointed out in the beginning.

  • My tank has a pump, which is installed at ground level - just slightly below the base of the tank. As the pump is the lowest point in the system, and the water from the pump is under pressure, I can use the full capacity of my tank.
  • HOWEVER - if your tank does not have a pump, and relies on gravity feed, then the effective capacity of the tank is limited by the height of your tap. Once the water remaining in your tank is lower than the tap, then no water will flow.

So, regardless of whether you are using an electronic gauge, or a manual sight glass, or float and flag type system, just be aware that without a pump, the effective 'base' of your tank is actually the height of the tank's outlet or tap.

Share

Recommendations

  • Creative Misuse Contest

    Creative Misuse Contest
  • Clocks Contest

    Clocks Contest
  • Water Contest

    Water Contest

26 Discussions

Hi, I like your instructable, both for the humour and the great explanations, but in a humorous way, can I ask why you didn't base your project on a simple 1mm to 1cm internal diameter plastic tube, tapped into the base of the 1.5 metre high tank and attached to the side of the tank? Steam punky I know, but..

All in good fun, your instructable is really excellent

5 replies

Hi cobourgdave - many thanks for your kind comments - I am glad you enjoyed the instructable, and my style of writing.

In answer to your question - I’d say why make a simple solution where there is a complicated technical solution that will give me an excuse to indulge my hobby?
LOL - sorry, I don’t mean to sound facetious.
But in all seriousness, my intention was provide an entertaining article that illustrated some electronics and programming principles, and offered some tutelage thereof. The problem it solved was more of an excuse than a reason. Admittedly, it was a tongue-in-cheek and highly over-engineered solution to an actual problem I had, but like I say - one that allowed me to indulge myself in my hobby. This was never intended to be a recommended, best, simplest, or cheapest solution - just my particular take on it based on my skill sets.
I thought about mechanical solutions involving floats and pulleys with an external flag or scale, but that meant some permanent means of getting the string from inside to outside, and affixing pulleys, etc.
I also considered a simple transparent plastic indicator tube up the side of the tank, plumbed in at the bottom and top, but my concerns were a) the likelihood of it leaking where I drilled into the tank (it’s a corrugated tank with no flat surfaces anywhere), b) the need to drain the tank to do it (and how long it might be before I could recover that water - it doesn’t rain often here, and 2000 litres of water is a valuable standby commodity), and c) the tube - being exposed to daylight - ending up green with algae so I couldn’t see the water level anyway.
But you are right - there’s certainly more than one way to solve this problem - even just using electronics!!
Thanks again for your comment.

As I said I enjoyed your instructable both for style and content. My comment was in fun and in no way was meant to be a downer. You certainly demonstrated quite a number of skills in your solution. Myself, I troll all the instructables for new and interesting ways to do things, and I happily agree that you met this criteria.

you probaly mean trawl the instructables. :)

LOL - yeah, I don't want anyone trolling me!! See the "be nice" policy!!!

Ha ha - worry not. Your comment was received exactly as you intended.

0
user
mitri

4 months ago

Hi,

Thanks for the instructable, Will definitely give it a go. Can i ask a Q though, (im not a very proficient coder). You list the values for maxDepth, headroom and capacity in your script, but i cannot see where you have used capacity. Is capacity actually used / required? I assume this references the capacity of your tank, correct?

// Global Variables

int maxDepth = 140;

int headroom = 15;

int capacity = 1750;

Thanks

m

1 reply

Hi mitri - yes, you are absolutely correct, and well spotted! Thanks for pointing it out, eagle eye.

That declaration is a throwback to my mkI version of the code (the original breadboard test). Using the nominal capacity and percentage together, I could work out the remaining capacity in litres - however, knowing I have 749 litres left is a little less meaningful than seeing 35% indicated - at least, that's what I felt at the time... I'm having second thoughts about it now, and am considering a change to my sketch so that the display alternates between the percentage and actual capacity in litres once per second.

I thought I had left the extra calculation line in the code, just commented out, but I see now that I must have deleted it when taking out all my extra testing and troubleshooting code.

If I revisit this issue, I think that rather than simply using a nominal capacity based on the manufacturers claim (which is probably based on the tank's total volume, and not accounting for the volume lost from the overflow point up to the top of the tank), I would calculate an exact value based on the maxDepth and surface area of the water (easily calculated from the length and breadth of the tank). So I would either manually calculate a new and exact value for the capacity variable, or I would replace the variable with a new one called surfaceArea, and have the Arduino recalculate capacity each time (but it can do that thousands of times per second without breaking a sweat - so no worries there!).

I'll add a postscript amendment into the instructable, along with mkIII of the code if I do make this change.

Hi Wroger-Wroger - all great manual alternatives. I like the squirty one in particular - it wouldn't work on mine as it has a pump to give the same pressure regardless of head, but I like the concept. I guess another idea might be to use the clear plastic hose but just put a standard tap fitting on it and turn the tap on while holding the tube above your head, rather than having to plumb it on to the tank...

Nice One! i can see me trying this one out; i was planning this as a project for a water management system of linked cubes.although i dont actually like Arduino's IDE, the hardware cost less than i payed from the bare chips from Mouser; IF you are willing to wait for it..! (though post from Mouser's warehouse in Texas took 1 1/2 days to get to the Paris postal hub...then another three days to go 3 hours down the road...80/ )

Water butts can be a pain in the butt.at a freinds house in Normandy its either boom or bust; the 1M square cubes there are either overflowing enough to re-enact the battle of the Somme,or just a layer of green slop lurking at the bottom...all from just half a of a shelter's tin roof...(the mule doesnt like the rain!) like you say;when it rains it RAINS!

It's a wierd world when it takes 6 weeks for a packet from Shenzen China to reach Australia; but a packet (some French PIC dev. boards, bought back!) from Wagga Wagga NSW Australia took just a few days to reach me here in France (faster than one from central Paris.. 3 hrs away!)

This sytem is a MAJOR technological advance over her 'system' of broken dayglo plastic fence pickets jammed into pop bottles,with stones as ballast that 'remote' monitors the water level in plastic dustbins. if you can't see 'em...they're empty Stone-Age WiFi ;0)

1 reply

Hi Hackinblack - yeah, don't get me started on ebay delivery times from China!!

I imagine that your friend's 1M water cubes are either all connected at the lowest point and fill up simultaneously, or are in a cascading arrangement where the first fills up, then overflows into the second, which fills up and overflows into the third, etc...? You would need to have the first arrangement for my version of the gauge to work, so that all the cubes fill or drain at the same rate - then a measure of capacity in any tank can simply be multiplied by the number of tank units to get an overall capacity, and obviously the water and tank depth can be used to calculate the percentage (as I have done with mine) regardless of the number of tank units.

Good luck with dragging the stone-age dipstick solution into the current century.

0
user
krf

4 months ago

I'm in the process of building something similar to track the water depth in my sump pump catch basins. My plan is to replace the display with a connection to a board that I can use to log data to the cloud.

By the way, SparcFun sells a Pro Micro that has a USB Port. Earlier this year the were on sale for $9.95.

1 reply

Logging data sounds like a cool enhancement. Logged data can map usage against capacity against weather trends or actual rainfall. Nice idea. I love statistics and data analysis!

Ironically, I read somewhere that the USB interface is one of the components that push the Arduino prices up, especially for genuine suppliers like Adafruit and SparkFun who would no doubt use the properly licensed FTDI USB interface. The cheap clones coming from China use an alternative USB interface chip (CH340G) which bypasses the FTDI licensing cost, and brings their prices down considerably, and a Pro Mini with no USB on it at all... well, I got mine for $2.65!!

Excellent, it's like you read my mind. I have some similar need, and because of having too high expectations (i imagined it to be wireless, and save records, and it send low level alarms to cellphone via Twitter) i have done nothing.

I guess it's better to start with the most important, and after add stuff.

It's quite a long reading but you made it fun so i went trough all of it, you have a pretty good writing style.

1 reply

German_MX - absolutely true... Taking the first step is probably the most difficult. We often find it easier to make excuses NOT to start, and sometimes when we DO start we wish we hadn't, but most often, once momentum is gained and the journey started, seeing it through to the end is both rewarding, and potentially the start of a new journey. OK - enough with the metaphors - get on and just start making - the bells and whistles can come later, or on v2.0

All the best :-D

Oh, and thanks for the compliments ;-)

Many thanks MauriceT2. I know its a long read, but I wanted to make it an enjoyable one too.

To warn of a possible overflow, just install a level switch with a ping pong ball as a float near the level you wish to warn, and add that switch as a new input to the Arduino.

0
user
ka1axy

4 months ago

Well done! Both the article style and the project.

Now, the way these projects usually work out for me, is that once the "basic" version is done, and feasibility has been proven, I go out and buy a second set of parts for the "enhanced" version. So, get that solar panel, LiIon power pack, Arduino wifi shield, etc, on order and let's see the next iteration!

(also a Nikon user -- let's see some star photos from the Outback to illustrate the next project!)

1 reply

Thanks 'also a Nikon user' - I like your enthusiasm! Sadly, anything that even makes it from breadboard to a project box is considered a total and absolute success in my book ;-) Version twos seldom happen, other than in my imagination - so I'm hoping someone else will take on that challenge for me, and I can at least claim the kudos for being the 'inspiration'...

Star trails in the outback - are on my agenda once I retire. Only ten (long) years to go now...