12V Power supply for fan is powering Nano

Hi there,

I am working on a small project where I run 3 fans via a 12V power supply and show some sensor data on a LCD / output warning sounds in some cases, like one of the fans RPM going below a certain threshold.

The Nano 33 BLE is connected to USB and also sends some data via the serial connection.

If I remove the 12V power while USB is still connected, the fans stop spinning and everything behaves as expected (errors because fan is not spinning anymore).

If I remove the USB while the 12V power supply is still connected, weird things happen. Sometimes the fan keeps spinning (but slower), sometimes the Nano and LCD backlight just flicker etc.

I don't understand why the 12V power circuit is powering the Nano at all, I thought the transistor (S8050) wouldn't allow for that.

I've attached my breadboard view.

I wanted to print a PCB as a next step, but I am afraid of damaging components when USB is not connected, but 12V is -- which will happen, e.g. if the connected PC is turned off.

I also read a bit about adding decoupling / bypass capacitors, but I guess I should wait for this until the main issue has been fixed.

Best

--

Suggestion: I guess adding a diode at the transistors base would help? Sadly the behavior is inconsistent and at the moment, the Nano doesnt turn on, just the fans, no matter if I add a diode or not. That being said, the fan should not turn on without the Nano controlling the transistor ... I am very confused :slight_smile:

Your solution: Common ground and why you need one - General Electronics - Arduino Forum

You also need two additional things (at a minimum):

  1. you need a 470 ohm resistor in series with the transistor base before you destroy the nano.
  2. you need to learn how to draw a proper schematic. Paper and pencil will suffice, a Fritzing is not a schematic and is not usable when you ask for help.
  1. learn to inline pictures:

WattsThat:
Your solution: Common ground and why you need one - General Electronics - Arduino Forum

You also need two additional things (at a minimum):

  1. you need a 470 ohm resistor in series with the transistor base before you destroy the nano.
  2. you need to learn how to draw a proper schematic. Paper and pencil will suffice, a Fritzing is not a schematic and is not usable when you ask for help.

But don't I have a common ground? The brown cable going from the GND Pin to the 12V DC and the black cable from the other GND Pin to the breadboard on the right. Are both Nano GND Pins separated?

I've tried connecting both grounds via a cable for the minus rails on the breadboards but that didn't change anything.

Here's the schematic I did before working on the PC, all grounds are "shared" like I thought they are on the breadboard view.

I'll install an resistor, does it have to be exactly 470? I have 330s, 220s and 100s, so would go for 330 or 430?

What is the yellow wire between Arduino D4 and J1 pin 3? I suspect it backpowers the Arduino.

Smajdalf:
What is the yellow wire between Arduino D4 and J1 pin 3? I suspect it backpowers the Arduino.

Yes, that was going to be my guess too. The OP may want to look at Dave Jones' Youtube video on this subject. Search for EEVblog #831.

Smajdalf:
What is the yellow wire between Arduino D4 and J1 pin 3? I suspect it backpowers the Arduino.

This is the RPM signal of the fan / a hall sensor. Disconnecting the cable doesn't help.

I've added the resistors to the transistor base (440 ohm), which means I am not getting the full 12V on the fan anymore.

Also, the fan starts spinning when I just connect the 12V DC (before, the Nano and LCD would flickert).
I don't understand how the fan can be spinning when there's not voltage to the base of the transistor?!

Are you sure there is no voltage on the transistor base? Double check if it is connected correctly, you may have emitter and collector swapped.

Smajdalf:
Are you sure there is no voltage on the transistor base? Double check if it is connected correctly, you may have emitter and collector swapped.

Emitter is going to GND of the 12V DC power supply.
Collector is going to the fans minus.
As it's shown on the schematic.

The transistor base has 0.7V when only the USB is connected. (PIN set to HIGH, 440 ohm resistor added)
When I connect the 12V DC the base receives 0.85V.
When only the 12V DC is connected, the base has 130 mV. I don't understand why.

Where does this current come from?!

Could the transistor, the diode or the fan be defective and the issue?

@ShermanP
I've watched EEVblog #831 and therefore tried disconnecting the LCD, which didn't change anything. :slight_smile:

If you placed the diode to prevent spikes from the motors, remove it and replace it with a 100nF ceramic capacitor or similar.

Okay ... I've replaced the transistor with two others, just to check if the are faulty (same model).

Results:

a) Having only the 12V DC attached doesn't do anything anymore. Using the old transistor, the fan is spinning.
b) With both 12V DC and USB attached, setting the transistor base high doesn't do anything as well -- I can't get the fan spinning anymore.
--> I need to remove the resistors or setting the base doesn't work. As I am on the nano with 3.3V instead of 5V, maybe the resistance is too high? I don't understand the need for the resistor anyway, that being said, obviously my transistor broke along the way ...

@Leroy2007: As far as I understood fans don't really need the diode anyway. Removing it didn't change anything about the issues so far -- would it be bad practice to leave it there, just in case? What's the benefit of the capacitor?