0

I'm making a wireless temperature sensor node using a STM8L101F3 and 2xAAA batteries with low power considerations. The MCU lacks an ADC and to measure battery level I'm thinking about using a few zeners or voltage-reference chips and some digital IO to figure it out. 3 voltage levels have to be measured (over 2.7v, between 2.2v and 2.7v and under 2.2v) and the requirements are as below:

  • IO powered. To overcome power consumption, I'd like to turn on a GPIO, read another digital GPIO and turn it all off; each micro-amp counts. Tri-state IOs are available.
  • Not so precise. 0.1V deviation is well tolerated. hysteresis is optional.
  • TL431(2.5v VREF) and TLV431(1.25v VREF) are preferred; but it's fine if it's possible using simple zeners.
  • Worst-case temperature range is about -20c up to 80c
  • The supply voltage range is about 2v up to 3v based on various battery chemistries.

I tried to do something like this, but got lost into resistor selection : Trial and lots of errors

So is it possible to do that using a few digital-only GPIOs?

Tirdad Sadri Nejad
  • 1,735
  • 1
  • 9
  • 17
  • The STM8L101F3 features two analog comparators, why not just use those? – Brendan Simpson Nov 22 '22 at 21:30
  • @BrendanSimpson that was my previous [question](https://electronics.stackexchange.com/questions/643257/how-to-use-the-ground-referenced-comparator-on-this-microcontroller). – Tirdad Sadri Nejad Nov 22 '22 at 21:32
  • I see, so you're not using a package with that pin exposed. Fair enough. I don't really have a real EE.SE answer to your question, since my suggestion would be to just add an external comparator or an ADC. You can find either in packages like SOT23 which would be lower part count and likely have better performance over temp. compared to a zener/relying on the input threshold of a digital IO. Something like ADC081C021 – Brendan Simpson Nov 22 '22 at 21:35
  • Not an answer to your question, but you could use supervisory circuit IC's. There are some that only draw nanoamps in really tiny packages. – John Birckhead Nov 23 '22 at 14:02

0 Answers0