I have powered arduino atmega2560 with 12V at VIN input. Load is around 125mA. I see some strange behavior. I am trying to read some analog inputs ( using external ADC) and when VIN =12V, I am unable to read data. However when I reduce VIN to around 8V, data begins to appear. . What could be the problem?
Overheating of the onboard regulator possible.
Or bad layout of the sensor components. I don’t like the look of how you run that ground. Or at least that is what is coming trough on my crystal ball.
Do you think, it will work at VIN=12V/125mA?
You also have to add the current taken by the rest of the board as well as the load.
It is not the current by itself it is the power dissipation that can limit things.
So (12 - 5 ) * current is the dissipation in watts.
My total current on 12V load is 130mA max ( includes arduino and rest)
The "Vin" pin or in fact the "barrel jack" which is the same with a diode, was provided to demonstrate the Arduino. Once you start connecting things that draw current, and that includes connecting things to draw current from the "5V" pin, you are playing with fire - or not! This is even worse for the Mega as it has more pins to connect things to! ![]()
The on-board regulator - unless you use a variant such as the "RoboRed" (it has a proper switchmode regulator) - has no heatsink of significance. It may theoretically have a rating of 1 A, but only when bonded to a substantial heatsink. You can barely see it on the Arduino board. You will not get 1 A at 5 V from the board with any "Vin" voltage for more than a second or two before the regulator overheats - and hopefully shuts down peacefully. You may be lucky to get 150 mA. ![]()
It is thus extremely bad design to use "Vin" in a serious project. Even if it works at a start, any modification may later cause trouble.
The microprocessor and its peripherals operate from 5 V. If you have 5 V then you provide it to the "5V" terminal. You can fudge it by connecting something such as a USB charger to the USB connector but there is a 500 mA polyfuse on the UNO/ Mega and a diode on the Nano interposed. If you do not have 5 V, then you provide a switchmode regulator to produce regulated 5 V.
hi
Atmega2560 arduino has only VIN or power jack as input. I suppose 5V cannot be directly fed to arduino. ok. what's the best practice and any reference design?
I suppose 5V cannot be directly fed to arduino
You suppose incorrectly. It has a 5V pin. Feed 5V into it and connect the ground of your 5V supply into the ground of the Arduino.
So VIN can be left unconnected. Can I use USB to program the board. Will it not clash with external 5V
Will it not clash with external 5V
I have never found it to be a problem but some purists connect the Vin to the 5V rail to prevent theoretical damage to the regulator.
The "theoretical damage" could only ever occur if you connect an already powered 5 V power supply with its output capacitor charged, to the 5 V pin - i.e., "hot connect". This is automatically something you should never do anyway and should not in fact be possible. If you connect it to the power supply - with proper connections, generally soldered - before you turn on the power supply, the voltage rise will be far too slow to cause any problem with the regulator.
Just make a practice - the on-board regulator with the "Vin" or "Barrel jack" are useless for most purposes.