-->
Page 1 of 3

Monitor Battery with an Additional AtTiny85

PostPosted: Sun Feb 07, 2016 10:06 pm
by Andrew Grande
Hi Folks,

Would like to validate a design approach. Feel free to tell me I'm nuts and don't make any sense :)

I already have an esp8266 nicely working off a 3.7V 750 mAh LiPo battery. Deep sleep, MQTT and all the goodness. The only catch is it's using esp8266's ADC input for a sensor, and I need more. I'd like to be able to monitor the battery voltage (which wouldn't be a problem otherwise, but my ADC is taken already :( )

Anyway, I was thinking about using an AtTiny85 as an analog port expander. I found dedicated ADC boards, but I don't need 5 more analog inputs and have a bunch of AtTiny85 around already (ADC expanders are more expensive, too).

So I did my research and looks like I could leverage SoftwareSerial between esp8266 and attiny85 (maybe i2c with some libs, but probably an overkill for a simple reading).

Hardware-wise, I'd like to have them both powered from the same battery and go into a deep sleep (for long). One wakes another, but those are irrelevant details at this stage.

Just came across this nice lib https://github.com/cano64/ArduinoSystemStatus . So each on their own, seems to be possible, it's really about making them all work in a single system.

I went through everything I could find on this forum for a similar setup, although often more than I needed. Ideas?

Thanks in advance!

Re: Monitor Battery with an Additional AtTiny85

PostPosted: Sun Feb 07, 2016 10:37 pm
by martinayotte
Your Setup with ATtiny85 seems a bit overkill to get additional ADC.
You can simple add an MCP3008 on an SPI provide by ESP and you get 8 input ADC at more than 75ksample.
There is also some I2C bus ADCs, such MCP3021 or MCP3421 which provide 1 input, 8-to-1 analog multiplexer such CD4051 can be added to them consuming 3 address more GPIOs.

Re: Monitor Battery with an Additional AtTiny85

PostPosted: Sun Feb 07, 2016 11:48 pm
by trackerj
I really don't see either why to bring another MCU in the ecuation, you can use for example a solution similar to this one used for the Battery Monitor System project.

BLMS_1.jpg

Re: Monitor Battery with an Additional AtTiny85

PostPosted: Mon Feb 08, 2016 6:25 am
by eduperez
I thought the ESP could measure the voltage of the battery that feeds it, but I could be wrong.