Shop OBEX P1 Docs P2 Docs Learn Events
Using the propeller to trigger 24v solenoids — Parallax Forums

Using the propeller to trigger 24v solenoids

DarcyDarcy Posts: 31
edited 2011-08-02 21:04 in Propeller 1
I am experimenting to see if I can use the propeller to write a simple program that would control up to 7 or so of these pneumatic solenoid valves http://www.mfdpneumatics.com/store/products/detail.php?id=61. My main issue is that the solenoid requires 24v dc to work...(actual range is 21.6v - 26.4v). What could I do to step up the voltage from the output signal from the propeller so that it is powerful enough to trigger the 24vdc valve? Any resources that you would know of for me to research would really help me out.
thanks,
Darcy
«13

Comments

  • jeff-ojeff-o Posts: 181
    edited 2011-07-05 09:57
    The best way would be to use a separate 24V power supply for the solenoids. Each solenoid would be switched on and off by a suitably sized MOSFET. You can get logic-level MOSFETS, which can be controlled directly by the propeller output pins, that switch 60V at 10amps. Should be good enough, eh?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2011-07-05 10:02
    Darcy,

    Welcome to the forums!

    You could also use various relays or even latching relays if you want to assure that the solenoid stays open or closed if the power to the Propeller is interrupted.
  • edited 2011-07-05 10:12
    Propeller ports can only output 3.3 volts at a few tens of milliamps (see data sheet). You will need a separate power supply and some 'electronic switches' to control the solenoid. There will be a few other point to consider but you should get it going without too much pain!

    For starters can anyone suggest a device/circuit for an 'electronic switch' that can be used for controling this kind of load from a Propeller port?
  • DarcyDarcy Posts: 31
    edited 2011-07-05 10:21
    Thanks for your input, I have some 24v relays that could be used, and a 24v power supply available too... I just need to figure out how it would all be wired together....
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2011-07-05 10:52
    Your relays need to be able to handle 24v on the output contacts but can be driven by less voltage across the coils. You will still need to have transistors or someting like a ULN2803A IC between the Propller and the relays http://www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/211/Default.aspx?txtSearch=ULN2803A+

    This thread may be helpful http://forums.parallax.com/showthread.php?129898-Controlling-Relay&highlight=relay
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-05 11:03
    Nuts and Volts Column #6 (look here) discusses how to control motors, relays, and other relatively high-power devices from a Stamp I/O pin. The same technique can be used with Propeller I/O pins. You just have to use a lower base resistor value to get the same current, typically 150 or 180 Ohms rather than the 330 to 470 Ohms that you'd use with a Stamp.
  • Jack BuffingtonJack Buffington Posts: 115
    edited 2011-07-05 12:46
    I have a garden controller that I am driving eight zones of solenoid valves. It is currently being run with a PIC but I'll bring it over to a propeller when I (someday) have time to do it the way that I really intended with a graphical menu system, temperature and humidity sensors, charts of what happened for the past few days... Anyway, if you are asking a question like this then you may not be aware of precautions when driving solenoids or other big coils. Make sure that the mosfet or transistor that you use has a fast diode (eg: schottky) in parallel with it so that the inductive kick when you turn off the solenoid doesn't kill your mosfet or transistor. Some mosfets have them built in so that you don't need an external one.
  • idbruceidbruce Posts: 6,197
    edited 2011-07-05 21:12
    Darcy

    As someone previously mentioned, use a seperate 24 volt power supply. I had the same situation, but my coils were 12 volts. I used 4N25 optoisolators to trigger TIP120 transistors to trigger the solenoids, and it worked great for me, plus it eliminates any chance of EMF reaching the Propeller. If I find time, I will provide a schematic.

    Here is a link to a nice 24VDC power supply:
    http://www.powerstream.com/ac-2420.htm

    Bruce

    EDIT: After reviewing your post, I see you already have the power supply. Personally I would skip the relays and go 4N25 / TIP120
  • bomberbomber Posts: 297
    edited 2011-07-06 13:23
    You might want to use two L293Ds with heat sinks and reverse protection diodes.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-07-06 14:50
    A couple years ago, Phil Pilgrim turned me on to the IRF3708 mosfet for use with the Propeller, and I've never looked back. Check out this link for his diagram, except use 24 volts instead of 15. The resistors coming off the Propeller pin are for limiting current and for "bleeding" voltage off the line so the response remains fast. I usually use about a 10K resistor for the vertical one and maybe 1K for the horizontal:

    http://forums.parallax.com/showthread.php?116423-A-really-great-Mosfet-to-use-with-the-Propeller...-especially-when-it-s-grounde&p=845205&viewfull=1#post845205

    If you're running solenoids, you'll probably need some flyback diodes, too.
  • kwinnkwinn Posts: 8,697
    edited 2011-07-06 20:25
    Those are small low current solenoids that draw barely over 100mA current. Just the sort of application the ULN2803 was designed for. It has 8 drivers and the protection diodes in 1 chip. No additional parts required.
  • idbruceidbruce Posts: 6,197
    edited 2011-07-06 22:30
    Those are small low current solenoids that draw barely over 100mA current. Just the sort of application the ULN2803 was designed for. It has 8 drivers and the protection diodes in 1 chip. No additional parts required.

    That actually sounds like a nice solution.
  • AleAle Posts: 2,363
    edited 2011-07-07 00:22
    I also support the optocoupler idea. A shorted MOSFET (resulting from overheating) can put your drain voltage into the gate.
  • DarcyDarcy Posts: 31
    edited 2011-07-07 08:34
    the ULN2803 sounds like a nice solution. We have an electronics shop in town that carries them, i'll pick some up tonight and try them out. Now I need to figure out what the schematic would look like for wiring this all up.

    Do you know what the minimum voltage the relay requires in order for the switch to be activated? this is the relay I have available..

    http://www.automationdirect.com/adc/Shopping/Catalog/Relays_-z-_Timers/Relay_Sockets_-a-_Accessories/RB105-DE

    Note: eventually my goal is to have about 8 of these solenoid valves running at the same time...for now i'm just starting out with one.

    All of your suggestions have really been extremely helpful, thank you so much!
  • idbruceidbruce Posts: 6,197
    edited 2011-07-07 08:37
    Darcy

    You won't need relays if you use the ULN2803, but of course that would all depend on the current requirements of the coils for your solenoids.

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2011-07-07 08:43
    Darcy

    The ULN2803 can control up to 8 solenoids, providing the amperage rating for the coils is not above 500ma, but just in case it is, the darlingtons can be paralled for a higher current rating.

    Bruce
  • DarcyDarcy Posts: 31
    edited 2011-07-07 09:09
    I thought that the relays helped to regulate the stability of the circuit, based on what Ron Czapala said:

    "You could also use various relays or even latching relays if you want to assure that the solenoid stays open or closed if the power to the Propeller is interrupted."

    If a relay isn't necesarry, that might be good for cutting down cost for building the circuit, I couldn't find the amperage rating for the coils from their website, but it did say that the power consumption was 24V DC: 2.5 W

    I could run them in parallel if needed, I just need to find out whether or not that would be necessary...I found a simple board layout for testing out circuits with the ULN2803 http://computerchristmas.com/christmas/link-how_to/HowToId-17/Control_using_a_ULN2803A
  • idbruceidbruce Posts: 6,197
    edited 2011-07-07 09:58
    Darcy

    You have to ask yourself, is it really necessary for these solenoids to be open or closed if I lose power to the Propeller?

    I guess it would all depend on the circumstances.

    However, if it does not matter one way or the other, then you should be fine wiring the solenoids straight to the ULN2803.

    2.5 watts / 24 volts = .104 amps, which is well within range of the ULN2803, so you could run 8 solenoids off of one ULN2803.

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2011-07-07 10:34
    Darcy

    It has been a while since I messed with one of these chips, but I am 99% certain that this is the hookup. Someone please correct me if I am wrong.

    Bruce

    EDIT: You could also cut down on the number of I/O pins by incorporating a 74hc595 into your design
    473 x 322 - 36K
  • kwinnkwinn Posts: 8,697
    edited 2011-07-07 17:56
    Darcy, the connection diagram idbruce posted is correct, and he has a good point about not needing the relays. The relay coil draws almost the same current as the solenoid so they are really redundant. If you google "ULN2803" you can find and download the data sheet and several circuit ideas. As for using latching relays (the ones you spec are not), I don't really see any point in doing so since the solenoids will close any way once the power goes off.

    Simply connect one side of the solenoid to one of the pins from 11 to 18, the other side to +24V, and the control signal to the appropriate I/O pin.
  • idbruceidbruce Posts: 6,197
    edited 2011-07-08 19:23
  • DarcyDarcy Posts: 31
    edited 2011-07-08 20:32
    I wired up the uln2803 as stated, but there is no signal coming out of the the output pins 10-16 when the propeller is hooked up to the corresponding side. The 24vdc neg is hooked up to pin 8 and the pos is hooked up to pin 9. Is the signal coming from the prop strong enough to trigger the 24vdc output on the uln2803? The relay and powersupply have been tested.5916971379
  • idbruceidbruce Posts: 6,197
    edited 2011-07-08 20:39
    Darcy

    What you describe is nowhere near what the diagram depicts. You better look at the diagram again.

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2011-07-08 20:42
    On a ULN2803, the output pins are 11-18, 24V Pos goes to pin 10, 24V Neg goes to pin 9
  • DarcyDarcy Posts: 31
    edited 2011-07-08 21:39
    Sorry, i was describing a 16 pin ic, when i should have been describing an 18 pin ic.
    The led on the relay blinks for just a moment half lit, the code is
    !outa[26]
    waitcnt(clkfreq*2+ cnt)

    Ive checked everything with a multimeter, do i need to boost the signal going to the uln2803? I dont think my photo uploaded properly, ill have to try uploading again.
  • kwinnkwinn Posts: 8,697
    edited 2011-07-08 22:59
    Try this and see what happens.

    Connect the 3.3V ground and -24V to pin 9
    Connect the +24V to pin 10
    Connect one side of the relay/solenoid coil to pin 18
    Connect the other side of the relay/solenoid coil to +24V
    Connect a jumper wire to +3.3V.
    Touching the other end of the wire to pin 1 should activate the relay/solenoid.

    You can repeat this for the next driver by moving the coil connection on pin 18 to pin 17 and touching the jumper wire to pin 2.
  • DarcyDarcy Posts: 31
    edited 2011-07-09 10:41
    Nada, solenoid does not light up. It will when i connect it directly to the 24v power supply. Im using the uln2803a, the a shouldnt make it a different chip...
    There is no voltage coming out of the uln... I tested 2 of them, the specs for my power supply are: 24v dc 3.75a, it is the psm24-090s http://www.automationdirect.com/static/specs/rhinopsm.pdf

    Heres a link to my photo since it didnt upload it properly before...
    http://www.flickr.com/photos/23703895@N06/5916971379
    5916971379
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-07-09 10:45
    There is no voltage coming out of the uln

    That's correct; the ULN2x03a is an open-collector output -- it provides ground (when on) or an open circuit.

    Connect your solenoid between your positive side of the supply and the ULN output pin. Make sure that the ground pin on the ULN (pin 9) is connected to the supply ground. On the Propeller side you need to have the Propeller ground connected to your solenoid/ULN ground. Also, connect pin 10 of the ULN to the positive side of your solenoid supply to enable the internal snubber diodes.

    I've used the ULN2x03a with the Propeller on several projects; it's quite easy when the connections are correct.
    476 x 414 - 36K
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2011-07-09 10:53
    Here is a schematic I use with this IC

    ULN2803A.jpg
    613 x 507 - 39K
  • idbruceidbruce Posts: 6,197
    edited 2011-07-09 11:12
    Darcy

    From the photo it appears that you also need VSS from the Propeller to go to pin 9 on the ULN2803.

    Bruce
Sign In or Register to comment.