Problem with switching ESP8266 to Wemos D1 mini
Posted: Sat Dec 28, 2019 8:32 am
Hi.
I've made a setup where the impulse led on my powermeter is read by a photodiode and sent to a MQTT broker. This has worked for a few years now. There's a breadboard power supply, an ESP8266, pontentiometer as a pullup-resistor and a SDH300 photodiode. By fine-tuning the pullup I was able to pick out just the blinking of the impulse led and not the daylight surronding the meter. In the loop-code esp continuously checks if digitalRead(2) == LOW. Ie. the photodiode grounds the circuit when ever theres a blink. ESP calculates microsecs between blinks and sends out the data to MQTT server.
Now, something hapenned to my powersupply and the setup broke down. I wanted to switch from ESP to wemos, and not have a separate powersupply. Now basically everything should work as before, right? I put the same code to the new wemos, connected the photodiode and potentiometer. But the problem is that the diode cannot pull down the signal anymore with normal light. I have to dial the potentiometer down and shine a flashlight to the diode to have it trigger the circuit as LOW. If I put a switch to the circuit, it will trigger just fine.. I tried to replace potentiometer with the internal pullup resistor with wemos. Same thing, photodiode cannot pull down the circuit with normal daylight. Tried with different powersupplys (microusb) and even with a new photodiode.
I even tried to reverse the logic. Have the resistor grounded and changed the code to trigger on a HIGH signal. That doesnt work either.
...so, any help is appreciated. Basically the setup is the same, but theres no external powersupply. Dunno if the ground is somehow floating more etc.. Or could the "power" of the photodiode be somehow amplified with a capacitor or something. Final thing, I thought that I can mind as well purchase a "photodiode sensor module" that should work with wemos. But that basically does the same pullup and have it as adjustable, so will that work either?
Cheers,
Janoshi
I've made a setup where the impulse led on my powermeter is read by a photodiode and sent to a MQTT broker. This has worked for a few years now. There's a breadboard power supply, an ESP8266, pontentiometer as a pullup-resistor and a SDH300 photodiode. By fine-tuning the pullup I was able to pick out just the blinking of the impulse led and not the daylight surronding the meter. In the loop-code esp continuously checks if digitalRead(2) == LOW. Ie. the photodiode grounds the circuit when ever theres a blink. ESP calculates microsecs between blinks and sends out the data to MQTT server.
Now, something hapenned to my powersupply and the setup broke down. I wanted to switch from ESP to wemos, and not have a separate powersupply. Now basically everything should work as before, right? I put the same code to the new wemos, connected the photodiode and potentiometer. But the problem is that the diode cannot pull down the signal anymore with normal light. I have to dial the potentiometer down and shine a flashlight to the diode to have it trigger the circuit as LOW. If I put a switch to the circuit, it will trigger just fine.. I tried to replace potentiometer with the internal pullup resistor with wemos. Same thing, photodiode cannot pull down the circuit with normal daylight. Tried with different powersupplys (microusb) and even with a new photodiode.
I even tried to reverse the logic. Have the resistor grounded and changed the code to trigger on a HIGH signal. That doesnt work either.
...so, any help is appreciated. Basically the setup is the same, but theres no external powersupply. Dunno if the ground is somehow floating more etc.. Or could the "power" of the photodiode be somehow amplified with a capacitor or something. Final thing, I thought that I can mind as well purchase a "photodiode sensor module" that should work with wemos. But that basically does the same pullup and have it as adjustable, so will that work either?
Cheers,
Janoshi