Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Water Level Gauge for the "Sump" Below my Observatory


Gina

Recommended Posts

Thank you Richard :)  The pump is already equipped with its own float switch.  I want to know when it fails and how high the water is so that I can service it and avoid the support timbers "getting their feet wet".  If I can keep water below the top of the foundations, the DPC will keep the timbers dry.  I'm going to provide a backup pump but I would still like to know what the water level in in wet weather.

Ah, that'll teach me for not reading the thread properly. Also my memory failed me, that fishpond switch actually failed, and I ended up getting two of these from Deeter, one for the top and one for the bottom. http://www.deeter.co.uk/products/float-switch-liquid-level-sensors-overview/50-series-vertical-liquid-level-sensors-float-switch/50-series/de54-50a01

They do a variety of level sensor switches as well so they've probably got something that's suitable, I seem to remember they were very helpful on the phone when I spoke to them.

Link to comment
Share on other sites

  • Replies 148
  • Created
  • Last Reply

Dug out an Arduino UNO and checked it works.  Been online and found a sketch for the HC-SR04 ultrasonic unit and uploaded it to the Uno successfully.  Now I just need to connect the HC-SR04 and see what's what :D  The sketch simply sends the distance read to a computer using the Serial Monitor.  This will do for testing and I can work out what I want to do with the info and how to send it to the house later.

Connections :-

post-13131-0-57655100-1452186791.jpg

Arduino sketch :-

/* HC-SR04 Ping distance sensor: VCC to arduino 5v  GND to arduino GND Echo to Arduino pin 7  Trig to Arduino pin 8  This sketch originates from Virtualmix: http://goo.gl/kJ8Gl Has been modified by Winkle ink here: http://winkleink.blogspot.com.au/2012/05/arduino-hc-sr04-ultrasonic-distance.html And modified further by ScottC here: http://arduinobasics.blogspot.com.au/2012/11/arduinobasics-hc-sr04-ultrasonic-sensor.html on 10 Nov 2012. */#define echoPin 7 // Echo Pin#define trigPin 8 // Trigger Pin#define LEDPin 13 // Onboard LEDint maximumRange = 200; // Maximum range neededint minimumRange = 0; // Minimum range neededlong duration, distance; // Duration used to calculate distancevoid setup() { Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(LEDPin, OUTPUT); // Use LED indicator (if required)}void loop() {/* The following trigPin/echoPin cycle is used to determine the distance of the nearest object by bouncing soundwaves off of it. */  digitalWrite(trigPin, LOW);  delayMicroseconds(2);  digitalWrite(trigPin, HIGH); delayMicroseconds(10);   digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH);  //Calculate the distance (in cm) based on the speed of sound. distance = duration/58.2;  if (distance >= maximumRange || distance <= minimumRange){ /* Send a negative number to computer and Turn LED ON  to indicate "out of range" */ Serial.println("-1"); digitalWrite(LEDPin, HIGH);  } else { /* Send the distance to the computer using Serial protocol, and turn LED OFF to indicate successful reading. */ Serial.println(distance); digitalWrite(LEDPin, LOW);  }  //Delay 50ms before next reading. delay(50);}
Link to comment
Share on other sites

Not had time to check out the ultrasonic sensor as yet but I've been thinking about how to get the data from the scope room into the house.  I have a water pipe that goes from the defunct weather station mast just outside the observatory underground to the back porch.  It used to contain a CAT5 cable but that got chewed off by rats :(  As long as the pipe itself hasn't been chewed through, I might be able to replace the cable. 

Now to the question :- I was wondering about connecting Arduinos by the sarial connections over CAT5 twisted pair - has anyone done this and does anyone know how far this can reach.  The distance involved here is something like 15-20m.

Link to comment
Share on other sites

Been Googling but nothing specific as yet.  Using I2C and pins A4 & A5 looks a possibility and relatively easy using the Wire Library and 2 pairs in the cable.  Don't know about the range though.  Carrying on Googling...

Later...  No good - distance limited to just 2m :(

Remember that I2C is not designed for long cable lengths. Depending on the cable type used, 2 meters might already cause problems.

Link to comment
Share on other sites

I am a devotee of the so called one-wire bus and devices and it occurred that it might be possible to use the one-wire bus to connect Arduinos.  Originally I was thinking of using a one-wire device as a data collector but to make an Arduino actually emulate a one-wire device on its own would make for a simpler solution avoiding the extra device (most of them are in SMD form only and difficult to connect to).  I have found  this article  which perports to do exactly this by simulating a DS18B20 OW temperature sensor.  Only looked at part of it so far (80 page PDF) but will give it a good read and see if it will do what I want.  If it works it would be a very useful idea as I would be able to collect weather data and other stuff from remote Arduinos to display in the living room.

Link to comment
Share on other sites

Well, I've read through the article mostly though barely scanned the code sections.  It seems this works but I may have a problem working out how I can use it - it's extremely complicated.  I might go for an alternative approach as less strain on the brain :D  I'll probably set up the ultrasonic sensor first and see how that goes.

OTOH although the ultrasonic system would give me good resolution (more than necessary really) I'm wondering if a simple 1-wire measurement system with limited resolution would be far simpler and easier.  ie. not use an Arduino in the water level sensor at all - just a 1-wire device and a few simple components.  The wind instruments in the weather station are purely 1-wire - anemometer with a counter chip and wind vane a 4-bit A/D converter chip with IR LEDs and phototransistors and a few resistors. 

The 1-wire system works up to 100m using CAT5 cable and I have personal experience of using it reliable over 20-30m while testing my weather station ideas.

Link to comment
Share on other sites

I need to take a step back and examine the overall requirements.  The project breaks down into three sections.

  1. Measuring the water level.
  2. Transmitting the data from the observatory to the living room.
  3. Displaying the data.

Other things being equal (which they aren't) the simplest water level sensor would be the ultrasonic sensor and Arduino.  Device simply connected to Arduino with 4 wires.  No contact with the water needed, no float, no mechanics - just sensor and Arduino in a box.

The information can be displayed either with an analogue dial plus LED to show pump operation (or 2 LEDs for 2 pumps) or all LEDs.  In both cases an Arduino is indicated (could be shared with weather station dials perhaps).  So that's no problem.

The sticking point seems to be the transmission of data.  Using CAT5 cable gives 4 signal lines with returns or 4 balanced twisted pair transmission lines.  Or it would be possible to use two cables giving 8 parallel data lines.  One main point about this project is that the data rate required is extremely low - even one water level measurement a minute would be alright - we aren't talking about hundreds of kilohertz here.  I think the reason I2C is not recommended for long range may be that it's trying to sent high speed data.  I think this must be to do with the Wire Library.

For this project with it's very low data rate I think plain code is all that's required.  The transmission of the weather station data is a different matter and not relevant here anyway.  I still have a considerable length of CAT5 cable I haven't yet used so I could run more than one cable.  OTOH with a very low data rate it doesn't need to be used as transmission line and I reckon could handle 6 data lines and two wires as return/ground (2 for reduced resistance).  The receiving end in the house could use the analogue inputs on an Arduino coded as Schmitt trigger data receivers to reduce the affect of noise.  Capacitors from data lines to ground would also help.  The transmitting end in the scope room can simply use digital outputs (though series resistors may help stop line reflections).  4 data bits would give 16 levels and the other two lines would come from the two pumps.

Link to comment
Share on other sites

Connected the ultrasonic tranducer unit to the Arduino Uno as shown in post #27  running the sketch shown and it's working.  Just using my hand to refluct the sound waves.  The distance from unit to reflector is displayed in the Serial Monitor in cm.

Link to comment
Share on other sites

If I mount the ultrasonic unit at 50mm below the floorboards the range of measurement is 200mm to 400mm as shown in the diagram below.  This range can be divided into 16 levels by suitable arithmetic on the measurement and can be referenced to ground level by, in effect, subtracting 400mm and inverting the sign. The result would be a reading varying from 0 to 15.

post-13131-0-77502100-1452292834_thumb.j

Link to comment
Share on other sites

Gina, could you use an Arduino to read the sensor then output an analog voltage. This can be read via a DS2438 1-wire chip, which has an ADC and transmittted back to your house over 1-wire. I have a wind vane in my weather station (Inspeed) that uses this chip to give a wind direction accurate to 1 degree.

Link to comment
Share on other sites

Thanks Dave :)  Ah yes, I've used those chips before, very useful devices :)  I like the idea of using 1-wire as I can add other devices directly to the bus.  I have decided that using ultrasonic sensor + Arduino is by far the easiest solution.

Link to comment
Share on other sites

Gina, assuming your pump fails what sort of warning will you get in the house?

Ed

I'm thinking of an analogue dial for the display (or possibly a vertical row of LEDs - green, blue, yellow, red) plus LEDs for pump operation.  Then probably an audio warning if both pumps fail.  I have a second pump as a backup to be positioned a bit higher than the main pump that should operate if the first pemp fails.  I decided on a backup pump as the one I've been using has failed on several occasions.

Link to comment
Share on other sites

I think the only downside, as you have already mentioned is they come in SMD packages these days. Hard to solder but not impossible.

Yes, I know but I think I can still manage to solder wires to the legs.  I have a very good anglepoise type ring light and magnifier that makes fine work do-able :)  The way I use SMDs is to stick them to stripboard on their backs and then run thin wires from their feet to the stripboard.  At least the DS2438 has only 7 connections.  I have ordered a couple from ebay due to arrive Tuesday.

Link to comment
Share on other sites

Although I really like the 1-wire solution, I have had another idea for data transmission.  The data could be digital with analogue input at the receiver and Schmitt trigger coding as mentioned above but I could send variable length pulses where the pulse length represents the data.  This would use just one line for the water level data.

Link to comment
Share on other sites

Good method. I think I posted these before. The chip is in an SMD to 0.1" DIL adapter I used a flux pen to coat all the surfaces and pre-tinned the legs & solder pads. Then just held it in place & touched each leg in turn to complete the connection. I think it's a DS2408 but I haven't used it for a project yet :D

post-28249-0-77981500-1452337899_thumb.j

post-28249-0-21459400-1452337908_thumb.j

Link to comment
Share on other sites

I thought this looked the "bees knees" at first but further reading showed it to be I2C to 1-wire Master whereas what's wanted is a Slave.  The Arduino, with appropriate libraries, already provides the Master function without any extra device.  Nice try though :)

Link to comment
Share on other sites

I thought this looked the "bees knees" at first but further reading showed it to be I2C to 1-wire Master whereas what's wanted is a Slave.  The Arduino, with appropriate libraries, already provides the Master function without any extra device.  Nice try though :)

Oh well. I didn't read it too closely.

Link to comment
Share on other sites

Here's one idea for the water level dial.  This would be on the wall in the living room between weather dials and moon phase clock/calendar.  I'll add a couple of LEDs to show when one or other of the pumps is operating.

post-13131-0-34466000-1452341955_thumb.j

Link to comment
Share on other sites

Currently have torrential rain and hail with thunder and lightning - twice the power has gone off for a split second due to lightning strikes and the last time was virtually overhead and there was a loud crack to my left but main computer and router are still working and so is the phone.  I guess sometime in the near future I'll find something that's broke :(  Storm now moving away :)  Ground is flooded but can't see any water under the obsy.

Link to comment
Share on other sites

Here's an idea for a multi-LED display.  Much more complicated to make than the pointer dial with servo motor drive and less resolution but takes up less room.  Could have one LED on or maybe a bar display with all LEDs lit below water level.  The first option would be easier I think.  I either case I would need extra circuitry unless I use an Arduino Mega.

post-13131-0-09415800-1452344298.jpg

Link to comment
Share on other sites

Rain stopped briefly and I was able to get the post from the gate - bilge pump pipe - and take a look in the observatory.  Inside dry and the pump slurping away merrily every few minutes.  About an inch of water in the bottom of the hole :)  On the ground away from the obsy the water was up to 2" deep in places.  Now pouring again and getting heavier :(  Quite windy too.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.