

Peoplecounter pcb
In my first try I utilised two hc-sr04 ultrasonic sensors, but i quickly realised that their accuracy is horrible.
- Size
- 120 × 50 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 25
- Nets
- 50
- Pads
- 132
- Tracks, vias
- 0, 0
- Routed
- Not yet
- KiCad
- KiCad 7 (file 20221018)
- Created
- 16 Sep 2023
- Updated
- 25 Feb 2024
Overview
Peoplecounter pcb is an open-source printed circuit board by 7omg, from the 7omg/PeopleCounter repository on GitHub. It is a 2-layer board of 120 × 50 mm with 25 parts on 50 nets.
It is built around the ESP32-C3-WROOM-02-H4 and AMS1117-3.3. Its parts include 9 capacitors, 5 resistors, 5 ICs, 4 diodes and 1 connector. It belongs with the ESP32 and RISC-V boards of this library.
Main components
2ESP32-C3-WROOM-02-H4
SMD,20x18mm-105dBm -40℃~+105℃ 2.4GHz 20.5dBm 345mA 3V~3.6V 82mA Bluetooth5.0 ESP32-C3 On-board PCB Antenna UART、SPI、I2C、I2S、USB SMD,20x18mm WiFi Modules ROHSEspressif SystemsWiFi ModulesAMS1117-3.3
SOT-223-40℃~+125℃ 0.003%Vout 1 1.1V@(800mA) 15V 1A 3.3V 5mA 72dB@(120Hz) Fixed Over Current Protection、Short Circuit Protection、Thermal shutdown Positive SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSAdvanced Monolithic SystemsVoltage Regulators - Linear, Low Drop Out (LDO) Regulators
README
README.mdPeople sensor / door sensor project
I needed a sensor which detects if someone or something entered or left a room. as i didn't find anything online i decided to hack together my own little sensor.
In my first try I utilised two hc-sr04 ultrasonic sensors, but i quickly realised that their accuracy is horrible.
Another problem was that using two sensors needs a huge timeout (30-60ms) between their distance measurements, otherwise
they will interfere each other and the results are unusable. They work for applications where things move slow, but
for this project I needed more speeeeed.
So my second thought was that two light barriers would work best. But one light barrier needs two parts. A sender and a receiver. So this is also not the best solution to my problem as I want to mount the sensor on a door frame and don't want cables running all over the door frame.
Then I learned about time-of-flight (tof) sensors. They measure the distance to an object by shooting an infrared light
ray against the object and wait until the light is reflected back into the receiver. So they can essentially act like
a light barrier. I bought two vl53l0x tof sensors for ~8eur, tested them and got to the conclusion that they are
perfect for this application. Not only do they not interfere with each other when relatively close together, these
sensors can also be probed extremely fast. In the fastest mode (continuous back-to-back ranging mode) the sensor has a
measurement ready for use every 20ms. Additionally, I can take measurements from both sensors at the same time. This
adds up to 50 measurements per second, per sensor. This is plenty enough to track a person walking through a door.
Sample schematic

Case

todo
- make project run from batteries
- use deep-sleep mode as tof sensors don't need to probe constantly (wakeup from small ir sensor?)
- wifi stuff
Useful resources
-
esp8266
- exception decoder: https://www.dzombak.com/blog/2021/10/ESP8266-PlatformIO-Serial-Console-Monitoring-with-Exception-Decoding.html
- exception codes/causes: https://www.espressif.com/sites/default/files/documentation/esp8266_reset_causes_and_common_fatal_exception_causes_en.pdf
- pinout: https://cdn.shopify.com/s/files/1/1509/1638/files/D1_Mini_Pinout_Diagram.pdf?5603303439559815202
- board versions: https://docs.wemos.cc/en/latest/d1/index.html
-
hc-sr04 ultrasonic sensor
- explanation of sensor: https://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/
- data sheet: https://docs.google.com/document/d/1Y-yZnNhMYy7rwhAgyL_pfa39RsB-x2qR4vP8saG73rE/edit?pli=1
- NewPing library: https://bitbucket.org/teckel12/arduino-new-ping/wiki
- multiple ultrasonic sensors: https://bitbucket.org/teckel12/arduino-new-ping/wiki/Help%20with%2015%20Sensors%20Example%20Sketch
-
vl53l0x laser ranging sensor
- good explanation of sensor: https://wolles-elektronikkiste.de/vl53l0x-und-vl53l1x-tof-abstandssensoren
- data sheet: https://www.st.com/resource/en/datasheet/vl53l0x.pdf
-
misc
- interrupts/timers: https://randomnerdtutorials.com/interrupts-timers-esp8266-arduino-ide-nodemcu/
- finite state design pattern: https://www.aleksandrhovhannisyan.com/blog/implementing-a-finite-state-machine-in-cpp/#modeling-a-light-switch-in-code
- fsm in c++: https://www.cppstories.com/2023/finite-state-machines-variant-cpp/
Parts
25| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | 1uF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C1, C3, C5 |
| 2 | 100nF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C6, C7 |
| 2 | 4.7uF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C2, C4 |
| 2 | 5k11 | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R2, R3 |
| 2 | VL53L0CXV0DH1 | Sensor_Distance:ST_VL53L1x | U1, U2 |
| 1 | 10uF | Capacitor_SMD:CP_Elec_5x5.3 | C8 |
| 1 | 1M | LED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder | R1 |
| 1 | 22uF | Capacitor_SMD:CP_Elec_5x5.3 | C9 |
| 1 | 5k1 | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R4 |
| 1 | AMS1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U5 |
| 1 | AP2127K-2.8 | Package_TO_SOT_SMD:SOT-23-5 | U3 |
| 1 | D_Schottky | Diode_SMD:D_1206_3216Metric_Pad1.42x1.75mm_HandSolder | D3 |
| 1 | ESP32-C3-WROOM-02 | PCM_Espressif:ESP32-C3-WROOM-02 | U6 |
| 1 | LED | LED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder | D4 |
| 1 | LED_RBGA | LED_SMD:LED_Kingbright_AAA3528ESGCT | D1 |
| 1 | R | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R5 |
| 1 | RED LED | LED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder | D2 |
| 1 | SW_DIP_x01 | Button_Switch_SMD:SW_DIP_SPSTx01_Slide_Omron_A6S-110x_W8.9mm_P2.54mm | SW1 |
| 1 | USB_C_Receptacle_USB2.0_16P | Connector_USB:USB_C_Receptacle_Amphenol_12401610E4-2A | J2 |
Similar boards
- 2 layers60 × 30 mm

- 2 layers79.9 × 36.2 mm

Desk display
nepyope/Project-Homunculus
Project Homunculus is open-source, low-cost hardware for capturing human hand and arm motions. It has two parts.
63 parts51 - 2 layers51 × 71 mm

- 2 layers60 × 100 mm

- 2 layers80.5 × 91.4 mm

- 2 layers38.1 × 49.5 mm

Esp32c3-iot client board
74th/esp32c3-iot-server-board
Board for converting Grove device to IoT Server using ESP32-C3-WROOM-02.
40 parts4MIT - 2 layers56 × 56.5 mm

NX LSM6DS3
Domiko7/NexaSeis
Acquisition and processing server for the NexaSeis collaborative seismic network
25 parts4AGPL-3.0 - 2 layers20 × 24 mm

Desk display
oltdaniel/PCB_deskDisplay
a small esp32-c3 PCB for an I²C display, NeoPixel and Button for smart home stuff.
16 parts3
Questions
How big is the Peoplecounter pcb PCB?
It measures 120 × 50 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Peoplecounter pcb use?
25 parts, built around the ESP32-C3-WROOM-02-H4 and AMS1117-3.3. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Peoplecounter pcb KiCad files?
From the 7omg/PeopleCounter repository on GitHub, at the commit this page was made from: the board is peoplecounter-pcb/peoplecounter-pcb.kicad_pcb and its schematic peoplecounter-pcb/peoplecounter-pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Peoplecounter pcb design in my own project?
Its repository states no licence, so its author keeps all rights: ask 7omg before reusing the design.