I have an external led (color is red) which flash with variable frequency. I need to monitor those flashes, calculating how many time led flash in a minute and log them.

I made a first try with an Arduino + photoresistor + LM358 as comparator (to get ON/OFF signal from photoresistor) and it works.


simulate this circuit – Schematic created using CircuitLab

I use them because I have those components available to make a test, but now I need to create a very small circuit with very low power consumption and wireless connection.


  • microcontroller: ESP8266-01
  • VDD: 3.3V (coin battery)
  • led frequency up to (about) 5Hz

What about the light sensor circuit? What is the best way to simplify it and keep consumption very low?

NOTE: I cannot open/modify the device I need to monitor. The only way to monitor its activity is through led activity

  • \$\begingroup\$ This smells soooo much like an XY problem, what are you really trying to solve? I have never seen an application where monitoring a blinking LED was the proper solution. \$\endgroup\$
    – PlasmaHH
    Commented Jan 18, 2017 at 10:05
  • \$\begingroup\$ What about replacing the LED by an optocoupler, as it includes a LED inside? \$\endgroup\$
    – Edesign
    Commented Jan 18, 2017 at 10:08
  • \$\begingroup\$ I have an electricity meter which flashes an LED once per consumption of somewhere around (I'd guess) 10k Joules. Counting the flashes is intended to be a non-contact way of reading the electricity consumption, there's even a recess around the LED areas designed to hold a companion opto detector. I'll get around to it some time! How long are the flashes? A good way to save power is to sleep most of the time. Is there time to power up the light detector, have it stabilise, go to sleep again for 90% of the time, all within the duration of one flash? You can't open a meter to mess with the LED. \$\endgroup\$
    – Neil_UK
    Commented Jan 18, 2017 at 10:25
  • 1
    \$\begingroup\$ It's similar to what Neil_UK says: I cannot disassembly, modify, etc the device* I need to monitor. The only way is to monitor its activity through reading led activity. Led frequency is not very high, up to about 5Hz (). \$\endgroup\$
    – Noisemaker
    Commented Jan 18, 2017 at 10:42
  • \$\begingroup\$ Led frequency is about 5Hz, but what about the duty cycle? I mean, is it on during 10ms and off during 200ms, or is it 50%-50%? \$\endgroup\$
    – dim
    Commented Jan 18, 2017 at 10:47

1 Answer 1


I've had success with https://github.com/dkroeske/emon-server :

enter image description here

However, I'm using it with a Pi that's wired for power and Ethernet. I've never bothered to measure its power consumption, but if you use a CMOS 555 and get rid of the diagnostic LED it should be fairly low.

You're going to have serious problems running an ESP8266 off coin cells. The transmit power can be several hundred miliamps.

  • \$\begingroup\$ you're right! I didn't take care of transmission power (it send data every 10 minutes). Switching to a 3.7V Li-Ion battery with voltage regulator should work? \$\endgroup\$
    – Noisemaker
    Commented Jan 18, 2017 at 11:31
  • \$\begingroup\$ Yes, that sounds good. I'm not familiar enough with the ESP's programming model to know how it handles sleep, but for best battery life it should be asleep and off the wifi as much as possible. If it's not very good at sleep it may be worth adding a tiny microcontroller just to do the counting and power control for the ESP. \$\endgroup\$
    – pjc50
    Commented Jan 18, 2017 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.