Eye on the power

I added in the battery level code from https://code.google.com/p/tinkerit/wiki/SecretVoltmeter into my ESP8266 program and it works like a charm. The code uses a reference voltage in the Atmega328p microcontroller to get a reading of Vcc going into the ATmega328p. For the ESP8266 project, that would be the 5v output of the AMS1117 board. In my testing with the dead-ish battery yesterday, I found that the system started to fall apart once it dropped below 5v. The LCD backlight would start flickering and the sending of data seemed to fail more often.

I already have the system sending me emails if it gets bad values from the DHT22 sensor or the ESP8266 fails at sending to both ThingSpeak and my webhost in the same cycle. It was easy enough to add a little more code so it would send me emails at certain voltage levels. I’ve got it sending emails to me when it drops to 5, 4.8, 4.6, and 4.4 volts.

Screenshot_2015-01-24-00-02-03I got this email when I retried the battery for the third time after bringing it in from outside in yesterdays outdoor trial. If I give the battery a rest, it’ll be able to power up the system again but it’ll die after a short period. The lowest threshold email I got was for 4.6v before the battery died again.

I don’t expect this project to go battery powered again but this is definitely something I’m glad I found and I hope it finds a place in other projects.

At this point, I feel like the project is over. It’s been a great learning experience working with two programming languages, my custom PCBs, and seeing the community that has gathered around the ESP8266. It doesn’t have to be over though… Solar power, anyone? Perhaps in the future.

Like I mentioned a couple posts ago, I have other projects coming up, including some experiments with some RF transmitter and receivers, and my custom shift register PCBs that should come in next week if the postal service is consistent with the last two times I ordered from Dirty PCBs.

 Thanks for reading!

2 thoughts on “Eye on the power

  1. Great stuff, i will use some of your ideas in my project. Also, i suggest a pushbullet over email.

    Simple execution from esp8266
    curl -u : -X POST https://api.pushbullet.com/v2/pushes –header ‘Content-Type: application/json’ –data-binary ‘{“type”: “note”, “title”: “Note Title”, “body”: “Note Body”}

    and notification pop-ups on whatever mobile device you have that software installed. Neat stuff.

    Liked by 1 person

    • That’s a good idea. Have you already got Pushbullet working with your project? Feel free to share, I would love to see it.

      I’ve used PHP in the past so it was a nice refresher for me to get the MySQL and mail scripts working. Another thing I was thinking of doing is setting it up to tweet to a Twitter account the daily averages or something like that. I’ve never worked with APIs before so I’m not really used to going through the documentation and knowing what to do with it. I’ve got to get me some more ESP8266 modules to play with!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s