I want to read the pulse output of an electricity meter marked 5-40 VDC 1000p/Kwh with an ESP32. What do I need to do to protect the ESP32 from over voltage?
Possibly an opto-coupler with an appropriate series resistor for its internal LED.
Sounds like open collector output to me. What do the terminal markings say? Can you post a picture?
Link corrected: https://library.e.abb.com/public/f1db7577ce344f97ac2c5621cc8fd74d/2CMC486001M0201_B_en_C11_User_Manual.pdf
It would appear that this is indeed, an opto-isolator built into the meter, so requiring no additional isolation though you could add a second opto-isolator "just in case".
As it is, you connect it to ground noting the polarity specified, and provide a 2k2 pull-up resistor to 5 V to provide the specified 2 mA bias.
There's a circuit from here that interfaces to a 3.3V Arduino:
Ah, sorry, an ESP32. 3.3 V logic.
OK, as I said, "-" terminal to ground, 2k2 pullup to 5 V on the "+" terminal, then a diode with cathode to the "+" terminal, anode to the ESP32 pin and use INPUT_PULLUP.
Thanks for your input. Never used a opto-coupler before, certainly know a lot about them now.
Thanks, I tried as per the sketch above. It works even if I feed it with the 3.3v from the ESP32.
It probably does. I was just going with the minimum 5 V and 2 mA specified in the datasheet but if it is simply an optocoupler in the device, there is no particular minimum of either.
But which sketch?
For this one on 3.3 V, you do not want the 320 Ω resistor, but put a 10k for protection between the meter device and the ESP input.
I need to read the pulse off as many of these meters as I can from 1 ESP32. Trying with interrupts it works except that I get 280 intterupts for one FALLING of the meter(100ms). Looking for a clean way not to miss interrupts from other pins.
Using 5V supply, voltage divider and hardware debounced ...
So used to solve problems with software that I did not even consider a hardware option. Thanks. Smallest I have is 10uF. Will get some tomorrow.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.