Storing Cookies (See : http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm ) help us to bring you our services at overunity.com . If you use this website and our services you declare yourself okay with using cookies .More Infos here:
https://overunity.com/5553/privacy-policy/
If you do not agree with storing cookies, please LEAVE this website now. From the 25th of May 2018, every existing user has to accept the GDPR agreement at first login. If a user is unwilling to accept the GDPR, he should email us and request to erase his account. Many thanks for your understanding

User Menu

Custom Search

Author Topic: Water Level Indicator...For HHO project.  (Read 10319 times)

HeuristicObfuscation

  • Newbie
  • *
  • Posts: 7
Water Level Indicator...For HHO project.
« on: December 29, 2013, 08:18:01 AM »
If your looking to have an indicator for your water projects this is a neat circuit.. enjoy..

http://www.youtube.com/watch?v=38C87blai...VoLnAJKwRw

Justalabrat

  • Jr. Member
  • **
  • Posts: 93
Re: Water Level Indicator...For HHO project.
« Reply #1 on: December 29, 2013, 04:35:45 PM »
Something is wrong with the video, it doesn't run.

HeuristicObfuscation

  • Newbie
  • *
  • Posts: 7

TinselKoala

  • Hero Member
  • *****
  • Posts: 13958
Re: Water Level Indicator...For HHO project.
« Reply #3 on: December 29, 2013, 11:29:29 PM »
@HO:
When I watch your videos, one word keeps popping up in my mind:

ARDUINO.

Your various projects are perfect targets for Arduino control. One Arduino Uno will replace all the timer and logic chips that I've seen you use in your projects, and you'll have much more flexibility for your controls. For example your "Sequencial Voltage Amplitude control" can be done with just the Arduino and the potentiometer, no timer or other chips needed. A little programming change and you can vary the amplitude, or even have each LED (or whatever switching element like SCRs or mosfets) to stay on for a different length of time. And/or you can program in different time sequences: say you want to run at 10 Hz, 50 percent power for the first 23 minutes then ramp up over a span of 5 minutes to full power and 5 Hz for the next 43 minutes ... easy to do with Arduino programming. The water level sensor can also be implemented very easily with Arduino.

The basic program "sketch" code below is tested and works to do the same thing as the "sequencial voltage amplitude control" video shows. Timing and sequencing etc can be changed very easily in the code, you don't have to change component values at all. Say you want very long ON times: just change "maxDelay" from 1000 ms to 10000 ms, then each LED will stay on 10 seconds when pot is set to max delay. Etc.




// Example sketch to light LEDs in sequence with variable speed control (Does what "sequencial voltage amplitude control" video shows)
//
// Put LED anodes to Digital Pins 2-13 (12 LEDpins) with 470 ohm resistors from each cathode to Arduino Ground pin.
// Put potentiometer (any value) with legs from Arduino +5v and Ground pins, wiper to Analog Pin 0 (potPin).
// Comment lines starting with "//" aren't executed.

  //first initialize some variables by name, setting type to "integer" and some initial values:

int LEDpin = 0, potPin = 0, maxDelay = 1000, minDelay = 10;
  // set LED max and min ON times here in milliseconds by changing these values

  //then loop thru to set all LED pins as digital outputs (which give +5 volts as "high" and ground as "low")

void setup() {
for (LEDpin = 2; LEDpin < 14; LEDpin++)
pinMode(LEDpin, OUTPUT);
}

  // Then comes the main program loop to light each LED for the time set by the potentiometer's "analog read" value
  // which is read as a value between 0 and 1023 at the "potPin".  These values are "mapped" to delay values between 1000 ms and 10 ms.
  // The LED stays on for the delay time then turns off.

void loop(){
for (LEDpin = 2; LEDpin < 14; LEDpin++) {
digitalWrite(LEDpin,HIGH);
delay(map(analogRead(potPin),0,1023,1000,10));
digitalWrite(LEDpin,LOW);
 }
}


 

HeuristicObfuscation

  • Newbie
  • *
  • Posts: 7
Re: Water Level Indicator...For HHO project.
« Reply #4 on: December 30, 2013, 12:07:48 AM »

Thanks for the observation.

Ive been meaning to get into the arduino. Just been delaying due to time investment in the programing side.

Im more  hardware inclined but i due realize the benefits of bieng able to control outputs with the stroke of a key.

Any recomendations on best way to get started?

TinselKoala

  • Hero Member
  • *****
  • Posts: 13958
Re: Water Level Indicator...For HHO project.
« Reply #5 on: December 30, 2013, 01:24:23 AM »
Thanks for the observation.

Ive been meaning to get into the arduino. Just been delaying due to time investment in the programing side.

Im more  hardware inclined but i due realize the benefits of bieng able to control outputs with the stroke of a key.

Any recomendations on best way to get started?

Sure: get yourself an Arduino Uno, the basic unit, which can be had for as low as 17 dollars from the internet if you can wait for shipping from Thailand or China, or around 27 dollars in-store from Radio Shack or fast USA shippers like SparkFun.
You can download the programming interface from the main Arduino website right away, and start playing around with it, exploring the basic examples that are included to get the hang of programming (it's basically a flavor of the "c++" programming language, very easy to learn and use.) Then when you have the Arduino, just start loading up the examples and playing around with changing stuff in the program to see what it does.
Then for specific applications, look on the web, there are millions of Arduino programs out there that can be modified to your specific needs.

I just whipped up this following sketch to show the use of the PWM outputs of the Arduino. The sketch above just cycles thru all the digital outputs turning them HIGH in sequence, with no "brightness" control. The sketch below just activates the six PWM outputs of the Uno and uses the potentiometer to control the fade rate as the PWM is swung thru its full range, fading the LEDs up to full brightness and back down to off. So a transistor on the PWM output can then be used to control whatever, downstream, like a motor speed or the current to an electrolysis cell.



/*******************************************************
 Fader PWM Tester
 
 This example shows how to fade an LED on pins 3,5,6,9,10,11
 using the analogWrite() function.
 
 This illustrates the Arduino "Pulse Width Modulation" control system.
 The Uno uses these six pins for PWM, but the Mega can use all
 the pins from 2 thru 13 for PWM.
 
 Wire the LED anodes to each PWM pin, cathodes to 470R to Ground pin.
 
 Modified from the Arduino "Fade" example sketch by TK, December 2013
 Released to Public Domain
 **********************************************************/

int led[] = {3,5,6,9,10,11}; // array of PWM pin numbers
int pinCount = 6;                  // how many PWM outputs in array
int n = 0;                              // just a counter
int brightness = 0;               // how bright the LED is
int fadeAmount = 1;            // PWM increment: how many points to fade the LED by each time thru loop
int potPin = 0;                     // potentiometer wiper to control fade rate
 
void setup()  {
  for(n=1;n<=pinCount;n++)
    pinMode(led[n], OUTPUT);
}

void loop()  {
  for(n=0;n<=pinCount;n++)
   // loop thru LED PWM pin array, set brightness
    analogWrite(led[n], brightness);   
  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;
  // reverse the direction of the fading at the ends of the fade:
  if (brightness == 0 || brightness == 255) {
    fadeAmount = -fadeAmount ;
  }         
  delay(map(analogRead(potPin),0,1023,3,30)); 
  // reads potentiometer, maps reading to set fade rate PWM increment from 3 to 30 ms
}
/*************************************************************************/

TinselKoala

  • Hero Member
  • *****
  • Posts: 13958
Re: Water Level Indicator...For HHO project.
« Reply #6 on: December 30, 2013, 02:03:36 AM »
Here's another little sketch, showing how to use the pot to select which one of the 12 LEDs (or anything attached to a digital output) is turned on. This sketch sets the 12 digital pins to Outputs, then looks at the pot reading (which will be something from 0 to 1023 at the analog potPin) and maps that to a number from 2 to 13, then turns on the corresponding digital output. It checks to see if the pot has been moved, and if it has it turns the present LED off, so that only one LED is on at a time.

Elements illustrated in these three sketches can be combined as needed - you can use several pots to control which output is active, and the PWM rate or peak values, timing or sequencing, etc. or you can even use the "water level" as sensed by your system to control other parameters of operation.

The resistor readings from your water level sense system can be directly subbed into the "potPin" instead of the potentiometer in this sketch, so the LEDs will indicate the water level, and the top level can turn on an audio alarm just as your system does.


// WhichLED: uses the pot (or other voltage input) to control
// which of the 12 LEDs (digital outputs) is ON

int LEDpin = 0, potPin = 0, whichLED = 0, whichLEDold=0;

void setup() {
for (LEDpin = 2; LEDpin < 14; LEDpin++) pinMode(LEDpin, OUTPUT);
}

void loop(){
  whichLED = map(analogRead(potPin),10,1013,2,13);  // uses 10 and 1013 for pot endpoints to provide a "cushion" at the ends
  if(whichLED != whichLEDold) digitalWrite(whichLEDold, LOW);   // tests to see if pot setting has changed, turns off LED if so
  digitalWrite(whichLED, HIGH);   // turns selected LED on
  whichLEDold=whichLED;
}
 

ETA:

Adding the fading function to the above sketch, so that the selected LED fades in and out if it is capable of doing so:

// WhichLED: uses the pot to control
// which of the 12 LEDs (digital outputs) is ON and fading

int LEDpin = 0, potPin = 0, whichLED = 0, whichLEDold=0;
int brightness = 0, fadeAmount = 1;

void setup() {
  for (LEDpin = 2; LEDpin < 14; LEDpin++) pinMode(LEDpin, OUTPUT);
}

void loop(){
  whichLED = map(analogRead(potPin),10,1013,2,13);
  // uses 10 and 1013 for pot endpoints to provide a "cushion" at the ends
  if(whichLED != whichLEDold) digitalWrite(whichLEDold, LOW);
  // tests to see if pot setting has changed since last loop, turns off LED if it has changed
  analogWrite(whichLED, brightness);
  // turns selected LED on with fading
  brightness = brightness + fadeAmount;
  // reverse the direction of the fading at the ends of the fade:
  if (brightness == 0 || brightness == 255)
    fadeAmount = -fadeAmount ;
  delay(3);

  whichLEDold=whichLED; // remember which LED is active
}




TinselKoala

  • Hero Member
  • *****
  • Posts: 13958
Re: Water Level Indicator...For HHO project.
« Reply #7 on: December 30, 2013, 10:13:38 AM »
Sorry... I really didn't mean to hijack your thread. Your water level sensor can be used to feed into the Arduino for display and control, and it inspired me to fiddle around a little bit. I think Arduino control systems would probably help a lot of people with their circuit control and monitoring problems, and controlling an electrolysis cell is an ideal situation. The Arduino can switch the power mosfets on whatever schedule you can program into it, or do it in response to sensor inputs, whatever.

Anyhow, I decided to make a little video illustrating the sketches above, just to show that it's not really "rocket science" and it's easy to get started. No, I'm not an Arduino salesman, I just think they are really neat, kind of like a fully loaded Swiss Army Knife only electronic.

http://www.youtube.com/watch?v=cUvcnI3f7ec

ramset

  • Hero Member
  • *****
  • Posts: 8073
Re: Water Level Indicator...For HHO project.
« Reply #8 on: December 30, 2013, 11:46:37 AM »
WOW
Very Nice application for this water level indicator ,and excellent idea to intigrate arduino.
 
@Tinsel
Your are truly a very nice man and I hope things go well for you in this coming year.
 
 
have a good and safe Holiday
 
Chet
 
 

mscoffman

  • Hero Member
  • *****
  • Posts: 1377
Re: Water Level Indicator...For HHO project.
« Reply #9 on: December 31, 2013, 06:08:21 PM »
 
Hi; I happened to notice the following youtube video while I was watching
yours that *might* be a better liquid level solution for certain applications.  ;)
The reason is that yours uses liquid conduction of the end-use fluid. This might
be bad because you get a very small amount of electrolysis on each sensor probe. (solvable
to some extent by using an AC sense signal)  This can contaminiate the fluid or etch
out the probes in the long run. The varible amount of conductivity of the electrolyte
in the fluid is another potential problem as is the capacitive noise signal environment
of the fluid and it's container.
 
The displayed non-contact method (if the cicuit works reliably?) would be better if your
application doesn't mind having the small amount fluid heating supplied by each sensor.
 
http://www.youtube.com/watch?v=WDu2XFp5Flo
 
:S:MarkSCoffman