Go Down

Topic: PNP transistor forces arduino nano to reset.... (Read 1 time) previous topic - next topic

yiannis

Hi everyone!  I am trying to build a temperature controlled fun circuit. I am using Arduino nano, a DHT11 sensor, a 20x4 LCD to display data  and a 2N2222 transistor to control the fun. The problem is that the transistor seams to force the arduino to reset. The transistor is connected to the 9 pin of the arduino. Any ideas are welcome!
Thanks!

Grumpy_Mike

#1
Apr 13, 2016, 09:21 am Last Edit: Apr 13, 2016, 09:22 am by Grumpy_Mike
You need to post a schematic of how you have wired it up.

Note a 2N2222 is not a PNP transistor like you said in the title.

Edit-: when you say control the fun, do you mean control the fan?

yiannis


Ok, about the fun control, when the temperature is below 25 Celsius the fun is off, at 26 celsious the fun works at 20%, at 27 celsious at 40% ect. I was sure the transistor 2N2222  is PNP transitor…. What I can use instead?

TomGeorge

#3
Apr 13, 2016, 10:22 am Last Edit: Apr 13, 2016, 10:23 am by TomGeorge
Hi,
You can still use the 2N2222, just reconfigure how you use it.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Show us  what you have now and we can advise on what to change.
I think you mean fan when you say fun.
What size is it, how much current does it draw?

Hope to help ..   Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

yiannis

Hi,
You can still use the 2N2222, just reconfigure how you use it.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Show us  what you have now and we can advise on what to change.
I think you mean fan when you say fun.
What size is it, how much current does it draw?

Hope to help ..   Tom.... :)
;D  ;D  ;D Yes i mean fan when i say fun!!! I used the following schematic for the wiring

http://circuitdigest.com/fullimage?i=circuitdiagram_mic/Temperature-Controlled-Fan-.gif

Of course the wiring of the LCD in my case is different , but i used the schematic in order to wire the transistor. The fan is  5volt 40mmx40mm, but i don't know it's power consumption…

TomGeorge

#5
Apr 13, 2016, 11:11 am Last Edit: Apr 13, 2016, 11:12 am by TomGeorge Reason: Added image to post
Hi,
The transistor used in that circuit is a 2N2222 an NPN so it will work but for two things, the transistor emitter and fans power supply are not referenced to the arduino grn, and the base needs a resisitor.
I have added to the circuit to show you what is needed.


Make sure you have the 2N2222 connections correct.
4x AA cells would be enough for the fan supply, not the 9V battery.

Tom..... :)
Everything runs on smoke, let the smoke out, it stops running....

yiannis

Hi,
The transistor used in that circuit is a 2N2222 an NPN so it will work but for two things, the transistor emitter and fans power supply are not referenced to the arduino grn, and the base needs a resisitor.
I have added to the circuit to show you what is needed.


Make sure you have the 2N2222 connections correct.
4x AA cells would be enough for the fan supply, not the 9V battery.

Tom..... :)
Thank you Tom! Because the fan needs 5 volts supply I wired it to the 5v supply from the arduino, so the GND of the fan and the emitter of the transistor  are connected with the arduino GND. I will  definitely  add  a resistor to the transistor base as you recommended!

Whandall

Because the fan needs 5 volts supply I wired it to the 5v supply from the arduino,
Powering the fan from the Arduino will reset the Arduino, as you already noticed.
Better wire it to a power supply of 5V (which could drive the Arduino too).
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

Grumpy_Mike

One way of avoiding the need for a separate power supply for a motor is to add some decoupling to the power supply. The last circuit on this link might work for you.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Go Up