Page 1 of 1
Battery Level - ADS1015 or Arduino
Posted: Tue Jan 15, 2019 2:02 am
by amee
Hi All,
Please help to clarify -
Do i need an ADS 1015 if i'm using Arduino Pro Micro for my button Controls and have an Serial output from Arduino ( with connection from battery to arduino analog in) ?
Re: Battery Level - ADS1015 or Arduino
Posted: Tue Jan 15, 2019 2:28 am
by tinkerBOY
The atmega32u4 chip on the
Pro Micro already has the built-in 10-bit ADC so you don't need an ADS1015 for battery monitoring.
Re: Battery Level - ADS1015 or Arduino
Posted: Fri Mar 22, 2019 2:19 am
by lightpixel
Can you please show me, how it´s working? Do I need a special arduino code or is it work "out of the box"?
Re: Battery Level - ADS1015 or Arduino
Posted: Fri Mar 22, 2019 2:30 am
by tinkerBOY
lightpixel wrote: ↑Fri Mar 22, 2019 2:19 am
Can you please show me, how it´s working? Do I need a special arduino code or is it work "out of the box"?
You need of course a battery monitor code on both the arduino chip and on the Raspberry Pi side.
Here's a sample code from the Arduino IDE:
Code: Select all
/*
ReadAnalogVoltage
Reads an analog input on pin 0, converts it to voltage, and prints the result to the Serial Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/ReadAnalogVoltage
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
}
Re: Battery Level - ADS1015 or Arduino
Posted: Fri Mar 22, 2019 3:09 am
by lightpixel
Oh great. thank you. I want to use the mintybatterymonitor. So the battery is connected to GND and RAW on the arduino mirco board. Where has to wire SLC and SDA coming from the PI?
Re: Battery Level - ADS1015 or Arduino
Posted: Mon Mar 25, 2019 4:29 pm
by infinitLoop
lightpixel wrote: ↑Fri Mar 22, 2019 3:09 am
Oh great. thank you. I want to use the mintybatterymonitor. So the battery is connected to GND and RAW on the arduino mirco board. Where has to wire SLC and SDA coming from the PI?
i believe the minty script is tailored to use the ads. if you want to use the onboard atmega one, i think you want to use hoolyhoo's gbzbatterymonitor instead. you should not need to connect the slc and sda as that is handled in the board (i think anyway - i haven't tried this on the tinkerboy board, but i've used another board with the built-in atmega controller as the monitor, and did not need to connect gpios for it to work)
check out this thread:
viewtopic.php?f=44&t=3537&hilit=pro+micro+for+battery