© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
DevHeads IoT Integration ServerDIIS
DevHeads IoT Integration Server•2y ago•
6 replies
Camila_99$$

Why Does My ATTiny85 Analog Input Return a Constant Value After 24 Hours?

Hi,

I’m trying to get the value of my battery using an analog input of my ATTiny85 to create a gauge. To do this, I made a voltage divider to avoid draining too much battery. The problem is that I don’t understand why, after letting my project (which includes sensors and a screen) run for more than 24 hours, I’m still getting an input value of 512 with an
analogRead()
analogRead()
.

I haven’t applied any calculations yet, just retrieving the value from my voltage divider. But this value doesn’t budge at all... I’m using a 3.7V 400mAh LiPo battery.

Here’s my schematic.
Solution
Related to that, I would highly recommend using the TinySnore library if you're concerned about optimizing power usage. I used it in another project that uses a CR2016 battery and it's able to run for ~a few weeks using intermittent monitoring of inputs: https://embeddedcomputing.com/technology/processing/chips-and-socs/tinysnore-turns-your-attiny-into-a-low-power-prodigy (granted, my device is just sitting there most of the time)
Embedded Computing Design
TinySnore Turns Your ATtiny Into a Low-Power Prodigy - Embedded Com...
The ATtiny 25/45/85 series is a fantastic little chip, with a low price, flexible voltage input options, and a limited number of IO pins that can be a fun optimization challenge*. It uses a minimal amount of power when compared to something like an Arduino Uno, or certainly a Raspberry Pi, but running an ATtiny constantly will still drain a CR20...
TinySnore Turns Your ATtiny Into a Low-Power Prodigy - Embedded Com...
Jump to solution
DevHeads IoT Integration Server banner
DevHeads IoT Integration ServerJoin
The DevHeads IoT Integration Server accelerates technology engineering by helping pro devs learn, share and collaborate.
2,984Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to optimize resistor values for reading multiple buttons on a single analog input?
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🟩-pcb-and-analog
2y ago
README: PCB & Analog Forum
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🟩-pcb-and-analog
3y ago
Can the analog input port of the Arduino Uno support a negative voltage from -5Vdc to 0Vdc?
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🟩-pcb-and-analog
2y ago
Reviewing My ATtiny85 MIDI Controller with CR2032 Battery: Schematic and Assembly Feedback Needed
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🟩-pcb-and-analog
2y ago