This is an old revision of the document!
Smart Home Bluetooth System
Student: Ionescu Sergiu, ACES
Code archive:
Presentation:
1. Introduction. Description of the project
The purpose of this project was to make a basic smart home system using wireless communication between the nodes. The architecture is based on the IoT level 4/5. Furthermore, the project constitutes the basics for a bigger future project. I will basically have one node monitoring the living room and one node monitoring the kitchen ( so far ). They will communicate with a gateway node using bluetooth, which is a raspberry pi pico w system at its base. However, the raspberry pi pico was not powerful enough to maintain the control for the entire system…so I needed the help of other 2 picos. In the future I plan to replace the picos with an Intel Nuc or a Raspberry Pi. The data that was collected was stored in a Google Firebase and could be monitorized accesing the database using any PC or using an Android app that I made using MIT APP inventor.
The 2 nodes that are monitoring the rooms have the following utilities :
the kitchen node monitors the temperature, humidity and the level of gas in the room
the living room node monitors the temperature, humidity, light intensity and also can control a LED strip in various ways, including lighting up the strip according to the distance you are at. Also there is another functionality that notifies me whether I got new mail, and it does it by controlling an LED.
2. Hardware components and wiring
The hardware components needed for this project are:
3 x Raspberry Pi PicoW
2 x Arduino Nanos
4 x HC-05 Bluetooth Modules
3 x Breadboard
Jumper wires
220 Ohm and 10 kOhm resistors
LED Strip
Micro and Mini USB data cable
Android Smartphone to run the monitoring application
Sensors
HC-SR04 ultrasonic distance sensor.
DHT11 - temperature and humidity sensor.
TEMT6000 - light intensity sensor.
MQ135 - Gas Sensor
fig.1 Controllers(Raspberry Pi PicoW, Arduino Nano, HC-05 Module)
fig.2 Sensors(HC-SR04, DHT11, TEMT6000, MQ135, LED-Strip)
The electric scheme of the project that I did is the following (done in https://www.circuit-diagram.org/editor/):
Controllers brief overview:
Raspberry Pi PicoW. It is a low-cost, high-performance microcontroller board with flexible digital interfaces. It has a RP2040 microcontroller, Dual-core Arm Cortex M0+ processor, flexible clock running up to 133
MHz, 264kB of SRAM, and 2MB of on-board flash memory, Low-power sleep and dormant modes, 26 × multi-function GPIO pins, 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels, Accurate clock and timer on-chip, Temperature sensor, Accelerated floating-point libraries on-chip, 8 × Programmable I/O (PIO) state machines for custom peripheral support. It works on 3V3 levels.
Sensors brief overview:
HC SR04. It's a device that uses ultrasonic waves to measure distance to an object. It transmites high-frequency sounds and measures the time it takes for the sound to bounce back to the sensor, which is then used to calculate the distance to the object. The sensor consists of an ultrasonic transmitter (Trig pin), a receiver (Echo Pin) and a control circuit. It has an operating voltage of 5V and operating current of 15mA.
DHT11. It's a basic, low cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air. The sensor also includes an 8-bit SOIC-14 packaged IC. This IC measures and processes the analog signal using stored calibration coefficients, converts the analog signal to digital, and outputs a digital signal containing the temperature and humidity. The values are provided through a single-wire digital interface, making it easy to interface it with a microcontroller or other controller circuit. DHT11 can measure temperatures from 0°C to 50°C with an accuracy of ±2°C. In addition, the DHT11 sensor can measure relative humidity from 20 to 80% with an accuracy of 5%. It has an operating voltage from 3V to 5V and operating current of maximum 2.5mA.
TEMT6000. The TEMT6000 is a ambient light sensor which is a small, surface-mount device that detects the intensity of ambient light. It is designed to detect visible light in the range of 390–700 nm, and convert it into an electrical signal output (the S pin). The sensor is based on a phototransistor that changes its electrical resistance based on the amount of light it receives.It is suitable for a variety of applications such as automatic lighting control, display backlight control, and camera light detection. This sensor can handle voltages from both 5V and 3.3V devices.
MQ135. The MQ135 is a gas sensor that is designed to detect a wide range of gases, including ammonia (NH3), sulfur dioxide (SO2), carbon monoxide (CO), and volatile organic compounds (VOCs) in the air. It is based on a metal oxide semiconductor (MOS) that is sensitive to the target gases. The sensor generates an electrical current that is proportional to the concentration of the target gas. The MQ135 sensor can detect gases in a concentration range between 10 to 1000ppm. It is commonly used in air quality monitoring systems, indoor air quality monitoring, and other applications where the detection of harmful gases is important.
3. Software implementation and the overall logic
The implementation consists of 6 main parts :
The monitoring of the first room
The monitoring of the second room
Sending data to the firebase and receiveing it with PICO1
Reading data from the firebase with PICO2 and sending commands with PICO2
Reading data from the firebase with the Android App and sending commands
4. Demonstration
A video demonstrating the functionality of this project can be seen in the video from this archive:
5. Difficulties
6. Overlook and conclusion
The proposed project has reached its goal. I understood how ESP32 board can be used as a web server, and I employed this functionality for creating an interactive and easy way for a user to control multiple LEDs. It could be further improved by adding more security, using a HTTPS connection. Moreover, it could also be scaled up to more complex installations or adding different functionalities such as automatically turning on the LEDs when the light intensity is low and consulting their level of brightness through a web server.
7. Resources