Close

PCB Bringup

A project log for Battery powered LED pulse counter

A battery powered WiFi light pulse counter for household energy monitoring.

theoTheo 03/07/2024 at 21:480 Comments

I received the PCBs from JLCPCB which look great, however I have found some issues with the board:

Otherwise the board seems to work, the USB connection for programming works properly.

I have not yet received the phototransistor so that part is not yet tested, but I have flashed an esphome config file and it seems to run as expected.

The PCB includes an NTC for temperature measurement, and also a connection for monitoring the battery voltage. Screenshots show the logging in home assistant of the sensor readings over a few hours. The board can also have applications as a battery powered temperature monitor, for locations without grid power such as the loft or greenhouse.

The current config used for esphome.
esphome:
  name: aaa
  friendly_name: aaa
  on_boot:
    priority: 600
    then:
      - repeat:
          count: 100
          then:
            - output.turn_on: led_output
            - delay: 0.2s
            - output.turn_off: led_output
            - delay: 1s

esp32:
  board: adafruit_qtpy_esp32c3
  framework:
    type: arduino

output:
  - platform: gpio
    pin: 10
    id: led_output
    
sensor:
  - platform: ntc
    sensor: resistance_sensor
    calibration:
      b_constant: 4419
      reference_temperature: 25°C
      reference_resistance: 100kOhm
    name: NTC Temperature
    
  - platform: resistance
    id: resistance_sensor
    sensor: source_sensor
    configuration: DOWNSTREAM
    resistor: 100kOhm

  - platform: adc
    id: source_sensor
    pin: 3
    attenuation: 11dB
    update_interval: 10s

  - platform: adc
    pin: 2
    name: "Battery Voltage"
    update_interval: 10s
    unit_of_measurement: "V"
    attenuation: 11dB

deep_sleep:
  run_duration: 30s
  sleep_duration: 10min

Discussions