Posts

ESP32 Web Server - Room Monitoring and Controlling System

Image
Hello! This week's blog is the last blog for my Embedded Systems projects :'( In this post, I will talk about ESP32 Web Server and how to implement it by making a room monitoring and controlling system that can monitor the temperature in the room and turn on or off the cooling fan from a distance by using a browser. First, let's prepare the components you'll need: 1. ESP32 2. Breadboard 3. LED 4. 330-ohm resistors 5. Male-to-male jumpers 6. BMP280 7. Laptop/PC 8. Micro USB This is the circuit I made: Now, make sure you have the right libraries. You can check my blog post when I explained about BMP280 sensor. After you're done installing it, let's follow these steps: 1. Open Arduino IDE 2. Copy this code, but don't upload it yet! You have to make some adjustments that I'll explain below // Load Wi-Fi library #include <WiFi.h> #include <Wire.h> #include <SPI.h> #include <Adafruit_Sensor.h> #include <Adafruit_BMP280.h> #define...

ESP32 Bluetooth Communication

Image
Welcome back to my blog! This week, I'm going to try experimenting with one of the wireless connections, Bluetooth. ESP32 has a built-in Bluetooth feature so we can readily use it. There are two kinds of Bluetooth connections: 1. Bluetooth classic, used for a wireless headset, speaker, or microphone 2. Bluetooth low energy, used for wearable devices such as health band Bluetooth Classic Now, let's experiment with the classic one first! First, you need to prepare a Bluetooth Terminal application for your smartphone. I'm using this Android application called "Serial Bluetooth Terminal" that you can download in Play Store. You also have to prepare the components (you'll use these components for all experiments for this week): 1. ESP32 2. Laptop/PC 3. Micro USB 4. Breadboard 5. Male-to-male jumper 6. LED 7. 330-ohm resistor 8. Smartphone Before starting the project to exchange data, we can test the Bluetooth connection first.  1. Connect ESP32 with a laptop/PC usi...

ESP32 I2C Serial Communication

Image
Welcome back to my blog! This week's project is about serial communication on ESP32, especially I2C. We'll try connecting ESP32 with the BMP280 sensor and OLED Display by this serial communication protocol.  I2C communication protocol uses two wires to share information, one for clock signal (SCL) and one for sending and receiving data (SDA). To connect devices with I2C, you have to know the addresses of its slaves (the devices controlled). It can be usually found on the component's datasheet. To connect multiple I2C devices, you just have to connect both peripherals to the ESP32 SCL and SDA lines and refer to each peripheral by its address in the code. For this project, we'll try to connect BMP280 sensor and OLED Display. These are the components you need to prepare before starting: 1. ESP32 2. OLED Display 3. BMP280 4. Breadboard 5. Male-to-male jumpers 6. Micro USB 7. Laptop/PC Before starting, make sure you've installed the required software like Arduino IDE and...