Tuesday, August 30, 2016

Counting Pulses with Maxim DS1682

I am often asked about interfacing the Energy Monitoring system with traditional spinning disk meters or blinking LED/Pulse type meters. For this application there used to be a very nice 1-wire pulse counter IC from Dallas/Maxim - DS2423. However it is end-of-life and no longer available. The next best option is the DS1682/83 series of RC oscillator based elapsed time recorders. The elapsed time function is not critical for pulse counting, however it is a nice feature. The lack of crystal makes is slightly inaccurate, but pretty robust and great for outdoor and industrial applications. It also has an EEPROM to store counted pulses, so the counts are retained across power cycles and the main MCU can sleep between long interval reads.



To test out this chips I built a Grove breakout which I am planning to use with a tipping bucket rain gauge. I have tested it on the ESP8266 with some basic Arduino I2C code and theres seems to be already existing Python code I can extend to use with my Udoo Neo Weather station.


Pulse counting can be easily done using a GPIO and an interrupt, however it requires the MCU to be constantly on. The DS1682 has a 17bit event counter giving it 131,072 total event counting ability before a reset is required.

No comments: