Arduino Mini , problem with Voltage read


hi,

using voltage divider can monitor voltage 3cell lipo.

the problem serialread gives 1023 (max) when voltage @ 2.19v across arduino gnd , arduino a0

so dropping voltage ~10 2.19 arduino reads 5v (ie 1023)

i have attached schematic of setup.

i suppose problem might need reference voltage, maybe 1 board 5v? in case how need wire correct serialread.

here code well:

const int analogpin=a0;
int val=0.0;
void setup(){
  serial.begin(9600);
}

void loop(){
  val=analogread(analogpin);
  serial.println(val);
}



what trying use mini monitor voltage of lipo , hook relay switch off circuit if voltage drops below value. using mini can save weight possible. not sure if there board same thing less weight maybe?

thanks, , think first post in forum :)

1. please use code tags when posting code.

2. try changing first 2 lines to:

code: [select]

const int analogpin=0;
int val=0;


a0 call analog pin 0 when using digital pin. it's 0 when using in analogread call. don't know whether calling a0 work in context.

3. if voltage divider 4k +10v , 4.7k ground indicated in diagram, voltage @ centre won't below 5v. check calculations.


Arduino Forum > Using Arduino > Project Guidance > Arduino Mini , problem with Voltage read


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62