Pages: [1]   Go Down
Author Topic: LiPO Fuel Gauge - trying to get started and am very stuck  (Read 2272 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys, Im still very new to the world of arduino. For the project I have in mind I picked some parts from sparkfun including a LiPO fuel gauge (links below) and a 3.7v 2000 mah LiPO battery. I tried hooking it up today in multiple ways but couldnt get any data going to my arduino uno. I'm sure I've either got the wiring wrong or just dont know enough about coding yet to be able to see anything. I saw no data on the serial view in the arduino program. I searched online and followed multiple tutorials for similar things but still came up short. If someone could help give me the nudge I need to get going I'll be good to go from there. Ok so heres the links for the gear below:

LiPO Fuel Gauge - https://www.sparkfun.com/products/10617
corresponding datasheet - http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Prototyping/MAX17043-MAX17044.pdf
3.7v 2000 mah battery - https://www.sparkfun.com/products/8483
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys, Im still very new to the world of arduino. For the project I have in mind I picked some parts from sparkfun including a LiPO fuel gauge (links below) and a 3.7v 2000 mah LiPO battery. I tried hooking it up today in multiple ways but couldnt get any data going to my arduino uno. I'm sure I've either got the wiring wrong or just dont know enough about coding yet to be able to see anything. I saw no data on the serial view in the arduino program. I searched online and followed multiple tutorials for similar things but still came up short. If someone could help give me the nudge I need to get going I'll be good to go from there. Ok so heres the links for the gear below:

LiPO Fuel Gauge - https://www.sparkfun.com/products/10617
corresponding datasheet - http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Prototyping/MAX17043-MAX17044.pdf
3.7v 2000 mah battery - https://www.sparkfun.com/products/8483

How are you trying to wire the 3.7vdc battery to your arduino? The external power connector requires at 6vdc minimum and 7-12vdc is the recommended voltage input.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh.....well thats definitely good to know, for now im not trying to power the arduino from the battery (and may have to revise my future plans based on what you just told me) but mainly im just trying to get the reading from the fuel gauge to then use the arduino to light up a 10 segment led based on the level of charge the battery has. I think ive got the led portion worked out im just trying to get the data flowing so i can have an output correlating to the data.
Logged

SG
Offline Offline
God Member
*****
Karma: 11
Posts: 532
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How about try out this Maxim MAX17043/17044 Fuel Gauge Wire Library
Code:
/**************************************************************************
 *                                                                         *
 * MAX1704* Driver for Arduino                                             *
 *                                                                         *
 * Matthew Newberry                                                        *
 * mattnewberry@me.com                                                     *
 *                                                                         *
 ***************************************************************************
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify    *
 * it under the terms of the GNU License.                                  *
 * This program is distributed in the hope that it will be useful,         *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 * GNU License V2 for more details.                                        *
 *                                                                         *
 ***************************************************************************/

#include "Arduino.h"
#include "Wire.h"
#include "MAX1704.h"

MAX1704 fuelGauge;

void setup(){
 
 Wire.begin();
 Serial.begin(9600);
 
 Serial.println("Starting up...");
 delay(1000);
 fuelGauge.reset();
 fuelGauge.quickStart();
 fuelGauge.showConfig();
 delay(1000);
}

void loop(){

 delay(1000);
  float charge = fuelGauge.stateOfCharge();
  Serial.println(charge);
  delay(1000);
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just tried the code you posted above, im pretty sure i tried that yesterday too without success, it compiles fine, loads on the uno fine but just nothing happens on the serial monitor, i followed this diagram for physical connections, am i doing something wrong on the physical connections? or do I have to declare something in the code with the a4/a5 ports? thanks for the help guys

diagram: http://arduino.cc/playground/uploads/Main/max17043_fritzing.jpg
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 70
Posts: 3732
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
nothing happens on the serial monitor

Do you mean that you don't even see this: "Starting up..."?

Because if so, I'd suggest you back off with reading the fuel gauge and get that working independently first.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yea i dont even get that message, while troubleshooting i thought i shouldve at least seen that, i just tried extracting the serial code and trying that by itself and still nothing on the serial monitor, i havent really done anything with the serial monitor until now so im not really sure what im looking for in troubleshooting this

even this doesnt work:
Code:
void setup()
{
 Serial.begin(9600);
 
 Serial.println("Starting up...");
}

void loop()
{
}
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 70
Posts: 3732
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Things to check:
  • Remove any wiring apart from the USB connection
  • Confirm that the program is being uploaded from the IDE messages
  • Start the serial monitor in the IDE and make sure the baud rate is set to 9600
  • Try a different arduino
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i tried this on the uno and my micro and no dice on either one, ive barely even used the micro but from watching the LEDS on the board of the micro it looks like its still running one of the blink examples even though it said that it uploaded fine, im not sure whats going on
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok so i went out a bought a brand new arduino uno and tried it...same results with the serial test, what am i doing wrong? heres the serial test code i uploaded

Code:
void setup()
{
 Serial.begin(9600);
 
 Serial.println("Starting up...");
}

void loop()
{
}
Logged

SG
Offline Offline
God Member
*****
Karma: 11
Posts: 532
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Reference/Serial
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 70
Posts: 3732
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have the correct board selected in the IDE?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am having trouble getting the same Fuel Guage running myself.  I get output on Serial though.  The problem is I always get a value of 255 for the battery percent using the MattNewberry library @BillHo linked to.

I've got 4 sensors and a backlit LCD hooked up to an Arduino Micro powered by an 850mAh battery.  I've left it running for a couple hours and I would expect over 2 hours to see at least some drop in the battery percent.

I've read through the data sheet and I have a hunch this is programming related.  I also noticed the version reported back is "FF" instead of "0x08" which is defined in the library linked.

Anyone willing to help me trace down what might be going on or have ideas on how I can verify everything is setup address wise in the library / Wire interface code?
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok so i went out a bought a brand new arduino uno and tried it...same results with the serial test, what am i doing wrong? heres the serial test code i uploaded

I don't see anything wrong with the code, so I think you're looking for a more fundamental problem.

Have you successfully downloaded any of the example sketches to the Arduino? Have you opened the serial monitor and selected the correct speed as used in your sketch? Do you see the Arduino reset when you open the serial monitor? Do you then see the output from the Arduino in the serial monitor?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: