Shop OBEX P1 Docs P2 Docs Learn Events
Propeller + solenoid — Parallax Forums

Propeller + solenoid

acantostegaacantostega Posts: 105
edited 2006-09-18 21:26 in Propeller 1
Hi, I have to interface three small solenoids (about 2cm*2cm, or about 3/4'' square) to the Propeller. I've verified they can be triggered with as little as 3V. I'm used to doing this stuff for 5V mcu's, but I'm not sure hotw to proceed here. I tried with a PNP (2n2907A) with no sucess, with ~5V (unregulated) on the emitter the Propeller on the base and the solenoid between the collector and ground. It didn't work, presumably because the 3.3 aren't high enough. So I'm thinking of pullupus and something like that. Before doing some potentlially dangerous experimenting, does anyone have any advice on how to connect these? Thanks in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-18 05:01
    An NPN transistor would be better. Connect the emitter to ground, the base through a 330 ohm resistor to a Propeller pin, the collector to the solenoid and the other end of the solenoid to about 5V. When the Propeller pin is set to input mode (default) or output low, no current flows into the base. When the Propeller pin is set to output high, about 10ma flows into the base of the transistor and the transistor saturates. The gain of the transistor (hFE) determines how much current it will conduct. Most switching transistors have a gain from 30 to 100 and you should have no problem switching 300-800ma. Don't forget the protective diode across the solenoid.
  • acantostegaacantostega Posts: 105
    edited 2006-09-18 18:38
    Great! It worked. The only problem is that apparently the solenoid sucked in too much power and kept making the Propeller reset ... So I powered the solenoid off a couple of AAs with common ground to the Propeller and then I had no problems.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-18 18:53
    That's a common problem whenever you're trying to power a processor or any logic circuitry from the same supply as some kind of inductive or capacitive load like a solenoid or motor. You can often power the motor off the unregulated supply while the processor runs off a regulator tied to the unregulated supply. Sometimes you need to add capacitance across both the input and output of the regulator to smooth out the transients.
  • acantostegaacantostega Posts: 105
    edited 2006-09-18 21:26
    Yeah, I'll try that. Thanks.
Sign In or Register to comment.