Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Andrew Grande
#40656 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!
User avatar
By martinayotte
#40658 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.
User avatar
By trackerj
#40663 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
You do not have the required permissions to view the files attached to this post.