Minimum Current Requirements for an Arduino Nano 33 BLE analoge input.

Thread Starter

MB107

Joined Jul 24, 2016
400
I have a voltage divider used to sense voltage from automotive ~14V and scale it down to a compatible < 3.3V on pin A0. It works very well and does the job just perfectly. Question I have is about optimizing the voltage divider for this application especially with the goal of reducing power requirements as this part of the circuit is not effected when the Nano is in sleep mode. This system would also work with R12 and R13 at 3.3KΩ and 330Ω respectively, maybe even 330KΩ and 33KΩ. Basically what is the highest resistors I could reliably run with and what is the minimum current that can be read on an Analog input pin.

I also have essentially the same situation where I want to put a trim pot to one of those analog inputs that will trim voltage from 0-3.3V. Essentially it would replace R12 and R13 in the schematic shown. Seams any pot will work but The higher the Ω the less power. What would be a maximum trim pot size be with reliable operation.

1731967909561.png
 

be80be

Joined Jul 5, 2008
2,394
It's usually no more then 20 K total. Too high and your readings not be right.
Your basically discharging a cap and timing how long that takes so if you use to high resistors timing to charge will be off.
 

LowQCab

Joined Nov 6, 2012
5,101
You're asking the wrong question ..........

The question should be, what is the Impedance of an Analog-Input on a Arduino Nano 33 BLE ?

And even that is the wrong question to ask ............

You should be designing your Circuit so that the Inputs are Buffered with an Op-Amp,
this also gives You the opportunity to "build-in" Gain, and Voltage-Offset into the Input-Circuit,
( or even to Invert the Signal as well ).

This will make things much more simple and stable in the long-run.

It is possible to play with Resistor-Networks to get a workable result,
but I wouldn't recommend it if You require even a moderate amount of accuracy.
.
.
.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
It's usually no more then 20 K total. Too high and your readings not be right.
Your basically discharging a cap and timing how long that takes so if you use to high resistors timing to charge will be off.
Thanks for the reply. So it appears that I'm off by a factor of about two. I could go with 1.8K and 18K. It works very well the way it is on a bench test but it hasn't been tested in the noisy automotive environment yet.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
You're asking the wrong question ..........

The question should be, what is the Impedance of an Analog-Input on a Arduino Nano 33 BLE ?

And even that is the wrong question to ask ............

You should be designing your Circuit so that the Inputs are Buffered with an Op-Amp,
this also gives You the opportunity to "build-in" Gain, and Voltage-Offset into the Input-Circuit,
( or even to Invert the Signal as well ).

This will make things much more simple and stable in the long-run.

It is possible to play with Resistor-Networks to get a workable result,
but I wouldn't recommend it if You require even a moderate amount of accuracy.
.
.
.
Thanks

It's a little beyond my understanding but If you have an example I would love to look into it.
 

LowQCab

Joined Nov 6, 2012
5,101
One of the very useful ways to use an Op-Amp is for "Buffering" a Signal.

This means that a very High-Impedance-Circuit can be turned into a relatively Low-Impedance-Circuit.

A High-Impedance-Circuit might easily be influenced by outside-factors,
but a Low-Impedance-Circuit is much more resistant to any outside-influences.
.
.
.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
One of the very useful ways to use an Op-Amp is for "Buffering" a Signal.

This means that a very High-Impedance-Circuit can be turned into a relatively Low-Impedance-Circuit.

A High-Impedance-Circuit might easily be influenced by outside-factors,
but a Low-Impedance-Circuit is much more resistant to any outside-influences.
.
.
.
So one of the circuits I found online is the one below. But the Op Amp part number is not given and it has 3 terminals. All the ones on Digikey have 8 or more terminals?
1731981397012.png


1731981779676.png
 

be80be

Joined Jul 5, 2008
2,394


Most have 2 you'll only using one pin 2 and 3 output on 1 and the power pins the lm 358 easy one two play with. There more better ones as you learn but these are used a lot with microcontollers
 

LowQCab

Joined Nov 6, 2012
5,101
It would have been nice just to say "I want an LED-Meter for my Car's Battery, with 3-LEDs"
I'm assuming that's what this project is.

There are much more elegant ways of accomplishing this final product,
all Analog, with a single Chip, plus a 3-Color, 10-LED-Display-Chip.
.
.
.
 

Attachments

Take a look at these two images from the ATmega328 datasheet for optimizing the ADC.

The first image shows there is a fairly large series resistor connected to the timing capacitor mentioned by be80be. This means you can directly connect a (low impedance) voltage source to the ADC input without damaging it. Since you are using a voltage divider, find a combination that equals no more than 10kΩ (product over sum formula). The opamp circuit you posted provides a low impendence output but isn't really needed in this situation.

adc1.png

The second image is a bit off topic but relevant. By default, the ATmega328 compares the ADC input to the onboard 5V regulator which is prone to noise. A better option is to use the onboard 1.1V voltage reference which is much more stable. All you need to do is add the line "analogReference(INTERNAL)" to your code and change any ADC calculations from 5V to 1.1V. This has the added benefit of improving the quantization level from (5V / 1024 = 5mV) to (1.1V / 1024 = 1mV) so you'll get more precise readings.

https://www.arduino.cc/reference/tr/language/functions/analog-io/analogreference/

adc2.png
 
Last edited:

LesJones

Joined Jan 8, 2017
4,511
The source resistance seen by the ADC input is NOT the sum of the two resistor values in the potential divider. It is the two resistors in parallel. so 3.3K and 33 K in parallel would be be seen a a source resistance of 3K.
The load on the battery would look like a 36.3K resistor so it would be 12/36.3K = 0.33 mA

Les.
 

LesJones

Joined Jan 8, 2017
4,511
If you are only displaying the output on 3 LEDs you would not need any great accuracy. If you do require more accuracy than a 10 bit ADC you could considder using an INA219 which has a 12 bit ADC. It will also measure your 12 -14 volts directly without a potential divider. It can also measure the current on the positive of your 12 - 14 volts.
I have uses a number of these for remote moitoring of 12 volt battery charging together with a PIC12F1840 micro and an HC12 for the wireless data link.
Les.
 
The source resistance seen by the ADC input is NOT the sum of the two resistor values in the potential divider. It is the two resistors in parallel. so 3.3K and 33 K in parallel would be be seen a a source resistance of 3K.
The load on the battery would look like a 36.3K resistor so it would be 12/36.3K = 0.33 mA

Les.
Good eye!

Rsource = (R1 * R2) / (R1 + R2)
Rsource = (3.3k * 33k) / (3.3k + 33k) = 3.0k

Therefore, to minimize current draw and not exceed recommend output impendence:

Rsource = (11k * 110k) / (11k + 110k) = 10k
 

be80be

Joined Jul 5, 2008
2,394
Your not drawing anything your charging it to get a reading it charges a the capacitor then reads how long it takes to discharge it
 
Your not drawing anything your charging it to get a reading it charges a the capacitor then reads how long it takes to discharge it
The voltage divider still draws current. I calculated R1=11k, R2=110k provides the highest series resistance of 121k while not exceeding the stated 10k maximum equivalent resistance (output impedance). I don't think there is a better combination that yields no less than 121k Rs and no more than 10k Req.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
Wow lots of discussion since I was last here. I will need to do a lot of reading. There does seam to be a bit of confusion of what this voltage divider circuit does. It is used to tell the Arduino whether or not the vehicles engine is running or not. I'm looking for a 13.2V threshold scaled down to be read on a 3.3V max input pin. The rest of the components run a PWM radiator fan.

The trim pot I want to add will be used to control the fan run time after the engine is shut off. For example control voltage from 0-3.3V using the trim pot and reading the voltage at an analog input pin. 0V and the fan does not run after engine off. 3.3V and the engine runs for 60 second.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
It would have been nice just to say "I want an LED-Meter for my Car's Battery, with 3-LEDs"
I'm assuming that's what this project is.

There are much more elegant ways of accomplishing this final product,
all Analog, with a single Chip, plus a 3-Color, 10-LED-Display-Chip.
.
.
.
See post 19
 
Top