Shop OBEX P1 Docs P2 Docs Learn Events
Driving a solenoid — Parallax Forums

Driving a solenoid

TorquewrenchTorquewrench Posts: 28
edited 2005-08-14 14:53 in Robotics
Hi,

I have a question about driving a solenoid driven penumatic valve, similar to post http://forums.parallax.com/forums/default.aspx?f=10&m=83941&g=83951#m83951.

The solenoid valve is nominally 5V, 2W, and there are no built in diodes, just a coil.

I'm using a BS2SX with an IRF7488 MOSFET. The ultimate power source is a 9V battery, but I started off driving the BS2SX from the INEX-1000 5V source, and the 9V was only connected to the MOSFET. With this setup everything worked correctly.

Since I plan to power everything from the 9V I next powered the BS2SX using the Vin pin from the 9V battery. When I did this the solenoid cycles independently at an irregular interval. I figure something inductive might be going on, but I don't what's really cahnged between the two situations.

What do I need to do so I can drive the whole circuit off of the 9V battery?

Thanks,

Phil

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-08-12 23:32
    Are you able to check to see·if the BS2sx is resetting?· I recommend using separate power supplies in this type of circuit.· I also want to mention that it is a good idea to use some sort of protection in parallel with the coil, such as a flyback diode.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • TorquewrenchTorquewrench Posts: 28
    edited 2005-08-13 00:05
    How could I check if the BS2SX is resetting?

    I don't have a diode but I will get one tomorrow and give it a try. The application is an electronically controlled paintball gun, so the 9V will be the only power source I can accomodate. I tried using a 7805 voltage regulator for the BS2SX and the result was the same bad behavior from the solenoid. Would a different or better voltage regulator make a difference?

    Why does separate power supplies solve the problem?

    Thanks,

    Phil
  • dandreaedandreae Posts: 1,375
    edited 2005-08-13 00:10
    Your solenoid will draw way to much power and the BS2sx draws 50ma on the run.· The 9v battery is not adequate to drive this project solo.· You can check to see if your BS2sx is resetting by adding a DEBUG command at the top your code and monitor it on the PC screen.· It is usually not a good practice to use the same power supply when using solenoids and the BASIC stamps.· Here is a link listed below·that has a PDF file that will help you with this project "Nuts & Volts" Vol. 6.



    http://www.parallax.com/detail.asp?product_id=500-00005



    Dave


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com



    Post Edited (Dave Andreae (Parallax)) : 8/13/2005 3:07:53 AM GMT
  • TorquewrenchTorquewrench Posts: 28
    edited 2005-08-13 13:16
    The solenoid only has to stay open for 50ms, if that makes·a difference. I have a board·that I purchased that uses a Microchip 16F872 for a controller and·an Infineon BSP78 that was designed to run solenoids of this type successfully, and works with this one. The problem with the purchased board is that it is too big and I'd like to solve the problem myself. If the schematic of the commercial board would help I could send it along via email or PM.

    Is there a way to ensure the BS2SX always gets it 50ma and doesn't reset, even if the solenoid draws its 2W (220 mA at 9V), some sort of diode or voltage regulator? Would going to a BS1 help, that is also an option for me.

    Thanks,

    Phil
  • dandreaedandreae Posts: 1,375
    edited 2005-08-13 14:14
    I would definitely go with the BS1 for this project, the BS1 only uses 1mA on the run.· I don't you have room for 4AA batteries?· They make battery holders in different shapes and that might work for you?

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • TorquewrenchTorquewrench Posts: 28
    edited 2005-08-13 23:25
    Placing a diode across the solenoid valve coil did the trick, it now operates reliably. I am going to try using the 7805 regulator with capacitors on the in and out to give the stamp even cleaner power. Any other advice would be appreciated, and thank you for your help.

    Could you recommend any freeware to do schematics to make communications like these clearer?

    Thanks,

    Phil
  • dandreaedandreae Posts: 1,375
    edited 2005-08-14 00:26
    Torquewrench said...

    Could you recommend any freeware to do schematics to make communications like these clearer?

    Thanks,

    Phil
    I would make a separate post in the "Sandbox" and ask this question.· I'm sure someone an answer to this question.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • TorquewrenchTorquewrench Posts: 28
    edited 2005-08-14 13:10
    I picked up ExpressPCB as recommended by your folks on several other folks. I've attached my now working schematic. Thanks for your help. Any further comments or advice on the schematic are much appreciated.

    - Phil
    2040 x 1540 - 153K
  • dandreaedandreae Posts: 1,375
    edited 2005-08-14 14:53
    I have come across quite a few people using paint ball guns and the BASIC Stamps.· Is it possible for you to post a schematic, pictures, and your code in our "Projects" forum?

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
Sign In or Register to comment.