Arduino Leonardo pro micro

Having trouble with your GBZ build? Ask your questions here!
3kidsinaustin
Posts: 27
Joined: Sat Dec 29, 2018 8:21 pm
Been thanked: 7 times

Re: Arduino Leonardo pro micro

Post by 3kidsinaustin » Tue Jan 22, 2019 12:39 pm

I haven't tried the script with actual voltage yet, just the breadboard test I mentioned earlier with 5v and GND to show 100% and 0%. Have you reviewed the actual script on the github site (https://github.com/HoolyHoo/gbzbatterym ... Monitor.py)? It looks like there should be the following behavior with the icon:

3.77 - 4.1v = 100%
3.64 - 3.76 = 75%
3.51 - 3.63 = 50%
3.21 - 3.50 = 25%
Less 3.20v = 0% and initiate shutdown sequence

This is based off a VCC of 5.1v, according to the script. Possibly the 4.5v VCC is skewing the results? Do you have a 5v power supply to use? Either a free standing one (what I have been using for testing)? That is where I would start first before reflashing and starting over.
First Build Done! viewtopic.php?f=43&t=7444

User avatar
correia5022
Posts: 202
Joined: Mon Dec 05, 2016 12:32 am
Location: Portugal
Has thanked: 17 times
Been thanked: 38 times

Re: Arduino Leonardo pro micro

Post by correia5022 » Tue Jan 22, 2019 4:02 pm

3kidsinaustin wrote:
Tue Jan 22, 2019 12:39 pm
I haven't tried the script with actual voltage yet, just the breadboard test I mentioned earlier with 5v and GND to show 100% and 0%. Have you reviewed the actual script on the github site (https://github.com/HoolyHoo/gbzbatterym ... Monitor.py)? It looks like there should be the following behavior with the icon:

3.77 - 4.1v = 100%
3.64 - 3.76 = 75%
3.51 - 3.63 = 50%
3.21 - 3.50 = 25%
Less 3.20v = 0% and initiate shutdown sequence

This is based off a VCC of 5.1v, according to the script. Possibly the 4.5v VCC is skewing the results? Do you have a 5v power supply to use? Either a free standing one (what I have been using for testing)? That is where I would start first before reflashing and starting over.
I finally have it working fine.

So, first off, you should attend the exact voltage that really gets in your arduino, with all things wired up, since the voltage will get lower as things are turned or working.
Next, you should tweak both arduino and HHBatteryMonitor.py codes with that voltage

Also, i have been analysing the typical voltage drops on a li-poly & li-ion batteries.
HoolyHoo did an excelent job, but i tweaked those voltage ranges.
Since i will be using a 3000mAh, and that total amps drawn with my setup is like 500~600mAh, which converting to a 3.7v rate gets like 800mAh wich is about 0.3C draw
check below
typical li-ion battery dischargeShow
Image
After trial and error i finnaly got it to work just fine.
I'll still keep the led indicator, it works flawlessly
________________________________________
Starting on electronics :)
My first build, 2 years later
https://sudomod.com/forum/viewtopic.php ... 8&start=30
Check out my Boombox: https://nrcboombox.wixsite.com/website

RobbsyB
Posts: 29
Joined: Wed Jan 18, 2017 4:32 am

Re: Arduino Leonardo pro micro

Post by RobbsyB » Sun Feb 24, 2019 11:51 am

Hey

I just flashed an Arduino Pro Micro with your code and installed HoolyHoo's battery monitor. However, after installation of the battery monitor script, the Arduino does not react to every button press. Only when pressing buttons for 2 seconds or longer, the action will be triggered.
After disabling the respective line
/home/pi/gbzbatterymonitor/HHMonitorStart.sh &
in /etc/rc.local and rebooting everything is back to normal.

More details:
There is no battery icon shown in the top right corner.

If I try to install
sudo apt-get install libpng12-dev -y
I get the error message:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libsdl1.2-dev : Depends: libcaca-dev but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Do you have an idea why I am having this problem?
Any idea would be appreciated.

Cheers!

3kidsinaustin
Posts: 27
Joined: Sat Dec 29, 2018 8:21 pm
Been thanked: 7 times

Re: Arduino Leonardo pro micro

Post by 3kidsinaustin » Sun Feb 24, 2019 7:10 pm

Have you tried uninstalling and reinstalling the files? I installed mine using the manual option for no good reason other than i wanted to see what each step did. It worked the first time. Maybe you missed a step? Do you have any necessary libraries installed? I know this isn't he beat answer, it i can tell you from experience that is you carefully follow each step, it will work out ok.I

For the battery icon, do you have visited up correctly, including the resistor? I did all my experimenting on a breadboard first, similar to how the OP posted.

Good luck!
First Build Done! viewtopic.php?f=43&t=7444

RobbsyB
Posts: 29
Joined: Wed Jan 18, 2017 4:32 am

Re: Arduino Leonardo pro micro

Post by RobbsyB » Mon Feb 25, 2019 1:01 am

3kidsinaustin wrote:
Sun Feb 24, 2019 7:10 pm
Have you tried uninstalling and reinstalling the files? I installed mine using the manual option for no good reason other than i wanted to see what each step did. It worked the first time. Maybe you missed a step? Do you have any necessary libraries installed? I know this isn't he beat answer, it i can tell you from experience that is you carefully follow each step, it will work out ok.I

For the battery icon, do you have visited up correctly, including the resistor? I did all my experimenting on a breadboard first, similar to how the OP posted.

Good luck!
Hey ,
thank you for your quick answer. I am pretty sure all connections are wired up correctly including the 10k resistor between A0 and the on/off switch. I did the installation of the battery monitor on 2 sd cards (1x manual, 1x automatic) with exactly the same result. The installation of sudo apt-get install libpng12-dev -y
resulted in the same error message for both installations.
When connecting the Arduino to a PC and checking serial output, all values seems to be ok.
What could be the reason for the battery monitor to delay/suppress the button presses?

Maybe I will try to flash Helders hex file for the Arduino. Dont know if that makes any difference.

Thanks!

RobbsyB
Posts: 29
Joined: Wed Jan 18, 2017 4:32 am

Re: Arduino Leonardo pro micro

Post by RobbsyB » Mon Feb 25, 2019 2:15 am

It works!

The problem was that I uncommented the following lines for debugging purpose and I did not comment them and flash the Arduino again when testing the battery monitor.

Code: Select all

 
//Serial.println(sensorValue); // print out the value you read

//Serial.println(voltage);
I you leave the serial output uncommented, the battery monitor will not work.
Stupid and annoying mistake...

Thanks!

3kidsinaustin
Posts: 27
Joined: Sat Dec 29, 2018 8:21 pm
Been thanked: 7 times

Re: Arduino Leonardo pro micro

Post by 3kidsinaustin » Mon Feb 25, 2019 5:23 am

Glad you figured it out! I had also uncommented those lines to test the output, but remembered to put the hash marks back in before using the battery monitor script. However, plenty of times I have done something similar in another Arduino programs. These darn little computers just take everything so literally!

If you plan to use the Arduino without the mini USB plug, you'll need to solder wires directly to the board components for D+, D- and +5v. There is an image on this site somewhere, but I haven't been able to locate it again. If you cannot find it, just track the traces from the USB lots to each component.

Good luck with your project!
First Build Done! viewtopic.php?f=43&t=7444

McGyver
Posts: 226
Joined: Tue Jan 31, 2017 11:06 am
Location: Tianjin / China
Has thanked: 25 times
Been thanked: 53 times

Re: Arduino Leonardo pro micro

Post by McGyver » Mon Feb 25, 2019 5:33 am

5 volts and ground you can find anywhere on the board.
The data lines usually go to each a 22 Ohm smd resistor. Between usb jack and these resistors is where your usb data wires should go. Take care to measure the continuity after soldering data wires to this resistors since these components or their solder pads do not like to beeing soldered as I figured out and nearly bricked by Adruino boards.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest