1
\$\begingroup\$

bit of an amateur looking for some advice. I looked at the other question concerning my problem but i didn't find what i was looking for.

I need to switch ON and OFF a solenoid valve using my RPI. I found quite a lot of design.

But i can't decide on using a transistor like this design :

solenoid valve using transistor

or using a relay :

solenoid valve using relay

Can you tell me if the design are correct and what's the advantage/default of each one ?

Thanks.

PS : i will use this valve

\$\endgroup\$

migrated from raspberrypi.stackexchange.com Feb 17 '15 at 10:24

This question came from our site for users and developers of hardware and software for Raspberry Pi.

3
\$\begingroup\$

Both designs will work and its downto what current the TRANSISTOR will see and what supplies are being used.

enter image description here

In this topology the main BJT will sink 3Amps and thus the source to the BASE will need to be capable of driving TBD mA into it to ensure conduction. The Transistor will dissipate more power

enter image description here

In this topology the current the BJT has to sink is considerably less and it is purely the energising current of the relay. However, you need to source a relay.

The 1st is advantageous from a partcount but the 2nd is advantageous from a power dissipation in the BJT and thus current sourcing capability from the GPIO pin.

An improvement could be to use a FET instead of a BJT as the gate drive requirements would be less.

ASIDE:

There is a 3rd option and that is using the 1st topology, with a FET but PWM the FET. Solenoids have two current requirements

  • Pull-in
  • Hold

Pull-in is ALWAYS higher than hold as it has to produce enough magnetic force to close the airgap and move the plunger. Hold is lower as you need less amp-turns to produce the same MMF with a vastly smaller airgap. Thus you can have higher duty for PWM (ie higher current) and lower duty for hold (ie lower current == lower losses)

HOWEVER, this is dependent on alot more infomation about the solenoid: change in inductance, current change.

\$\endgroup\$
  • \$\begingroup\$ It is also possible to cascade transistors to increase the gain (less current sourced from the RPI) and split the thermal load. Relays are only nice when isolation and both current directions are required, but even this can be replaced by an optoisolator and transistors or a triac (that's what solid state relays are). \$\endgroup\$ – Mister Mystère Feb 17 '15 at 13:07
  • \$\begingroup\$ yup. I have added in a comment about supplies because if they are on split supplies then a relay is almost implied. \$\endgroup\$ – JonRB Feb 17 '15 at 13:16
  • \$\begingroup\$ thanks for the complete answer . I think i'll pick the 2nd solution. I i use this relay :amazon.com/2pcs-Power-Relay-SRD-12VDC-SL-C-Type/dp/B00MPEUPUE Ic = (5V-0.2V)/~100Ω = 48mA . For 2N2222, Hfe min = 30 I think so Ic / Hfe so : 48mA / 30 = 1,6 mA 5mA will be enough for the 2N2222. Rbase = (3.3V - 0.75V)/5mA = 510Ω. Are my calculs correct ? \$\endgroup\$ – Logan Bauduin Feb 17 '15 at 13:29
0
\$\begingroup\$

Omitting the relay is likely to be a cheaper solution. To choose an appropriate transistor requires some details about the solenoid in the valve. What current does it draw at steady state and the peak switching current at startup?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.