solenoid + arduino

Greetings

I found this on how to control a solenoid with an arduino.

I have a 12V power supply for the valve (12V 2.5W) and another 5v for the arduino.

In the schematic i see the grounds are linked. My question is if I can do that, connect the gnd from both power supplies. I don't want to burn the arduino.

I searched around and that seems to be the "common" way of doing it, but if you know a better way, it would be appreciated.

Yes, in most cases you can do that.

in most cases you have to do that

Thank you gentlemen.

Now I can get started!

In the case of this transistor configuration (called the common-emitter circuit), the emitter is common to the input circuit and the output circuit. For NPN transistors this means the negative side of the circuit (here called 0V or ground). For the PNP equivalent circuit the common emitter would be at the most positive voltage.

Remember the word circuit means a circuit - the current has to flow round a path and come back again, so both the input and output sides of this circuit have (at least) two wires. If you only had one wire between the parts of the circuit then you have an antenna, not a circuit (!)

The Ground is the return path for the control signal from the arduino, If that helps your undertanding.

Doc

Thanks for your input.

I built it and it works like a charm.

Hey
Im am laking knowledge on this topic so dont shoot me if i say somethiong simple or stupid :slight_smile:
im trying to set up a circuit to control a simple pull solenoid. Just wondering how do i know what solenoid to order? if i get a 12v solenoid and 12v power supply will it simply work? or does the transistor have to be compatible current wise? also is it possible to control the solenoid from a 'on button' using arduino?
Thank you
steve