Arduino Uno - Analog pin with constant 5V

I need to read the output from a 0-10V sensor with a minimum power requirement of 15VDC.

I therefore power the Arduino via a voltage regulator that regulates the power down to 12VDC (within the recommended power range for the Arduino)

I use a 3.95" TFT shield from mcufriend as display unit, which only leaves A5 as available analog input on the Arduino.

Input to the Arduino is regulated to 0-5V through a voltage divider (2x100kOhm) and has been tested to work as expected.

The setup has been tested on two different Uno's:

  1. Arduino Uno WiFi (not a shield, the actual Uno WiFi)
  2. Arduino Uno

Now to the problem(s):

  1. Arduino Uno WiFi
    Measuring on pin A5 outputs 4.96V and will not show a different output, neither on the display nor measured, independantly of the input from the sensor.ยด
    A forced reading of 0V can be obtained by grounding pin A5.
    This setup shows long term stability, and does not cause the voltage regulator to get significantly hot.

  2. Arduino Uno
    This setup works for a short period of time (<10min), i.e. the input on pin A5 (and hence readout on the display) will follow the output on the sensor.
    However at around the 10 min mark, the Uno will start to power cycle periodically.
    The voltage regulator is very hot, and the output from it is fluctuating between 0V and 12V, causing the power cycling of the Uno.

Questions:

  1. Has anyone experienced similar problems with analog inputs on Uno (WiFi)? I know that an unloaded input may fluctuate, but this seems to be carved in stone. Tried other inputs on the Uno WiFi with similar result. The TFT shield uses pin A0-A4 and is working, so I assume it is not a general problem with the analog pins?

  2. My assumption with regards to the power cycling of the Uno is due to excessive current draw from the regulator, however the main load is the TFT shield, and that is the same in the two setups, so why the difference in power usage? I have to admit, that I have not measured the current in the two setups (yet).

I should mention that even with the simplest of sketches, i.e. just reading values from A5 and outputting it to the terminal, the Uno WiFi exhibits the same behavior as described.

Hope that someone is able to point me in the right direction.

I'd venture a guess that something is initializing that analog pin to have the pullups enabled, and those are overpowering the signal you're trying to measure. Is that confirmed with a volt meter?

Your regulator is overheating, because you're feeding it with the very high end of the input voltage range, and drawing a significant amount of current (the screen's backlight is a killer). 12 volts in, 5 volts out means it's wasting 7/12ths of the power you're giving it and turning it into heat. It doesn't take much current for the heat being generated to overheat the regulator. Regulator reacts to this by turning itself off to prevent it from burning out, then cools down and turns back on.

The solution is to use a lower input voltage - either something closer to 7 (at much below that, the regulator can't get 5v output from it due to the dropout in the regulator), or even using an external supply to get the 5v.

A less ideal solution, you could try sticking a heatsink onto the top of the regulator with thermal epoxy ( something like this https://smile.amazon.com/Arctic-Alumina-Thermal-Adhesive-5g/dp/B0009IQ1BU/ref=sr_1_3?ie=UTF8&qid=1477494633&sr=8-3&keywords=arctic+silver+epoxy - no specific endorsement of that seller, but I've had good results with both Arctic Silver and Arctic Alumina (same company). Be aware that the same brand also makes normal thermal compound that isn't epoxy).

Thank you your reply DrAzzy :slight_smile:

I can see that my initial posting was not detailed enough:

It is not the regulator on the Uno that is overheating. I use an external regulator (L78S12CV 12V@2A) to step the required 15V for the sensor down to something accepted by the Uno, in this case I have chosen 12V since it is within the recommended range as specified by Arduino (Link). The external regulator is the one that is getting hot when used with the Uno, but not getting hot when used with the Uno WiFi. BTW I am already using a heatsink on the external regulator.

Do you know if it is default behavior to treat the analog pins as digital pins on the Uno?
Wouldn't/shouldn't the use of analogRead() overwrite that?

I know that you can use the analog pins as digital pins, but doesn't that have to explicitly defined in the sketch?

I have measured the following voltages with reference to GND, and yes I have indeed confirmed that it is the same "GND" that is used on the Uno(s) and the sensor:

Sensor output before voltage divider: 0-10V
Sensor output after voltage divider, but without connection to Uno WiFi: 0-5V
Sensor output after voltage divider, but connected to Uno WiFi: 4.96V, which is the same voltage measured on the analog pin.

Sounds like pullups are on. Are you using anything with i2c? (Wire.h) A5 is used for that and the pullups get turned on for that.

There's no such thing as analog mode for pins. They're normal digital pins (except A6/A7 on '328p based boards - those can only do analog read), work same as any other pin - just with the added ability to measure the voltage on the pin. Like how pwm pins are normal pins that can also do pwm.

Sounds like you should get different external regulator, then.

Not sure I (or Arduino for that matter) agree with your view on the functions of pins A0-A5 on an Uno :slight_smile:

They are referred to in the documentation as Analog Input Pins (link)

And unless you use pinMode() they will act as exactly that.

Anyway, no I2C units are being used in this project, and the TFT shield explicitly leaves A5 as an awailable analog port.

Yes, I am considering using a different regulator (maybe 9V) but I still find it a bit strange that the current one will drive the Arduino Uno WiFi plus the TFT shield without getting hot at all.

I also expect the arriaval of a second Uno today that I can do some testing with.