Shop OBEX P1 Docs P2 Docs Learn Events
using basic stamp 2 to turn on a solenoid — Parallax Forums

using basic stamp 2 to turn on a solenoid

aaz707aaz707 Posts: 8
edited 2013-09-04 23:52 in BASIC Stamp
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
[ ]
[ ]

Comments

  • Hal AlbachHal Albach Posts: 747
    edited 2013-09-03 18:51
    Once the solenoid has been turned on the Stamp should only be looking at the high sensor, and conversely, when the solenoid is off the stamp should only be looking at the low sensor.
  • IroneIrone Posts: 116
    edited 2013-09-04 19:27
    Hello,
    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.
    453 x 217 - 12K
    436 x 204 - 13K
    430 x 186 - 12K
    425 x 179 - 12K
    500 x 276 - 33K
  • IroneIrone Posts: 116
    edited 2013-09-04 23:52
    An explanation of the above thread. A red circle is a low and a green circle is a high. Most of my endeavers a red means high and a green means low. This may be English. (take no offense - God save the Queen) They make you drive on the opposite side of the road. I have driven over there and all you have to remember is that the driver has to be closest to the middle of the road, Just like backing up a boat you have to put your hand at the bottom of the wheel and move it towards where you want the boat to go. I am used to logisim but for some strange reason it works no more.Free stuff, they giveth and then they taketh away,
Sign In or Register to comment.