Go Down

Topic: Project Frying Nanos! Assistance Greatly Appreciated. (Read 610 times) previous topic - next topic

schallis

Hello everyone. Thank you for reading this. Long time lurker, etc etc....

I'm working on an intermittent wiper module for my parent's older truck. I've yet to get to the stage where I have tested it installed into the truck as it keeps frying the nanos I'm building it with during testing.

The built project will run for a few minutes before the Nano freezes up and the LED I have built into the project goes dim.

When the project dies, the digital pin starts outputting ~2v and the nano stops sending serial data. I have only powered my projects with USB so far, but powering it via the VIN pin has the same effect.

I have attached a crude diagram and my code if someone would be so kind as to tell me what I'm doing wrong.


Thank you again for your time!



Quote
int sensorPin = A1;    
int motorPin = 2;    
int interval = 0;  

void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(motorPin, OUTPUT);
  pinMode(LED_BUILTIN, OUTPUT);
    Serial.begin(9600);
}

void loop() {

 int sensorValue = analogRead(A1);
 if (sensorValue <= 10) {
  interval = 0;
 }
 else interval = (2000 + (sensorValue * 8));
      
      
Serial.println(interval);
Serial.println(sensorValue);

    digitalWrite(motorPin,HIGH);
    digitalWrite(LED_BUILTIN, HIGH);
    
    delay (1000);
    
    digitalWrite(motorPin,LOW);
    digitalWrite(LED_BUILTIN, LOW);
    
    delay (interval);

}
**EDIT: THE PIN LABELED VCC ON THE NANO SHOULD'VE BEEN LABELED VIN**

alesam

Could you clarify - did it happened when arduino was powered from USB or from +12V through vcc pin?
How many nanos did you fried?

schallis

I've fried two so far.

While I briefly tested the first with 9v and 12v, it died after a few minutes of operation from USB.

I added the 1.5k resistor before the relay IN when I built the project a second time.

I completely rebuilt the project with new wire, solder, terminal blocks, relay module, etc in an effort to rule out a short due to construction fault.

The second Nano was powered exclusively via USB and also ran for a few minutes continuously before freezing up.

The data sheet for the relay module says it draws 65mA in operation. As you can see from my diagram, it is powered by the 5v rail. The 5v rail still outputs 5v after the controller dies and thus the relay still ticks being active low. The D2 pin outputs 2v as soon as the nano is powered and doesn't change.

surveyranger

Check the pot on A1 and consider putting a series resistor in there.  If the pot is dialed all the way to the right, then the resistance would be close to 0 ohms.  That gives 5V/1ohm = 5A (or 5000mA). In the other direction, it goes down to .5mA.  A series resistor will always guarantee at least some resistance to reduce current.

Along that same line, why is the pot wired to ground and the 5V pin?  It consumes .5mA doing nothing and creates a voltage divider to A1.

What does A1 (sensorPin) do as it is only described as a variable, but doesn't make an appearance in the code?

alesam

Try to measure relay module power consumption (with no arduino connected)

WattsThat

Check the pot on A1 and consider putting a series resistor in there.  If the pot is dialed all the way to the right, then the resistance would be close to 0 ohms.  That gives 5V/1ohm = 5A (or 5000mA). In the other direction, it goes down to .5mA.  A series resistor will always guarantee at least some resistance to reduce current.

Along that same line, why is the pot wired to ground and the 5V pin?  It consumes .5mA doing nothing and creates a voltage divider to A1.

What does A1 (sensorPin) do as it is only described as a variable, but doesn't make an appearance in the code?
An adjustable voltage divider is exactly what is needed and there is no need for a series resistor. The input impedance of an AVR analog input is 100 megohms and the high current scenario you describe simply does not not occur.
Vacuum tube guy in a solid state world

holmes4

IF there is a relay in the diagram you posted it is wrongly wired no transistor and do fly back diode!

Mark

JCA79B

If you have 12V power you should use a relay module with a 12V relay controllable with a 5V signal. That would shift the relay coil load from the Nano to the car's electrical system.
https://www.amazon.com/KNACRO-Triggering-Optocoupler-Automation-Industrial/dp/B07KXL6QML/ref=sr_1_7?crid=2VI3S4QET3Z52&keywords=12v+relay+module+1+channel&qid=1553402000&s=gateway&sprefix=12V+relay+module%2Caps%2C175&sr=8-7

schallis

UPDATE:

1) I can confirm 4.75v on the 5v supply when powered via USB and 5.1v when powered with a 9v battery.

2) The relay is part of a relay module which contains an opto-coupler.
This is the unit I am using: https://www.amazon.ca/gp/product/B00ZR3B252/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1

I only have a meter and don't own a scope. Do I need to worry about flyback? Doesn't the relay module I am using contain the relevant circuit protection?

3) I tested the relay and the total project current draw. The project's total amp draw is 95mA. The relay draws 59mA of that. The relay is powered by the 5v supply as shown in the diagram. The remainder of the project draws 36mA.

Am I doing something wrong here?


Thank you again for your assistance.

surveyranger

3) I tested the relay and the total project current draw. The project's total amp draw is 95mA. The relay draws 59mA of that. The relay is powered by the 5v supply as shown in the diagram. The remainder of the project draws 36mA.

What is the Arduino Nano's maximum amp draw from a pin?  In total?

schallis

#10
Mar 24, 2019, 06:22 am Last Edit: Mar 24, 2019, 06:22 am by schallis
What is the Arduino Nano's maximum amp draw from a pin?  In total?
I believe the I/O pins are rated at 40mA max as per the clone mfg. D2 has a 17mA load when switched high. That is the only I/O pin with current draw. I could not find data about the max current load of the 5v supply. Do you suspect a 59mA load on the 5v supply is too much?

surveyranger

I believe the I/O pins are rated at 40mA max as per the clone mfg. D2 has a 17mA load when switched high. That is the only I/O pin with current draw. I could not find data about the max current load of the 5v supply. Do you suspect a 59mA load on the 5v supply is too much?
Looks like a Nano should be able to supply up to 500mA on the 5V supply so 59mA shouldn't be a problem. 

schallis

If you have 12V power you should use a relay module with a 12V relay controllable with a 5V signal. That would shift the relay coil load from the Nano to the car's electrical system.
https://www.amazon.com/KNACRO-Triggering-Optocoupler-Automation-Industrial/dp/B07KXL6QML/ref=sr_1_7?crid=2VI3S4QET3Z52&keywords=12v+relay+module+1+channel&qid=1553402000&s=gateway&sprefix=12V+relay+module%2Caps%2C175&sr=8-7
Hi, thanks for your reply. I was wondering if you believed that 59mA is too much for the 5v supply on the Nano to handle? Am I overestimating the Nano clone's ability?

The idea to use a 12v relay module makes a lot of sense. I've already purchased and built this project with 5 relays and was hoping not to start from scratch again (I built an enclosure to fit these parts). Should I give up on the 5v relays?

GoForSmoke

You have an optocoupled relay, the relay-switched power and ground are isolated from the controller so you can run completely separate power through the relay from your Nano.

You have them tied at VCC. When the motor starts and stops your Nano is going to get power fluctuations in line with power use.

The relay should be connected to car + and - to turn power ON and OFF to the wiper motor. The Nano must get clean 5V.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Wawa

Looks like a Nano should be able to supply up to 500mA on the 5V supply so 59mA shouldn't be a problem. 
Wrong.

The 5volt regulator of a Nano has almost no heatsink.
Anything more than 0.5watt will result in an overheating regulator.
If you drop 12-5 = 7volt, then that's a max current of 0.5watt/7volt = ~70mA.
If you subtract ~30mA from that for the Nano itself, then you have ~40mA max left for the pot/LED/relay.
A common relay module with optocoupler draws 2mA from the output pin, and about 75mA from the 5volt pin.
So there's your problem. You basically can't/shouldn't power a Nano from 12volt.
Use a 5volt buck converter, and power the Nano and relay module from that.
Leo..

Go Up