In this repository of ESP8266 projects, we will take you through some of the most recommended DIY projects. A very small but highly potent WiFi module, it serves as a one-stop destination for a wide range of IoT based tasks and home automation projects. These projects quite similar to Arduino projects, however, ESP8266 projects are created with built-in WiFi.
Do you know that for a long-time world was unaware of ESP8266’s existence? It was some five years back, developers hit the jackpot named ESP-01 that allowed microcontrollers to get connected with a Wi-Fi network and simplify TCP/IP connection through Hayes-style commands. It has come a long way since then. The projects covered below will give a better insight into how it can perfect the IoT projects around you.
1) ESP8266 Weather Forecaster
How about having a device right next to your doorknob that reminds you of carrying an extra water bottle if temperatures are expected to be higher than normal in your area. We are talking about a simple device that lets you know the weather with a simple change in LED color.
Things you will need
-
- Jumper Wire
- Breadboard
- 4 x Resistors
- 4x LEDs
- ESP8266 12-E
What else will you need?
You will need an Open Weather Map API. The API key can be gained by signing up on the platform. Just get the key, copy it and paste it somewhere. To get information on weather in a selected location, you will have to enter the URL below while entering the location in curly brackets.
http://api.openweathermap.org/data/2.5/forecast?q={your city},{your country code}&APPID={your API Key}&mode=json&units=metric&cnt=2
Copy this URL into the browser and it will provide you with all information needed on the local weather forecast.
Installation of ArduinoJson library
To install the ArduinoJson library you will need to download the file from https://github.com/bblanchon/ArduinoJson/archive/master.zip. Unzip the downloaded folder and you will have the ArduinoJson-master folder. Move it to Arduino IDE installation libraries folder and reopen the Arduino IDE>
Uploading code
Once you have the ESP8266 add-on for Arduino IDE, just go to the tools segment and click on “NodeMCU (ESP-12E Module)”. Copy the code on Arduino IDE and upload the same on ESP8266 board. You will need to add some other details like the country code, city name, password SSID, and Open Weather Map API key in the code. You can check out all the coding details at: https://randomnerdtutorials.com.
Schematics
The given circuit below will give you a fair idea about wiring the circuit.
The final picture should come up something like this
2) BluBug
You may have heard about creating sensor shields, Bluetooth shield, or Wi-Fi shield. BluBug brings all these shields together. It is a consolidated format with a sensor, motor, Bluetooth, Wi-Fi as well as wireless programming shield in a single board. It allows you to control sensor data and check out motors from a distant location online. It eliminates the need to plug Arduino to PC, uploading codes from Arduino IDE over Bluetooth. What’s more, it gets easier since BluBug is loaded with an Android app that monitors robots through virtual joysticks.
Why do you need it?
The list of drawbacks associated with the purchase of different shields for every purpose is unending. An all-in-one solution sounds simple and solves all problems. With BluBug you can wirelessly upload codes from an Arduino IDE over Wi-Fi or Bluetooth (whatever you prefer). It is quite useful when your system has been deployed to some distant location and you aren’t able to afford wires spread all around for monitoring data, debugging, serial monitor, as well as uploading sketches. It also has a provision for connecting servo motors, stepper, DC, AC devices, analog sensors, and so on. There cannot be a better choice for your robotics and IoT projects.
Supplies and components needed
- 1 x Espressif ESP8266 ESP-01
- SparkFun, Step-Up Voltage Regulator – 3.3V x1
- 1x Genuino UNO and Arduino UNO
- 1 x Texas Instruments Dual H-Bridge motor drives L293D
- 1x HC-05 Bluetooth Module
- Soldering Iron
What else can you make with BluBug?
BluBug is perfect for all robotic and IoT projects. It can play a key role in building your own IoT based home automation system for turning on fans and lights in your apartment through your smartphone. It can also help in monitoring soil features like temperature, humidity, moisture, and others for agricultural purposes.
You can find all assembly details for this device at https://create.arduino.cc/projecthub/twob/blubug-83ddbe?ref=tag&ref_id=esp8266&offset=11
3) Hacking PIR Motion sensor with an ESP8266
The project revolves around the modification of a commercial motion sensor through ESP8266 to register data whenever any movement is detected. The data is then sent to Node-RED with MQTT communication protocol. Here the ESP8266 absorbs power via motion sensor phase-out wire with the help of HLK-PM03 AC/DC converter.
Requirements
- 220V PIR Motion Sensor
- ESP8266-01
- ESP8266-01 Serial Adapter
- Small Protoboard
- Raspberry Pi
- 47 uF electrolytic capacitor
- Fuse Slow Blow (200mA)
- Hi-Link HLK-PM03
Overview
It is divided into three different parts:
- Circuit building
- Creating and uploading ESP8266 code
- Creation of Mode-RED flow
Let’s discuss the process step-by-step
- Circuit Building:
To begin with, you will need to get rid of the lid of the PIR motion sensor. You will see three wires: phase-out, phase-in, neutral wire. It is also suggested that you add a slow blow fuse to it just before the HKL-PM03 converter as well as a capacitor to the output. The final assembly will look something like this: - ESP8255 code writing and uploading
For this project, ESp8266 will be programmed with Arduino IDE. You will need to start by installing the ESP8266 add-on. Also, install the PubSubClient library that will help in the creation of MQTT client for basic publishing of messaging with the server. Now, copy the code to Arduino IDE and start making modifications to it. You will need to add your own MQTT broker IP Address, password, and SSID. You can check out the complete coding details at https://randomnerdtutorials.com.
Next, you will need to include your network credentials and finally the MQTT broker IP.
So, how does the code work? It is a simple thing that just publishes a message. Here the LED will light up every single time ESP8266 gets powered up. Once the code has been rectified with needed network credentials, it can be uploaded over the board. You will need an FTDI programmer or a serial adapter for this purpose.
- Node-RED Flow Creation:
Just before you create the flow, You need to install Mosquito Broker, Node-RED Dashboard and Node-RED in Raspberry Pi.
You will next need to import the Node-RED flow from the GitHub repository. This is how the imported flow looks like when it gets the ESP8266 MQQTT logs and messages whenever some movement is felt or identified. You can see the two buttons added for refreshing and clearing the log in the image below.
Node-RED Dashboard
Once the needful changes have been made, just tap on Deploy tab to save the changes. To access your application in the local network you will need to type http://Your_RPi_IP_address:1880/ui
The project helps in hacking a motion sensor and turn it into a smarter one. The HLK-PM03 can be used to power ESP8266 right from the main voltage. Whenever a movement is sensed, the ESP8266 gets powered up and accomplishes the task. It then subscribes the MQTT message for logging the exact time when movement was sensed. Similarly, another code can be written to execute any other requirement.
Final Words
These projects provide a clear glimpse into the potential held by ESP8266. The projects covered here were carefully chosen to showcase the range of tasks covered by this device. There are several other useful purposes served by ESP8266 like building home automation projects, creating a multisensor shield, web servers, DIY Amazon dash button clone, creating your own voltage regulator, door status monitor, and so on. We will talk more about that probably in our next blog.
References
- https://randomnerdtutorials.com/projects-esp8266/
- https://create.arduino.cc/projecthub/projects/tags/esp8266
- https://create.arduino.cc/projecthub/twob/blubug-83ddbe?ref=tag&ref_id=esp8266&offset=11
- https://circuitdigest.com/esp8266-projects
You may also like:
Filed Under: Arduino., Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.