Yet another solenoid question
Acidshock
Posts: 7
Hi guys, got myself into a dilemma. I got an electronic valve that is powered by a solenoid(9-24VDC). I am using it to create a somewhat realistic water flow in my aquarium to simulate ocean waves. Well anyways I made myself a circuit using a 555 Timer and it worked well but of course its steady and never waivers;not very realistic.
·So I have gone to work on my Basic stamp, the one from the "What is a microcontroller?" book and have managed to make a program that randomizes things up a bit by adding or subtracting a few seconds from a few random waves and then figures in high tide, low tide, etc.·
·I have ran into a problem. I am able to supply enough voltage from Vin, and Vss however once I move to a pin so that I can control it, I am unable to power the solenoid. I am pretty sure its cause of the internal 220 Ohm resistors. So my next though was to use a simple relay and just use a separate power source for the solenoid, the only problem is that the relay I have appears to not receive enough power to switch it either(tested using another power source). So pretty much I am stumped here, I would prefer working with what I have considering that everytime I goto radioshack I end up buying a ton components out of impulse :P Anyone have any ideas?
I was thinking of maybe using a 555 Timer and an external power source and control it with the stamp however I havent quite figured out how to do that yet. I managed to get the 555 Timer working by itself but was unable to repeat the process on the stamp.
Items I have for sure:
Good range of capacitors, 104nF to 3300uF
REsistors 1 Ohm to 1 MOhm
Ton of NPN and PNP Transistors
Bunch of POTs
2 555 Timers
1 556
Everything that came with the "What is a microcontroller" kit
Again, if anyone has any suggestions it would be appreciated. Also any diagrams or examples would be appreciated as well.
·So I have gone to work on my Basic stamp, the one from the "What is a microcontroller?" book and have managed to make a program that randomizes things up a bit by adding or subtracting a few seconds from a few random waves and then figures in high tide, low tide, etc.·
·I have ran into a problem. I am able to supply enough voltage from Vin, and Vss however once I move to a pin so that I can control it, I am unable to power the solenoid. I am pretty sure its cause of the internal 220 Ohm resistors. So my next though was to use a simple relay and just use a separate power source for the solenoid, the only problem is that the relay I have appears to not receive enough power to switch it either(tested using another power source). So pretty much I am stumped here, I would prefer working with what I have considering that everytime I goto radioshack I end up buying a ton components out of impulse :P Anyone have any ideas?
I was thinking of maybe using a 555 Timer and an external power source and control it with the stamp however I havent quite figured out how to do that yet. I managed to get the 555 Timer working by itself but was unable to repeat the process on the stamp.
Items I have for sure:
Good range of capacitors, 104nF to 3300uF
REsistors 1 Ohm to 1 MOhm
Ton of NPN and PNP Transistors
Bunch of POTs
2 555 Timers
1 556
Everything that came with the "What is a microcontroller" kit
Again, if anyone has any suggestions it would be appreciated. Also any diagrams or examples would be appreciated as well.
Comments
I'll probably be shot at sunrise by the electrical engineering pursits who might be lurking, for the folowing suggestion, but here goes. I'd find the lousiest, leakiest, poorest tolerance capacitor I could find, and stick that in your 555 circuit. If possible, I'd mount the capacitor as close as I safely could to heat of the aquariaum heater as well. Do the same thing with the external resistor. I can all but GUARANTEE you'll get lots of random timing
My Grandfather used to remark about suggestions like this, that it was "featuring a fault"! Normally what I've suggested is the LAST thing you want to do with the external components of a 555. BTW, don't use the CMOS version of the 555, if you can avoid it. They tend to be more accurate
Regards,
Bruce Bates
Are you powering the solenoid from a Stamp pin? If so STOP. You can easily damage the pin that way. Use a transistor to power either the solenoid or the relay. Also, do you have back EMF diodes installed? These are important too. Then I would make a psuedo random program using just the Stamp, no 555. The fish won't know if it is *really* random or not ;-0
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
any plans to fix it anytime soon?· because i pretty much have to go elsewhere unless someone re-asks what im looking for every so often.....
Click "repeat the search with the omitted results included", 3rd link (there maybe other applicable links).
The fact that search.parallax.com is a functional search engine should be in a sticky post and not buried in the support forum, or better yet, provide a link in the page for the search dialog explaining it is a more reliable method of searching the forums.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 12/12/2005 8:59:54 PM GMT
cmoher3@hotmail.com
The hFE (gain)·of those little switching transistors isn't all that high (and varies a LOT depending on where you get them and how much you spend - the ones at Radio Shack can be all over the board!)
The problem here is that if you use the transistor directly (e.g. without a relay) you may not fully saturate the junction.· In that case the transistor can be required to dissipate pretty significant amounts of power and it may smoke on you.
The iC (collector current limit) on those is typically around 600ma, which may look ok on its face (that's ~7 watts) BUT you have to check the dissipation as well if the junction is not fully saturated.· When I've run the computations for typical switching applications like this with solenoids I usually find that the hFE is not hign enough for me to be happy with the safety factor.· (I've burned one by not doing the calculations to see if the hFE was in the "safe" range before - it wasn't, and it smoked.· The good news is that 2n2222s are dirt cheap [noparse]:)[/noparse] )
If you can afford the voltage drop (~1.5V .vs. 0.7v for a single transistor) I'd probably use a power Darlington in that application - that will also keep the current draw down to almost nothing off the BS output pin as well by choosing a much larger series resistance for the output.· It would also permit (assuming dissipation limits and such are ok) driving the solenoid directly without having to run a relay in between.
Another possibility·is the L293; that's a quad-channel IC high-current driver (600ma per channel with supply voltage allowed up to 36v.)· Its original application is driving things like stepper motors but it works pretty well for this sort of application·provided you're within·its current limits.· They're pretty cost-competitive with a power darlington (Digikey wants $2.75 each for 'em) and you get four outputs instead of one.· In theory you could parallel outputs for more current capacity so long as you remain within the device's total dissipation limits.
In any case you need a snubber (back-biased diode) across the coil or you'll destroy the·driver when it turns off due to back-EMF from the relay or solenoid, as was noted in the posted schematic.
·· You are correct!· See the following link...
http://forums.parallax.com/showthread.php?p=562370
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10