Electronic – ESP8266 detect LED flash with photoresistor Schmitt trigger

esp8266light-sensorphotoresistorschmitt-trigger

I made some experiments with ESP8266 to detect when an external LED is on or off (I need to log this activity).
This is the test-circuit I used till now:

schematic

simulate this circuit – Schematic created using CircuitLab

I have a lot of programming experience, but every time I need to deal with the electronics circuits I have some difficulties, so the above schematic may be wrong.
All resistor values are empirically calculated. I used a wave generator (5Hz) to simulate LED flashes, and on the oscilloscope I get:

  • LED on: ~3.22V on (-) OAMP pin
  • LED off: ~1V on (-) OAMP pin
  • On (+) OAMP pin I set ~2V

enter image description here

Now I would ask:

  1. How can I improve this schematic?
  2. How to reduce power consumption?
  3. Does exist a better OAMP (instead of LM358) specifically designed for low power circuits?

Here there're some glabal tech spec:

  • VDD: 3.3V
  • Max led frequency: 2Hz
  • low power consumption
  • I need to measure the time interval between two pulses to detect system (which LED belongs to) state. For example: 1sec between two pulses mean state A, 0.2sec between two pulses mean state B, etc..

NOTE: in the final circuit I cannot interfere with LED and its circuit, I can only watch its light.

Best Answer

how to reduce power consumption? does exist a better OAMP (instead of LM358) specifically designed for low power circuits? Since you are using an op amp as a comparator, a comparator is all that is needed and will save power. Search around to find a comparator that fits your needs, the following are a few examples.

The TI version of the LM358, is spec'd at 0.7ma typical/1.2ma worst case quiescent power supply current.

A LP339 quad comparator (Ti's version) is spec'd at 60ua typical, 100ua worst case. Link: http://www.ti.com/lit/ds/symlink/lp339-n.pdf

Linear Technology has a 0.3uA (typical/quiescent) single comparator, but costs quite a bit more than the LP339. http://www.linear.com/product/LTC1540