Common ground between arduino and 12V circuit

I'm going to power an outside LED strip from a 12V battery that is switched on/off by an arduino or attiny13a using a BJT via an output pin turning on/off a p channel mosfet in high side config in the LED circuit. The arduino will be powered by a buck converter that is also connected to the battery.

What I'm not sure about is the requirement for a common ground between the 12V and 5V (or 3.3V) circuits. The ground for the LEDs will be to the battery while the ground for the arduino will be to the buck converter.

Would that arrangment work? Or does the ground from the 12V circuit need to be directly connected to the arduino ground pin (as well as the battery ground)? There is likely 500mA in the LED circuit though so it doesn't sound right sinking half an amp through the arduino ground pin? Or have I got it all wrong?!

I was thinking of powering the arduino via 3.3V lipo and solar panel so it would be a completely separate circuit. Would this make a considerable difference to how the common ground is used between the two circuits?

Advice greatly appreciated, thanks.

Apologies but I missed this article:

Common ground and why you need one

and it reminded me that current always returns to the source. So even if the 12V ground is connected to a ground pin on the arduino and the emitter of the BJT is also connected the to same ground pin, the current from the 12V circuit will flow back to the battery and not through the arduino, I think.

Where the negative of the LEDs is connected to the emitter of the BJT, that allows the current in the 12V circuit, which is diverted from the mosfet to ground via the BJT, to flow back to the battery and not the arduino. The current from the BJT emitter flows back to the arduino and not the battery.

You forgot the base resistor for the NPN transistor. It is mandatory or you will fry your Arduino. ... And resistors for the FET are needed also. ... And no short circuit between 12V and the Collector ... and polarity of your 12V ...

oops, I've updated the circuit.

The circuit seems rather elaborate to drive a LED. What role does the Arduino have ? Is it going to sense ambient light or something else which justifies its presence but is currently not shown ? The circuit as it appears could be simplified if the led were to be switched on the LOW side. This would require a logic level N channel mosfet.

Errata: The led is reversed. The Vertical base resistor should be moved between D8 and Ground.

I've updated the circuit with the PIR sensor, thanks for the errata. The circuits I've seen for this have the base resistor nearest the BJT.

The arduino or attiny13a will get the signal and "smooth it out" to keep the light on for 30s. I used this method as it seemed to be "standard" for two different voltage systems.

The two resistors, as they were originally placed, form a voltage divider. For a BJT transistor which is saturated at around 0.7 volts it would have to be a quite aggressive voltage divider to cause a problem. For mosfets which may require a considerably higher gate voltage to fully switch on then this detail becomes important.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.