ESP32 Led Pulse Reader For Energy Meter 3D Printer Model

License: CC BY-SA
File formats: stl,f3d,step
Download type: zip
Size:350.4KB

The file 'ESP32 Led Pulse Reader For Energy Meter 3D Printer Model' is (stl,f3d,step) file type, size is 350.4KB.

Summary

Enclosure for ESP32 dev board and soldered photodiode module. Can be used to count pulses from blinking leds, e.g. from energy or utility meter.

52x28mm dev board fits

Photodiode module is sold in ebay etc, find it with search term "photodiode module"

Reel about the project
https://www.instagram.com/reel/C2LC6u_tiWS/?igsh=MWVmNHF1aDlzM3Z1dQ==

Code for ESPHome

# Energy meter led readsensor:  - platform: pulse_counter    pin: 15    unit_of_measurement: 'W'    name: energymeter_house_power    filters:      - multiply: 60  # (60s/1000 pulses per kWh * 1000 Wh/kWh)    total:      unit_of_measurement: 'kWh'      name: energymeter_house_energy      id: energymeter_house_energy      accuracy_decimals: 2      filters:        - multiply: 0.001  # (1/1000 pulses per kWh)

If you want to store the energy counter value permanently in-device, use the following code

esphome:  name: <your device name>  on_boot:    then:      - lambda: |-          // to re-init, set the meter state here, reflash, then comment it out (in Wh)          //id(persistent_total_pulses) = 210782100;          id(adjust_total_pulses).execute();preferences:  flash_write_interval: 5minscript:  - id: adjust_total_pulses    then:      - pulse_counter.set_total_pulses:          id: energymeter_house_power          value: !lambda 'return id(persistent_total_pulses);'globals:  - id: persistent_total_pulses    type: int    restore_value: yes    initial_value: '0'# Energy meter led readsensor:  - platform: pulse_counter    pin: 15    unit_of_measurement: 'W'    name: energymeter_house_power    id: energymeter_house_power    filters:      - multiply: 60  # (60s/1000 pulses per kWh * 1000 Wh/kWh)    total:      unit_of_measurement: 'kWh'      name: energymeter_house_energy      id: energymeter_house_energy      accuracy_decimals: 2      filters:        - multiply: 0.001  # (1/1000 pulses per kWh)      on_value:        then:          - globals.set:              id: persistent_total_pulses              value: !lambda "return (int)(x*1000);" # need to reverse the filter
meter-led-eye-case8_.stl 15.9KB
meter-led-eye-lid7_.stl 62.6KB
meter-led-eye.f3d 300.1KB
meter-led-eye.step 219.2KB