Having problems with Motor Fan and Relay

Hello there, I'm trying to make this project but I'm having a problem.

If I power the Arduino using the USB cable, the arduino resets everytime I pushdown the button and if I power using a 9V power source (through the power jack) the arduino stops responding (nothing happens if I pushdown the button) and keeps on overheating.

image

Relay: HRS1H-S-DC5V

I saw that I need to add a transistor and a diode like this:

But I don't know how.

Can someone please show me how the schematics should be with a transistor and a diode?

Thanks in advance.

That's one part.

The schematic is pretty clear. BTw, I'd use a mosfet instead of the 2n2222a and leave out the 1k resistor R1 (it doesn't hurt to keep it in there btw).

Both the transistor and the diode are NECESSARY.

The other part is that you'll need to attach a separate 5V power supply and NOT use the 9V input on the Arduino and then also power a relay coil from the Arduino's 5V.'

You might also need a new Arduino in case you blew this one.

Toss the relay and just drive the motor with a logic level MOSFET capable of the motor stall current. Still need the diode.

And, like @ koraks says, do not power a motor with the Uno 5V.
Use an external motor power supply capable of supplying the motor stall current.

There's a lesson there!

Do not attempt to use the "barrel jack" or "Vin" for any serious project. :roll_eyes:

Rather than argue the point or why, just don't! :grin:

Thank you all for answering,

Good to know that is not recommended to use the power jack, I only knew that for the Vin pin.

I tried to follow the schematics from others and came up with this (but I don't know if I did it right)

Am I doing it right?

Diode: 1N4007
Transistor: BJT 2N2222 NPN
Relay: HRS1H-S-DC5V

EDIT: Now the led is connected properly.

Never power a high current load from your Arduino.

Never connect an inductive load to the 5v pin on the Arduino.

Use external power sources for such things.

Your motor requires kickback suppression just like a relay does.

Many here highly recommend switches be connected between the Arduino input pin and GND.
+5V——[50k internal pullup]——Input Pin——[Switch]——GND
Hence, look for a LOW on the pin for a switch closure.

Your LED appears not to be properly connected.


You can use the Vin pin to power your Arduino but you must be aware of the consequences of doing so.

Even if I use a diode and a transistor like the schematics it's still not recommended?

The kickback suppresision for the motor would be like this one?

EDIT: Now the led is connected properly.

Note the 2N2222 must be able to handle the motor current or else it will get hot and might be damaged.


A logic level MOSFET is a modern alternative to BJTs.

The transistor (BJT or MOSFET) must be able to handle the motor stall current. Stall current is drawn, briefly, every time that the motor starts.
Choose the transistor based on the stall current of the motor. The stall current can be several times the running current. The stall current should be listed in the motor data sheet. If not, the stall current can be estimated. To estimate the stall current, measure the motor winding resistance. Take several measurements rotating the motor a bit between readings. Use the lowest reading in the calculation. The estimated stall current is the motor supply voltage divided by the measured resistance.

Yes

If you measure the resistance of your motor you can calculate this current.

Example: let’s say the motor resistance is 12Ω and the motor power supply is 12v.

Your maximum current will be 12V ÷ 12Ω = 1A

If the BJT base current is 20 ma and the 2N2222 gain is 100 then in the simplest situation you can have 20 * 100 = 2A; our 1 amp is less than the 2 amp calculation.

Note: in cases like this we want the transistor to operated in saturation.

However, there is a maximum current that the BJT can safely operate at.
With our 2N2222 this is < 800mA (we must design for less than this).

So the 2N2222 will go up in smoke ? :anguished:

Well not necessarily.

When the transistor first turns ON the motor starts to move.

As the motor moves faster and faster, the current it draws can significantly reduce, perhaps down to 300mA or less; well with the operating parameters of the 2N2222.

Also, when the transistor first turns on, there will be NO current flow as the motor is an inductor.

As time goes by the motor current will increase from zero to a maximum level, it then reduces to a minimum running level.

During this power up interval, the transistor can enter a linear area where there can be significant voltage dropped across the collector to emitter of the transistor . This results in power loss and the transistor can get hot/be damaged.

The 2N2222 has a maximum power it can dissipate, < 0.5 watts with infinite heat-sinking, we must design our circuit to keep below this value.

With all this being said the OP should not be scared off experimenting, they should note there are limitations to what components can operate at.

The OP should be aware the transistor can get hot, many touch the case to see if it is hot but be careful :grimacing:



If the OP intends to proceed with this as a hobby, a DMM is a tool they should invest in.

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