Skip to content

Commit

Permalink
fine tuned: ambient light level, PWM signal, LED dimming curve, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bitmagier authored Oct 3, 2024
1 parent fbb4d3f commit dc48f46
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 166 deletions.
71 changes: 36 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
# Sensor Light

A smart light bar — illuminates dark places on-demand by gently dimming up/down a LED stripe depending on the ambient light level and a detected human presence.
_A smart light bar — illuminates dark places on-demand by gently dimming up/down a LED stripe depending on the ambient light level and a detected human presence._

This automatic light is completely self-contained – just needs 12V power supply.
This automatic light is completely self-contained – just needs a suitable 12V power supply.

An advanced but quite cheap presence sensor is used here, which works to my satisfaction. The circuit and software is designed to save power where possible.
An ESP32-H2 SoC low power processor serves for the logic. It is connected to a VEML7700 ambient light sensor and the mentioned small but effective LD2410 radar based presence sensor.
An advanced (and quite cheap) presence sensor is used here, which works to my satisfaction. However, it should be fine-tuned using the manufacturers app at the final location to get the best out of it.

It does NOT need nor use any Wifi / Zigbee / Matter features of the ESP32-H2 SoC. One may feel free to add a Smart Home connector on his own.
The circuit and software is designed to save power where possible.
An ESP32-H2 SoC low power processor serves for the logic. It is connected to a VEML7700 ambient light sensor and the mentioned small but effective LD2410 radar based presence sensor.

_Status: Hardware and Software is feature complete, tested and ready to Roll 'n' Roll._
It does NOT need nor use any Wifi / Zigbee / Matter features of the ESP32-H2 SoC. One may feel free to add some sort of Smart Home connector on his own.

<a>
<img src="hardware/pictures/light_bar_final.png" alt="Light bar sketch" width="600">
</a>
__Status: Hardware and Software is feature complete, tested and ready to Roll 'n' Roll.__

---
## Hardware

<a>
<table style="border-style: none">
<tr>
<th><img src="./hardware/pictures/esp32h2.png" alt="drawing" width="300"/></th>
<th><img src="./hardware/pictures/main_board_complete.png" alt="drawing" width="600"></th>
</tr>
</table>
</a>

### Wiring diagram
<a>
<source media="(prefers-color-scheme: dark)" srcset="hardware/wiring_diagram_dark.svg">
Expand All @@ -41,27 +30,30 @@ Please note:

### Parts

#### LED Bar parts
- ESP32-H2-WROOM-03 (the 2MB flash model is sufficient)
#### LED bar

_Designed for 12V and (up to) 35W LED Stripe._

- ESP32-H2-WROOM-03 _(the 2MB flash model is sufficient)_
- VEML7700 Ambient Light Sensor
- HLK-LD2410 Radar presence sensor (2x)
- BC337-40 TO92 NPN Transistor (2x)
- BC327-40 TO92 PNP Transistor
- IRLB8721PbF N-Channel MOSFET (TO-220)
- Resistor 1 kΩ
- Resistor 10 kΩ (2x)
- Resistor 4.7 kΩ
- Capacitor 0.1 µF (2x)
- Capacitor 1.0 µF
- Resistor 1kΩ
- Resistor 10kΩ (2x)
- Resistor 4.7kΩ
- Capacitor 0.1µF (2x)
- Capacitor 10µF
- 3.3V LDO voltage regulator LD1117V33 (SOT-223)
- Diode (any, working at 3.3 V and 150mA max.)
- 5m LED Stripe
- 5m LED Stripe (12V, 3000-3200k, COB, 8mm wide, power: 5-7 W/m)
- 12V DC Connector
- 12V Power Supply
- 12V, 5A Power Supply _(look for a good one to avoid flickering)_
- Wiring Board
- 4 Pin Connector Mini Socket
- Cables
- 5m LED Housing
- LED Housing (5m)

#### USB Flash Adapter
- USB-C Plug Female
Expand All @@ -88,15 +80,24 @@ After connecting the ESP32-H2 via a flash adapter to a USB computer port:
- `cargo run --release` _(flashes the chip)_
- `espflash monitor` _(optional – see ESP32 console output)_

## References
## Prototype pictures

- [Transistors](http://stefanfrings.de/transistoren/index.html)
- [Switching with transistors](https://dl6gl.de/schalten-mit-transistoren.html)
- [The Rust on ESP Book - Setting Up a Development Environment](https://esp-rs.github.io/book/installation/index.html)
<a>
<img src="hardware/pictures/light_bar_final.png" alt="Light bar sketch" width="600">
</a>

<a>
<table style="border-style: none">
<tr>
<th><img src="./hardware/pictures/esp32h2.png" alt="drawing" width="300"/></th>
<th><img src="./hardware/pictures/main_board_complete.png" alt="drawing" width="600"></th>
</tr>
</table>
</a>

## Terms & Conditions
Feel free to use anything here for learning, building your own version or make a product out of it and sell it.

Feel free to use anything here for learning, building your own version or make a product out of it and sell it.
Have fun!

Pull requests are welcome.
Expand All @@ -105,4 +106,4 @@ _bitmagier, September 2024_

---

_In case you find this work useful and like to support me, I would be delighted to notice a donation in [Solana](https://solana.com/) to: [`FTMfeKYhpVAouuwXjpJXhnT13fkeNJqQsRGMBxBo1GML`](./hardware/pictures/solana_wallet.png)_
_In case you find this work useful and like to support me, I would appreciate a donation in [Solana](https://solana.com/) to: [`FTMfeKYhpVAouuwXjpJXhnT13fkeNJqQsRGMBxBo1GML`](./hardware/pictures/solana_wallet.png)_
Loading

0 comments on commit dc48f46

Please sign in to comment.