Hi guys,
After a month study, I'm confide with my coding now. However, there is one problem destroyed all my confidence.
I had a 12v DC fan controlled by arduino nano via bluetooth. I use it to blow air into my grill. I tried to add a relay, so I can add some high voltage device (110V) by just touch my phone and enjoy my football game in the sofa. The fan works perfect before I add relay on it, but when I connect the arduino with the relay. It self reset the arduino everytime when it turn the relay on. It also burned one arduino board.
Please help this poor circuits noob.
You are probably a victim of inductance. A relay contains a coil, and a coil, when the power is removed, creates a voltage spike which is going to feedback into your power supply, and maybe wreck other chips. To avoid this, you wire a diode across the relay coil, with the band pointing to the high side. When the voltage spike occurs, the diode effectively short circuits it.
jrdoner:
You are probably a victim of inductance. A relay contains a coil, and a coil, when the power is removed, creates a voltage spike which is going to feedback into your power supply, and maybe wreck other chips. To avoid this, you wire a diode across the relay coil, with the band pointing to the high side. When the voltage spike occurs, the diode effectively short circuits it.
Thank you for your reply.
So, by my understanding, I need a diode which connect + to the ground of the relay and connect - to vcc on the relay. Am I right? and, what size of diode do I need?
Tried to post twice and every time there was a reply and I'm getting confused now. Are you using a relay or a relay board? The relay board has those diodes (I assume that D1 and D2 in the picture provide the functionality described by jrdoner).
If you're using a relay, then you managed to do everything wrong that you could do wrong in connecting a microcontroller to a relay and I'm surprised that you did not blow up more Nanos. But I guess that's not the case.
May we assume that U4 in the schematic is the relay board? You're schematic is missing something very essential: the (5V) powering of the relay board.
The root cause of your problem is the high current that the relay coil draws initially when it gets power. As a result the supply voltage to the Arduino dips below the minimum operating voltage and as a result it resets.
Can you provide a proper drawing how the power lines and grounds are routed?
Can you provide a link to the schematic diagram of the board?
Your Bluetooth Mate Silver will use 50mA max and each relay/driver on your relay board will draw about 90mA. So, with 1 relay energized, 140mA total. With 2 relays energized, 230mA total (not including the current draw to power the Nano). Powering your Nano with 12VDC would not provide this much current through its 5V regulator.
The best solution would be to power the relay board with a separate 5VDC supply and use it's opto-isolation feature.
Switching your high voltage device (110VDC) may require arc-suppression across the relay's contacts or across the load. What is this device?
Also, you may need to provide additional physical separation from the Nano to the relay board and high voltage device.
P.S. - other replies came in while I typed this - some comments might be repetitive.
1, I am using the relay module shows in the picture.
2, the diagram is in the attachment. sorry for did not mention it.
3, Since I can't find the relay module in Fritzing, I just put a relay in there, but how I connect isrelay module's Vcc to Arduino 5V. GND to GND. IN1 to D8, IN2 to D9.
4, I am using a 12V power supply. the VIN also connect to the Vcc of a 4 wire blower, GND to GND. D9 is for logic gate power, D8 is for the signal.
5, the 110V device is an electrical charcoal starter. the arduino reset when I do NOT have the relay and charcoal starter connected.
Should I add resistor series connect with relay module?
I will take a picture of the real circuits connection tomorrow morning(technically today).
The 5volt regulator on the Arduino board will overheat and shut down when the relays kick in.
You should have used a 12volt relay board, so the Arduino won't have to provide the relay coil current.
Run the Arduino from a 5volt cellphone charger (with micro USB lead).
That will bypass the onboard regulator.
Your dead Arduino might still work that way.
Leo..
Thank you all for the reply. I separated power, and the problem was solved. the 5 volt regulator did overheat which cause the reset. I found that there are two Vin on the relay board. One is for coil and another one is for the gate. A jumper connect both Vin. I removed the jumper , and used one arduino board to provide the power and another to control the signal.