Powering an Arduino UNO through AREF!

Background story: I am powering an accelerometer module from a CR2032 lithium battery with nominal voltage of 3.0 V. To get accurate measurements, I connect ⊕ to AREF. Likewise I instruct the Arduino UNO to use AREF as ADC voltage reference. Now, when I disconnect power from the Arduino, it stays powered on.

When debugging the issue, I simplified the circuit:

You see that the green power LED is on, and also the orange LED on pin 13. :o

What’s happening here? Is that unhealthy?

Even if not unhealthy for the Arduino, I don’t want that. When power is removed from the Arduino, lights should be off!

One solution that comes to my mind is to use a voltage divider to power the accelerometer with ½ Vin. Then when I disconnect Vin, all power is off. (There were reasons not to use a voltage divider, though.)

Arduino sketch:

void setup() {
  analogReference(EXTERNAL);
}

void loop() {}

I don't know of an easy solution for that. I guess you could stick a relay between the battery and the Arduino...

I'm sure you have your reasons, but of course a battery isn't a great reference since the voltage drops over the life of the battery.

Why not use the 3.3volt pin of the Arduino to power whatever sensor you have.
That pin can also be used as a voltage reference.
The 3.3volt pin is not used by the Arduino itself, so should be stable, and can deliver up to 150mA.
Leo..

Yes, it is very unhealthy for the Uno, do not leave the battery connect in that way, you’ll kill your Uno.

Every pin of the atMeaga328 has diodes connecting to vcc and ground to prevent static damage. Since vcc is zero, the 3 volts of the battery passes through the esd diode of the aref pin and “phantom” powers the Uno. You are passing way too much current through the esd diode and it is likely going short and then the chip is useless.

You must have 5 volts on vcc when the battery is connected so either use a relay or a better solution is to power the both the accelerometer and aref pin from the 3.3 volt output pin of the Uno.

Other than as a reference voltage I don't see why you are using the battery.

You don't say what accelerometer you are using but If you are using an ADXL3315 then you could run it at 2.5 volts from a TL431A shunt regulator/voltage reference which can also be used as a 2.5V 1% reference connected to AREF. The power source for the TL431A can be the Arduino 5V pin through about a 1.8K resistor. This would provide the shunt regulator/reference just under 1 mA for it's supply and near to the 350 uA required by the ADXL3315.

I'm using the TL431A for several projects. They work great. Through ebay from China you can buy 50 TL431A shunt regulator/voltage reference for just £0.99 postage paid!

Thanks for all the suggestions!

Once more in life, I realize that it’s a mistake not to tell the whole story, which is:

What you see are the innards of a node inside the SAN network. The MCU is an Arduino Pro Mini 5V controlling four Neopixel LEDs and communicating on four ports simultaneously, using my library MultiTrans. Now I want to add an ADXL335 or ADXL337 accelerometer to measure the tilt angle of the node. Space is limited. Furthermore, I currently have 22 nodes, and fitting them all with an accelerometer can take a lot of time. So I want to reduce the number of connections that need to be soldered.

Arranged on a breadboard the current setup looks as follows:

Here one of the two batteries powers the Sparkfun ADXL 337 breakout board. I am now considering two alternatives:

  • Use a voltage divider to power the breakout board.
  • Use a breakout board that accepts 5V and regulates it down to the 1.8 to 3.6 V required by the ADXL335/7. In fact, for testing, I have a Seed Grove ADXL335 breakout board here. This board includes a voltage regulator, but it’s too big.

Concerning your responses:

DVDdoug:
a battery isn't a great reference since the voltage drops over the life of the battery.

I assume the voltage on AREF is allowed to drop over time, so that the measurement stays the same.

Wawa:
Why not use the 3.3volt pin of the Arduino to power whatever sensor you have.

The 5V Pro Mini (see above) doesn’t have a 3.3V output.

stowite:
TL431A shunt regulator/voltage

This looks like a nice suggestion, thanks! (though I think I better get a breakout board with everything integrated – already have enough to solder)

feklee:
This looks like a nice suggestion, thanks! (though I think I better get a breakout board with everything integrated – already have enough to solder)

I have found breadboards really really unreliable. They are okay for very simple stuff but once your system becomes more complex you will tear your hair out trying to find which connection is not actually a connection. Most of my stuff is 'one off' so I just use strip board.

Out of interest, how is having coin cells better than 1 small resistor, 1 small capacitor and a small TL431A ? If you need 3.3V (or other higher voltage) and not 2.5V the TL431A datasheet show how that can be done with just one more resistor.

stowite:
I have found breadboards really really unreliable.

I think you misread my reply: I said breakout board! No way to fit a breadboard in there, and indeed it would be really really unreliable.

feklee:
I think you misread my reply: I said breakout board! No way to fit a breadboard in there, and indeed it would be really really unreliable.

Your second image shows a breadboard !

stowite:
Your second image shows a breadboard !

Yes, but that’s just to illustrate the setup, which is hard to see in the first image.

stowite:
Out of interest, how is having coin cells better than 1 small resistor, 1 small capacitor and a small TL431A ?

It’s less to solder. The coin cells are there anyhow, to power the Arduino Pro Mini.

Soldering one node takes me about a day. Fortunately, if I produce several of them in a small series, I am faster per node. But still, I want to reduce the number of solder connections as much as possible. I realized that soldering free wires is considerably more time consuming than soldering stuff to a PCB.

Anyhow, there are breakout boards with a voltage regulator on them, and that’s what I’m eying at the moment.

Confused as always..

Why not just power the accelerometer board from a digital pin through a voltage divider.

In such a small area you could use the resistor legs themselfs as the “wires” to solder the connections together.

Might also give you power saving options, how often do you need data from the tilt signal?

I'm just wondering why you're not running everything at 3 volts? Switch to 8MHz Mini's that run reliably at 3 volts which will decrease current consumption and increase battery life.

This would be so much easier if you were willing to make your own boards :wink:

Slumpert:
Why not just power the accelerometer board from a digital pin through a voltage divider.

Yes, voltage divider is something that I keep in mind as an option – see my original post. Powering it from a digital pin is an interesting idea for saving power, but: The ADXL335/337 consumes a negligible amount of power compared to the four NeoPixel LEDs mentioned in my second post.

In such a small area you could use the resistor legs themselfs as the “wires” to solder the connections together.

Indeed. Just I need to be careful that everything is properly isolated. I think twice about every additional step required during soldering / assembly.

how often do you need data from the tilt signal?

one readout every 500 ms

WattsThat:
I'm just wondering why you're not running everything at 3 volts?

because the WS2811 Neopixel LEDs require 5V

8MHz Mini

8 Mhz is too slow. With 16 Mhz the system is just usable with up to 22 network nodes. The code is highly optimized. In fact, I use template meta programming to get tight machine code in the interrupts. There is a lot of communication going on all the time, on up to four ports at once. This is the bottleneck.

This would be so much easier if you were willing to make your own boards

OTOH if I had made my own boards in the past, I probably couldn’t just add accelerometers now. I prefer to keep things flexible.

Slumpert:
Confused as always..

Why not just power the accelerometer board from a digital pin through a voltage divider.

Because a voltage divider is a very bad idea for power. In this case it is a spectacularly bad idea because that power is used as an analog reference. If the chip being powered uses a variable amount of current then the voltage at the divider will vary. This will be unpredictable and possibly quite high frequency, so impossible to measure and correct for.

For an analog accelerometer, or most other analog sensors, you must have a regulated power supply. The regulator can be as simple as a single Zener diode but I would not recommend that as the regulation is poor.

I think it is time to design your own PCBs. It is not difficult and surprisingly cheap for little boards like these. If anything, it rigidly fixes your tilt sensor relative to the outside casing.

MorganS:
Because a voltage divider is a very bad idea for power.

I’m not sure I understand why.

In this case it is a spectacularly bad idea because that power is used as an analog reference.

Isn’t using the voltage for the ADXL337 as analog reference an advantage?

My thinking: If the voltage fluctuates due to fluctuations in the ADXL337’s power consumption, then the voltage on AREF will fluctuate accordingly. In other words, the ratio of g/AREF will stay the same, and I will get consistent measurements.

OK below you write that the fluctuations can be at high frequency. If that is the case, and if AREF cannot keep up, then I understand that there is an issue. But is it the case?

If the chip being powered uses a variable amount of current then the voltage at the divider will vary. This will be unpredictable and possibly quite high frequency, so impossible to measure and correct for.

Concerning current, the ADXL337 spec sheet only states:

Supply Current: 300 μA (at 3 V)

With the 300 μA, I did some calculations. For a voltage divider with two 100 Ω resistors, I get a supply voltage of: 2.485 V

Now – although there is no mention of that in the spec sheet – let’s assume that the current fluctuates by ±50%. The corresponding fluctuation of the supply voltage is negligible at: 2.485 V ± 0.3%

This looks OK.

I think it is time to design your own PCBs.

At the current state, I don’t think it makes sense. I would need to manufacture all 22 nodes again, which takes a lot of time. And then maybe it doesn’t work as I want, and I would need to choose a different accelerometer, etc.

But there are ADXL335/337 breakout boards with voltage regulators on them. Guess I’ll get some of these, just to be on the safe side.

If anything, it rigidly fixes your tilt sensor relative to the outside casing.

The tilt sensor in the first image in my second post is rigidly fixed to the outside casing: It is glued to the Arduino Pro Mini with double sided tape, and the Arduino Pro Mini sits firmly in the casing.

Hi,

Supply Current: 300 μA (at 3 V)

With the 300 μA, I did some calculations. For a voltage divider with two 100 Ω resistors, I get a supply voltage of: 2.485 V

Now - although there is no mention of that in the spec sheet - let's assume that the current fluctuates by ±50%. The corresponding fluctuation of the supply voltage is negligible at: 2.485 V ± 0.3%

If you use 2 x 100R for the divider, then the divider current will be at least,

2.485 / 100 = 24.85 mA.

What are you using to supply the current?

Tom... :slight_smile:

TomGeorge:
If you use 2 x 100R for the divider, then the divider current will be at least,

2.485 / 100 = 24.85 mA.

Oh! Didn’t think about that. In fact the current is even higher than that. 2.485 V is the voltage drop over the resistor which is parallel to the ADXL337. The voltage drop over the other resistor is 5 V - 2.485 V = 2.515 V. The current thus is:

2.515 V / 100 Ω = 25.15 mA = 24.85 mA + 300 µA

300 µA is what the ADXL337 draws. With my CR2032 batteries providing 220 mAh, they would run out in less than an hour.

With two 1 kΩ resistors, supply voltage is 2.35 V ± 3% for a supply current of 300 µA ± 50%. Again, in the spec sheet there is no mentioning of the supply current fluctuating at all. Anyhow, now the current draw of the voltage divider circuit is on average:

(5 V - 2.35 V) / 1 kΩ = 2.65 mA

That could work, unless the current fluctuates considerably more and at a frequency that AREF cannot keep up with. It could be interesting to connect the ADXL337 to my USB scope and see how it behaves. Just at the moment, I think I have better things to do, and so the breakout boards with built-in voltage regulator look very appealing.