using basic stamp 2 to turn on a solenoid
Hi,
Im having a little trouble trying to program a bs2 to do what i need it to do.
heres what I'm doing,
I have a water tank that needs filled when it hits a certain low level, once the water passes the low level line it will have a transistor show a low on the input. then I need the solenoid to turn on and stay on until it hits the high level line about 12 inches above the low level line. the problem I am having is when the water goes below the low level the solenoid turns on but as soon as the water is high enough to hit the low level the solenoid shuts off and the tank never fully fills. How to I keep the input of the low level high until both low level and high level sensor see a high causing solenoid to shut off until water line goes below low level again.
Water Tank
[ ]
[ ]
high level
[ ]
[ ]
low level
[ ]
[ ]
Im having a little trouble trying to program a bs2 to do what i need it to do.
heres what I'm doing,
I have a water tank that needs filled when it hits a certain low level, once the water passes the low level line it will have a transistor show a low on the input. then I need the solenoid to turn on and stay on until it hits the high level line about 12 inches above the low level line. the problem I am having is when the water goes below the low level the solenoid turns on but as soon as the water is high enough to hit the low level the solenoid shuts off and the tank never fully fills. How to I keep the input of the low level high until both low level and high level sensor see a high causing solenoid to shut off until water line goes below low level again.
Water Tank
[ ]
[ ]
high level
[ ]
[ ]
low level
[ ]
[ ]
Comments
I had a similar problem earlier in the year with a tank on the hill at my friends farm. I used a 4093 Schmitt trigger NAND gate. I even made a prototype with a large plastic glass and a two quart bottle of water. According to Forrest M. Mims you can make a set and reset circuit with two gates from this four gate IC. Since the bottom gate will change before the top gate an addition of a NOT gate at the top sensor will work well for us. You can make one with a shorted signal to both inputs on the NAND gate from the top sensor. (Remember it has four) I used a 4093 for two reasons, with a Schmitt trigger it is a little more stable and since I had several in my junk box it was close. Since you have a low input I would put a pullup resistor (around 10k or so) to the inputs. I have included a Truth Table so you can see what is happening. I am just lighting a led but you could also apply this to your BS2 to do amazing things or run it through a transistor and control a relay. (Which is what I did) If you need a positive input from the source just remember Q and NOTQ, put your output at the top, not the bottom and change your pullup to pulldowns. By the way, the IC costs less than a dollar. Save your BS2 for complicated things.