Low power, low cost solution for reading LED Pulses - Page 1
Forum section: electronics / projects

author: leeh
author_rank: Newbie
timestamp: August 21, 2017, 06:38:56 am
content: Hi,I have been playing around with options for reading LED meter pulses using a 328P MCU, @ 3.3V. After trying a variety of photodiodes, I settled on LDRs, with an LDR as half of a voltage divider, the other half being a 1M trimpot.I am trying to get a definitive high and low to drive an interrupt (where LOW can be ~< 1V, HIGH is >2V). I get good results in ideal conditions with a wide swing between brightness and darkness (can read 10Hz pulses reliably). Current consumption is a few uA. However in ambient light the voltage range compresses, depending on how I tune the 1M trimpot.So I am looking at low-power options to get a more definitive high/low, such as using a comparator or a FET. With the FET option, I have simulated a circuit in Falstad (after struggling with QUCS) which seems to work except I am struggling to get the current down to < 10uA without using a massive 1M pull-up on the FET's drain, and pull-down on the gate. You can see this in the attached examples, where the LDR is the top resistor (10K light, 4M dark).I think I am doing something daft. Any suggestions to either do this better or minimise current consumption?Should I give up on the FET and use a more $$$ nano-power comparator?Thanks,Lee

author: fourtytwo42
author_rank: Super Contributor
timestamp: August 21, 2017, 09:02:31 am
content: Hi LeeI use a sharp SFH310-2 photo-transistor for this job. To tackle the ambient light issue I painted the whole case black especially around the leads and left a small window at the front, the whole thing is then attached to the meter with plenty of bluetack to provide additional light shielding. I use a ~50K pullup to 5V and a schmitt trigger input on a microcontroller (PIC18F1220) with 10nF to ground to reduce noise (long cable) and it works fineHowever I did have to re-adjust it recently when the led color changed as I started exporting (it thinks it's a fraud lols).Ohh I should mention LDR's can be a bit slow, also here is a recent pic of the SFH310 signalPS just read about your atmega, doesn't seem to have a schmitt input option so you may need to use an external (to the mpu) schmitt gate to condition the signal first (sharpen the edges and add hysteresis).

author: leeh
author_rank: Newbie
timestamp: August 21, 2017, 10:04:57 am
content: Thanks!Re speed, I have found that the LDR works well at 10Hz.What sort of quiescent current consumption are you getting? I am running on batteries so am looking to minimise.I tried the TSL257 and TSL260 phototransistors, but found that they were less sensitive to the red LED than an LDR (despite being in the right spectrum), and consumed ~1mA. Of course there are other phototransistors out there but all the ones I can find have a high quiescent consumption. I also tried a few photodiodes which have minimal current consumption but need amplification etc...I reckon that the LDR will work nicely with a nano power comparator like a TLV3701IDBVT but that seems like using a sledgehammer to crack this nut...

author: fourtytwo42
author_rank: Super Contributor
timestamp: August 21, 2017, 10:31:46 am
content: Ahh I had not realized you were running on batteries!You still have a problem with your chosen MPU whatever the sensor and that is it does not have schmitt inputs.You could use the sensor in analogue mode and sample it with the ADC BUT this will probably consume more power than you are willing to use.A voltage comparator will work but you have to add the additional current from the reference divider to its icc.An alternative is to use an 74AHC1G14 that has a max quiescent of 1uA@5.5V (so less at 3.3V) and doesn't require a reference divider (built in).Of course if you used an MPU with more flexible inputs you would not need anything external.