Smart Bathroom Solution Design Based on ESP32-C3

Smart Bathroom Solution Design Based on ESP32-C3

Today is also a project sharing from FastBond~

The complete project report has been uploaded to the electronic forest:

https://www.eetree.cn/project/detail/1967

Project Introduction

In the bathroom, multiple functional modules made from ESP32 are arranged, integrating all functional units into Home Assistant. Through the condition settings on Home Assistant, scene judgment can be implemented, and corresponding automated actions can be executed. When someone enters the bathroom and is detected by one of the sensors, the server will cooperate with other distributed sensors to complete scene judgment (whether it is using the toilet, washing hands, or taking a shower) and then perform the corresponding actions. For example, when someone enters the bathroom, the main light and mirror light will turn on; if it detects that someone is using the toilet, it can play some soothing light music while turning off the mirror light, etc.

The scene judgment and execution of this series of actions require multiple sensors and execution units at various locations to work together, but it is not practical to lay a large number of signal lines in the home, and these signal lines are not suitable for long-distance transmission. Therefore, each individual sensor or action unit can be controlled independently by an ESP32 main control, all connected to Wi-Fi, and then integrated in the Home Assistant server, where condition judgments and action commands are sent from the server.

Scheme Block Diagram

First, let me introduce Scheme-it, an online tool released by Digi-Key, which can be used by logging in through a browser without downloading any software. We can draw block diagrams, flowcharts, and other graphics on it, as well as design schematics. Common circuit symbols are readily available in the library, making it very convenient to use. If you want to use some special chips, drawing them yourself is also very simple.

Here is the link to share the schematic and block diagram of this project:

https://www.digikey.cn/schemeit/project/卫生间-ea6e7b4e7c3d4e5583a9e2f7bc7aeafb

The block diagram is as follows:

Smart Bathroom Solution Design Based on ESP32-C3

This project uses three independent modules. To verify whether all series of ESP can be smoothly integrated into the system, I specifically selected three different ESP chips. The module that detects people with sensors is used to sense whether there are people in the bathroom. If someone is detected, it can trigger actions such as turning on the lights; the second sensor is a laser sensor that can be installed near the toilet to detect whether someone is on the toilet, thus determining whether the current scene is using the toilet or just washing hands, triggering different actions accordingly; the third unit can handle both input and output functions, where the button can serve as a manual control input, while the LCD and speaker can be used as output units to observe the current status and execute actions.

Schematic Introduction

In this project, we will make the ESP32-C3 module ourselves, while the other units will be similar and are planned to be purchased as finished development boards. The ESP32-C3 module has many functions, and using it solely for person detection seems a bit wasteful. Therefore, this project will design this module according to the development board’s target, aiming to also make it a universal development board.

The design of the serial port part uses the common CH343P and a two-in-one transistor with a current-limiting resistor built-in to save as much space on the development board as possible.

Smart Bathroom Solution Design Based on ESP32-C3

The MCU part design is relatively simple, just bringing out all the pins.

Smart Bathroom Solution Design Based on ESP32-C3

Power supply part. The power supply uses SPX3819, and unlike most LDOs, this LDO has an additional bypass pin, which can achieve better ripple suppression with a small external capacitor.

Smart Bathroom Solution Design Based on ESP32-C3

Onboard peripherals. First, there are the essential BOOT and RST buttons for the ESP family, used during programming. Note that the C3 is a bit special; the C3’s BOOT is IO9, unlike other ESPs which use IO0. Additionally, since IO2 and IO8 are also boot pins, there will be certain limitations in peripheral use. To avoid waste, we can also design two peripherals for them. IO2 needs an external pull-up, so we designed a five-way switch for the ADC, and IO8 also needs a pull-up, so we designed a WS2812 programming LED. This way, there are simple input and output peripherals onboard, and a standard development board structure is formed.

Smart Bathroom Solution Design Based on ESP32-C3

Finally, bringing out the pins of the ESP32C3 completes the task. The pin order here is completely consistent with the official development board to ensure maximum compatibility. Of course, don’t forget that the C3 has a built-in USB serial port, and we can also bring out the USB serial port.

Smart Bathroom Solution Design Based on ESP32-C3

Device Introduction

ESP32-C3

The ESP32-C3 chip is a 32-bit RISC-V MCU that integrates 2.4 GHz Wi-Fi & Bluetooth 5 (LE).

Smart Bathroom Solution Design Based on ESP32-C3

In this project design, the ESP32-C3-MINI module is used, which integrates the ESP32-C3 chip, a RISC-V 32-bit single-core processor with a clock frequency of up to 160 MHz. It has industry-leading low power consumption and RF performance, with 400 KB SRAM, 384 KB ROM storage space, and supports multiple external SPI, Dual SPI, Quad SPI, and QPI flash.

At the same time, the module has a complete security mechanism: secure boot based on the RSA-3072 algorithm, flash encryption based on the AES-128-XTS algorithm, innovative digital signature and HMAC module, and hardware accelerator supporting encryption algorithms. It also has rich communication interfaces and GPIO pins to support various scenarios and complex applications.

Insights

Through this competition, I was able to bring to life some ideas I had but had been too lazy to act on. I learned a lot during the process and also experienced a lot of joy. I hope there will be more similar activities in the future.
After reading FastBond, let’s take a look at other activities—Funapck Season 3, Episode 1 is currently in full swing!

Smart Bathroom Solution Design Based on ESP32-C3

Funpack Activity Introduction

The Funpack activity is a year-long “play successfully and get a full refund” event initiated by the Hard Grain Academy in collaboration with DigiKey. The third season has six episodes, and every two and a half months, we will launch a development board/instrument kit from a globally top semiconductor manufacturer. If you can play it according to the specified goals within the stipulated time, you can receive generous rewards (in simple terms, complete the task and get the board for free).

Activity homepage:

https://www.eetree.cn/page/digikey-funpack

END

Hard Grain Academy

The Hard Grain team has been dedicated to providing standardized core skills courses for electronic engineers and related students, helping everyone effectively improve their professional capabilities at various stages of learning and work.

Smart Bathroom Solution Design Based on ESP32-C3

Hard Grain Academy

We explore and advance together in the field of electronics

Follow the Hard Grain public account to reach the classroom anytime

Smart Bathroom Solution Design Based on ESP32-C3

Click to read the original text for more

Leave a Comment