

EnvMonDev Continuous Power
This project is a device that measures CO2 concentration, temperature and relative humididty using Sensirion's SCD4x sensor and a Raspberry Pi Zero W. The data is then stored internally and, optionally, transmitted via MQTT.
- Size
- 77.1 × 47.9 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 33
- Nets
- 22
- Pads
- 86
- Tracks, vias
- 170, 44
- Pours
- 6
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 3 Nov 2025
- Updated
- 10 Sep 2026
Overview
EnvMonDev Continuous Power is an open-source printed circuit board by msbavaresco, from the msbavaresco/Environmental-Monitoring-Device repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 77.1 × 47.9 mm with 33 parts on 22 nets, routed with 170 tracks and 44 vias.
It is built around the AP63205WU, MCP7940N-I/SN and RSX068MP2STR, with the HV-5RGB25 among its other parts. Its parts include 8 capacitors, 6 connectors, 3 resistors, 3 diodes and 2 ICs. It belongs with the sensors and measurement boards of this library.
Main components
4AP63205WU
TSOT-23-6-40℃~+85℃@(TA) 1 1.1MHz 22uA 2A 3.8V~32V 5V Buck Built-in Fixed Overcurrent Protection、Light load efficient mode、Cycle-by-cycle current limiting、Hiccup current limiting、EMI optimization (spread spectrum) Step-down type Yes TSOT-23-6 DC-DC Converters ROHSDiodes IncorporatedDC-DC ConvertersMCP7940N-I/SN
SOIC-8-40℃~+85℃ 1.2uA 1.8V~5.5V 925nA External I2C Temperature compensation、Backup power management and battery charging、InsideSRAM/NVRAM、Timestamp function、Programmable clock output、Alarm function、Power-off retention of registers、ESD/Overvoltage protection、Periodic interrupt output Yes SOIC-8 Real Time Clocks ROHSMicrochip TechnologyReal Time ClocksRSX068MP2STR
SOD-123FLSchottky DiodesROHM SemiconductorHV-5RGB25
插件-40℃~+80℃ 25mA 25° Common Cathode G:525nm、R:624nm、B:470nm 插件 RGB LEDs ROHSInoluxRGB LEDs
README
README.mdEnvironmental Monitoring Device
This project is an open source environmental monitoring device designed to measure and record CO2 concentration, temperature and relative humidity. It uses a Sensirion SCD4x sensor and a Raspberry Pi Zero W to collect and process the data. This data is then stored locally on the device and can optionally be transmitted via MQTT.
Hardware Requirements
- Raspberry Pi Zero W
- Sensirion SCD4x sensor (SCD40 or SCD41)
- Tactile button
- Common cathode RGB LED
Wiring
The following connections are required for the environmental monitoring device to work. These can be made directly using a Raspberry Pi and the required components, without replicating the PCB.
| Component | Raspberry Pi Pin |
|---|---|
| SCD4x VCC | 3.3V |
| SCD4x GND | GND |
| SCD4x SDA | GPIO2 (Pin 3) |
| SCD4x SCL | GPIO3 (Pin 5) |
| Button | GPIO4 (Pin 7) |
| Blue LED | GPIO14 (Pin 8) |
| Red LED | GPIO15 (Pin 10) |
| Green LED | GPIO17 (Pin 11) |
The button uses the Raspberry Pi's internal pull-up resistor.
The RGB LED colour mapping is based on the actual LED connections rather than the internal pin order of the LED:
- GPIO14 (Pin 8) → Blue
- GPIO15 (Pin 10) → Red
- GPIO17 (Pin 11) → Green
PCB
A custom PCB was designed for this project to integrate the Raspberry Pi, SCD4x sensor, RTC, power management circuit, button and RGB LED. The PCB design files and schematic are included in the repository.
The custom PCB is not required to reproduce the device. If building the circuit without the PCB, follow the schematic for the required connections and components.
Installation
1. Clone the repository
git clone https://github.com/msbavaresco/Environmental-Monitoring-Device.git
cd Environmental-Monitoring-Device2. Install required packages
sudo apt update
sudo apt full-upgrade
sudo apt install -y \
build-essential \
gcc \
g++ \
cmake \
libgpiod-dev \
i2c-tools \
util-linux-extra \
libpaho-mqttpp-dev \
libpaho-mqtt-dev \
nlohmann-json3-dev3. Enable I2C on the Raspberry Pi
Run:
sudo raspi-configThen go to:
Interface Options -> I2C -> EnableReboot:
sudo reboot4. Set up the MCP7940N RTC
Check that hwclock is available:
command -v hwclockYou should see:
/usr/sbin/hwclockCheck that the RTC was detected:
sudo i2cdetect -y 1The address for the MCP7940N should show up as:
0x6fEnable the RTC kernel overlay by editing the Raspberry Pi boot configuration:
sudo nano /boot/firmware/config.txtAdd the following line at the end:
dtoverlay=i2c-rtc,mcp7940xSave and exit nano:
Ctrl + O
Enter
Ctrl + XReboot:
sudo rebootConfirm the RTC device exists:
ls /dev/rtc*You should see:
/dev/rtc0If the Raspberry Pi is connected to the internet, the system time should normally be set automatically using network time synchronisation:
dateIf the date is wrong, set it manually (example):
sudo date -s "2026-09-10 09:50:17"Write the system time to the RTC:
sudo hwclock -wCheck the RTC time is correct:
sudo hwclock -r5. Create the configuration directory
sudo mkdir -p /var/lib/thisdevice6. Copy the example configuration file
sudo cp Source/config/config.example.json /var/lib/thisdevice/config.json7. Edit the configuration file
sudo nano /var/lib/thisdevice/config.jsonExample:
{
"mqtt": {
"host": "localhost",
"port": 1883,
"username": "",
"password": "",
"base_topic": "envmon"
},
"device": {
"location": "Office",
"id": "Sensor1",
"interval_minutes": 15
}
}8. Build the project
mkdir build
cd build
cmake ..
makeYou should get:
envmonitor9. Run the program
To be able to shut down the Pi when pressing the button, the program needs to be executed using sudo:
sudo ./envmonitorHosting an MQTT Server on the Raspberry Pi
If you want the MQTT server to be hosted on the same device, install the Mosquitto broker and clients:
sudo apt install mosquitto mosquitto-clientsMake Mosquitto start running when the Pi boots:
sudo systemctl enable --now mosquittoCheck the status:
sudo systemctl status mosquittoIt should show:
Active: active (running)To verify it is working, open two command prompts. First, the subscriber:
mosquitto_sub -h localhost -t testThen in another command prompt window, the publisher:
mosquitto_pub -h localhost -t test -m "Hello World"To subscribe to the environmental monitoring device:
mosquitto_sub -h localhost -t "envmon/#"To subscribe to all MQTT topics:
mosquitto_sub -h localhost -t "#"Creating a systemd service
By creating a systemd service, the program runs in the background and starts running automatically once the Raspberry Pi boots.
After building the program, copy the executable to /usr/local/bin/:
sudo cp envmonitor /usr/local/bin/envmonitorCreate a new systemd service file:
sudo nano /etc/systemd/system/envmonitor.serviceAdd the following:
[Unit]
Description=Environmental Monitoring Device
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/envmonitor
Restart=on-failure
RestartSec=5
User=root
[Install]
WantedBy=multi-user.targetReload service configurations:
sudo systemctl daemon-reloadEnable the service so that it starts automatically when the Raspberry Pi boots:
sudo systemctl enable envmonitor.serviceStart the program without needing to reboot:
sudo systemctl start envmonitor.serviceCheck if the program is running:
sudo systemctl status envmonitor.serviceThe service should show:
Active: active (running)Reboot the Raspberry Pi:
sudo rebootAfter the Pi starts, check the service status:
sudo systemctl status envmonitor.serviceThe service should show:
Active: active (running)To view the program output via the system journal:
sudo journalctl -u envmonitor.serviceUseful commands
| Command | Action |
|---|---|
| sudo systemctl start envmonitor | Start program |
| sudo systemctl stop envmonitor | Stop program |
| sudo systemctl restart envmonitor | Restart program |
| sudo systemctl status envmonitor | Check status |
| sudo systemctl enable envmonitor | Enable automatic start |
| sudo systemctl disable envmonitor | Disable automatic start |
| sudo journalctl -u envmonitor | View logs |
| sudo journalctl -u envmonitor -f | View logs continuously |
Notes
- The software may need to be adapted if a different LED configuration or GPIO mapping is used.
- The configuration file must exist at
/var/lib/ThisDevice/config.json. - I²C must be enabled for the SCD4x sensor to work.
- Update the MQTT settings and device information in
config.jsonbefore running the program. - The
envmonitorservice runs asrootto allow access to the required hardware interfaces and to perform system shutdown.
Parts
33| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | 100nF 16V | EnvMonDev_Continuous_Power:CAPACITOR-CC0603R | C2, C37, C44, C45, C46 |
| 4 | EnvMonDev_Continuous_Power:STANDOFF-HEX-M2.5 | , , , | |
| 3 | EnvMonDev_Continuous_Power:MOUNTING-HOLE-3.2MM | , , | |
| 3 | 1K | EnvMonDev_Continuous_Power:RESISTOR-RC0603R | R18, R19, R20 |
| 3 | CONNECTOR-MOLEX-KK6373-02 | EnvMonDev_Continuous_Power:CONNECTOR-MOLEX-KK6373-02 | CN2, CN3, CN4 |
| 2 | 100uF 10V | EnvMonDev_Continuous_Power:CAPACITOR-CC1210R | C40, C41 |
| 2 | RSX068MP2STR | EnvMonDev_Continuous_Power:SOD-123 | D16, D18 |
| 1 | 10uF 35V | EnvMonDev_Continuous_Power:CAPACITOR-CC0805R | C34 |
| 1 | 32.768 KHz | EnvMonDev_Continuous_Power:CRYSTAL-3.20X1.50-2P | X1 |
| 1 | 4.7uH 3A | EnvMonDev_Continuous_Power:INDUCTOR-FERRITE-NRS6045T | L5 |
| 1 | AP63205 | EnvMonDev_Continuous_Power:SOT-23-6 | IC9 |
| 1 | CONNECTOR-RECEPTACLE-2X6-P2.54 | EnvMonDev_Continuous_Power:CONNECTOR-RECEPTACLE-2X6-P2.54 | CN6 |
| 1 | HV-5RGB25 | EnvMonDev_Continuous_Power:LED-RGB-D5.00-P1.588-4P | D1 |
| 1 | MCP7940N-I/SN | EnvMonDev_Continuous_Power:SOIC-08-150 | IC4 |
| 1 | POWER BRICK | EnvMonDev_Continuous_Power:CONNECTOR-JACK-J4-HORIZ | CN1 |
| 1 | SENSOR | EnvMonDev_Continuous_Power:CONNECTOR-RECEPTACLE-1X4-P2.54 | CN5 |
| 1 | SWITCH-TACTILE-MINI-VERTICAL | EnvMonDev_Continuous_Power:SWITCH-TACTILE-MINI-VERTICAL | CH1 |
| 1 | ~ | EnvMonDev_Continuous_Power:SOCKET-BATTERY-CR2032 | BT1 |
Similar boards
- 2 layers96 × 57 mm

- 2 layers174 × 97.8 mm

- 4 layers85 × 56 mm

- 4 layers100 × 100 mm

X16fpga
eshankiyer/x16-fpga-board
Commander X16-compatible computer on one 100x100 mm 4-layer board: Spartan-6 + iCE40 (official VERA), SDRAM, two expansion slots. KiCad, JLCPCB fab files, Verilog gateware.
224 parts - 2 layers100 × 100 mm

- 2 layers23.4 × 26.7 mm

- 2 layers94.7 × 71.8 mm

Device Board
WestianPKl/pcb-docs
A collection of custom PCB designs created in KiCAD, centered around the Raspberry Pi Pico (RP2040) platform. Each board is a standalone module that connects to the Main Board and extends its functionality via I2C, SPI…
104 parts - 2 layers28.3 × 14.3 mm

Tap Photosensor PCB
VoronDesign/Voron-Tap
Tap is a nozzle-based z-probe for the V2 and Trident printer designs. The entire toolhead moves to trigger an optical switch. Tap offers many advantages:
18 parts716GPL-3.0
Questions
How big is the EnvMonDev Continuous Power PCB?
It measures 77.1 × 47.9 mm and has 2 copper layers, 1.6 mm thick.
What parts does the EnvMonDev Continuous Power use?
33 parts, built around the AP63205WU, MCP7940N-I/SN, RSX068MP2STR and HV-5RGB25. 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 EnvMonDev Continuous Power KiCad files?
From the msbavaresco/Environmental-Monitoring-Device repository on GitHub, at the commit this page was made from: the board is KiCAD/EnvMonDev_Continuous_Power.kicad_pcb and its schematic KiCAD/EnvMonDev_Continuous_Power.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the EnvMonDev Continuous Power design in my own project?
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).