|
XIAO ESP32C3 |
x 1 | |
|
MQ135 air quality sensor module |
x 1 | |
|
Micro DC Geared Motor 3V-6V |
x 1 | |
|
A1104COMIX(齐心)
|
x 5 | |
|
Resistor 10k +/-1% 0603 100 mW |
x 10 | |
|
L293D |
x 1 |
|
arduino IDEArduino
|
|
|
EasyEdaEasyEda
|
Drowsiness detecting SpongeBob!
Lately, I've noticed that I feel quite drowsy in class. Now I won't blame the lessons for being boring, and since I've been sleeping well at night, that's not the cause either. After doing some research online, I discovered that the drowsiness is probably due to excess carbon dioxide accumulating in the classroom. This makes sense, as the weather has been quite cold recently, and we keep the classroom windows and door closed most of the time. Here's an article I came across if you’d like to know more: https://learn.kaiterra.com/en/air-academy/can-carbon-dioxide-affect-my-sleep
There are CO2 monitoring smart home sensors that display the PPM (Parts per million) levels on an OLED display. But not everyone is tech-savvy enough to understand the ppm levels indicated, and those sensors can be quite expensive.
So, I came up with the idea of building a cool-looking CO2 monitor that is very intuitive to understand! It is basically an artwork of SpongeBob SquarePants (from the good old days!) whose eyelids move up and down to indicate how drowsy he gets based on the CO2 levels. When the CO2 levels are low, his eyes are wide open with his eyelids up. As the level rises, his eyelids gradually lower according to the ppm level. If his eyes are completely shut, it means there's too much CO2 in the room, and you better let some fresh air in!
Working
The main components of this project are the MQ135 air quality sensor and a Xiao esp32 microcontroller. The setup also contains five hall effect sensors, each one mapped to a certain CO2 ppm level. A motor is connected to the microcontroller through an L293D motor driver IC. This motor is a DIY linear motor that moves the eyelids up or down depending on the direction of rotation. The eyelids contain a magnet at the long end that can be detected by the hall sensors.
The microcontroller reads the MQ135 sensor’s analog output and converts them to the CO2 ppm levels with some math. This is done for a specific duration (5 minutes in my code) and the ppm values are averaged for that duration. Then, the microcontroller turns the linear motor on until the magnet is in front of the hall sensor that corresponds to the same ppm (within a tolerance range). This way, the eyelids move to match the ppm level.
Circuit design
The circuit was designed in EasyEda and the PCB was created. Then the Gerber files were generated, and the PCB was manufactured.
Making SpongeBob Squarepants!
For this project, I decided to use Sunboard, a type of low-density PVC board. It's incredibly easy to work with while still being remarkably durable, making it perfect for this kind of craft. I sketched SpongeBob’s design on a piece of A4 printer paper. I then transferred the design onto the Sunboard using tracing paper.
I then cut out some of the holes on SpongeBob’s body from the main 5mm thick Sunboard. For additional details, I created separate circular cutouts from another 5mm thick Sunboard and also cut out the eyes since we will have a separate back section for them.
Finally, I painted everything in SpongeBob’s classic yellow color
Making the linear motor
Linear motors can be quite expensive, so I decided to make one on my own.
To begin with, I selected a long M4 bolt and an accompanying nut. These components form the core mechanism of the linear motor. Using a two-component adhesive, I bonded the bolt head to a gear that fits onto the motor.
Once the adhesive had set, I took a geared DC motor and connected the bolt to its head. With the bolt securely attached to the motor, I powered on the motor. By holding the nut with my fingers to prevent it from rotating, it moved forward or backward depending on the polarity of the motor input.
Modifying the MQ135 sensor
The MQ135 air quality sensor module was used for CO2 detection, and an important component in its functionality is the load resistor, RL. This resistor adjusts its resistance value in response to varying gas concentrations, which is essential for accurate readings. According to the MQ-135 datasheet, the load resistor can have a value ranging from 10KΩ to 47KΩ
For optimal performance, the datasheet recommends calibrating the sensor using 100ppm NH3 or 50ppm alcohol concentrations in the air, suggesting a load resistance (RL) of approximately 20KΩ. However, if you trace the PCB, you’ll find a 1KΩ (102) load resistor in place. To accurately measure CO2 concentration values, it’s necessary to replace this 1KΩ resistor with a 20KΩ resistor. So, I removed the existing 1kΩ resistor and soldered two 10KΩ resistors in series.
Final Assembly
Once the assembled PCBs had arrived, I simply made all the connections based on the labels.
I added a bare USB-C cable to the Xiao and connected to the 5v terminal. All the components were placed behind the SpongeBob body.
Finally, place it inside the IKEA frame and it was done!
You may have noticed something odd. I've used an Esp32 which is a Wi-Fi microcontroller, but this project doesn't use Wi-Fi. Well, the idea is to add some more code to enable tracking the CO2 ppm history in the room and send the data to the phone. This feature is in my to-do list and will be added soon!
Drowsiness detecting SpongeBob!
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(1)
- Likes(4)
- 池昊 PCBWAY品牌部 Oct 24,2024
- El Saeedy Oct 20,2024
- Engineer Oct 08,2024
- Engineer Sep 29,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Arpan 08
-
Build a Walking Robot: Theo Jansen Style 3D Printed Octopod
105 0 3 -
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
137 0 0 -
DIY Laser Power Meter with Arduino
212 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
186 0 2