May 20, 2024, 07:38:25 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


12VDC Solenoid

Started by davisgraveyard, June 21, 2007, 08:10:27 PM

Previous topic - Next topic

davisgraveyard

I am trying to drive a small 12VDC Solendoid with a Prop-1.   I connect wires to the V+ and the OUT0 of the Prop-1 to the Solenoid.  I wrote a quick test program

FOR i=1 to 10
HIGH 0
PAUSE 500
LOW 0
NEXT


Nothing happens?

I set the switch to 2 on the board  and the V+ LED is red.
I tested the solenoid by removing the wire from OUT0 to grnd and the solenoid fires just fine.  (doesn't matter which lead on the solenoid is wired...I tested it)

What am I doing wrong?




JonnyMac

There is no [real] delay between the LOW and HIGH statements while in the loop.  Add a delay after the LOW.  What is probably happening is that the solenoid is going on and staying on until the last cycle; you'll looking for cycling that the solenoid can't see because the time between LOW and HIGH in the loop is only about 200 microseconds.

Try this:

Main:
  FOR idx = 1 TO 10
    HIGH 0
    PAUSE 500
    LOW 0
    PAUSE 500
  NEXT
  END


You should be able to hear the plunger move with this.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

It helps if you put the ULN2003 in the right way.  I had it upsidedown.  Once I flipped it everything worked.  (checked your diagram on the I/O sticky post)

I also tuned the loop a bit.

FOR i=1 to 20
   HIGH 0
   PAUSE 100
   LOW 0
   PAUSE 100
NEXT

that gives me the rattle I wanted.   You can't go any faster or the solenoid just stays plunged.  You also have to have the 2nd pause after the LOW or like you said it won't release.

Thanks for the help...


JonnyMac

My pleasure.  It's funny, we consider the Prop-1 very slow but we're often connecting to devices that are glacier-like in speed -- solenoids are "slow" buy comparison because of the physical inertia of the plunger movement.  It's good to do bench tests when you're dealing with these kinds of devices as one type solenoid may be faster or slower than another.
Jon McPhalen
EFX-TEK Hollywood Office