Rainmaker Home Automation System Using ESP32

In this project, we will make an another Home Automation System using ESP Rainmaker and ESP32 Development Board which can be controlled by Google Assistant, Alexa, IR remote and also with manual switches. You can monitor room temperature and humidity as well as realtime feedback through your smartphone from anywhere in world. If there is no internet available, still you can control all appliances via IR remote and manual switches. During this Home Automation series I will add some automations to turn On/Off the relays according to time schedule. For this project I used all the free tools, ESP Rainmaker, Google Assistant, and Alexa.

ESP Rainmaker

We are living in a world which is mostly connected by technology. But the development of the devices is still a challenge. Building a cloud platform from scratch is quite time-consuming and difficult. But using any third-party AIOT does not provide data security and flexibility to all the products. The ESP Rainmaker Home Automation System provides complete flexibility and customizable AIOT products. Rainmaker provides high-performance SOCs and modules and fully fledged cloud deployment through your own account. It supports readymade mobile apps with all common smart home scenarios. It can be controlled with Amazon Alexa and Google Voice Assistant accordingly.

ESP Rainmaker is built on the AWS serverless architecture. Comparing other AIOT platforms Rainmaker can store data in the cloud at a very low cost. You need to add your device to the Rainmaker platform and it easily customizes the device. You can control as many switches or loads as you want.

Must Read Different Types of Home Automation System

Project

Circuit Diagram

Rainmaker Home Automation System Circuit Diagram

Components Required

  • ESP32 Development Board
  • DHT11 Temperature And Humidity Sensor
  • TSOP1838 IR Sensor
  • LDR (Light Dependent Resistor)
  • 5V Relay (x8)/ 8-channel Relay module
  • Green Led (x8)
  • 100 Ohm Resistor (x8)
  • 1K Resistor (x8)
  • BC547 NPN Transistor (x8)
  • IN4007 PN Diode (x8)
  • Push Button/Electrical Switch (x8)
  • +5V/2A Power Supply

About Parts

ESP32 Development Board

ESP32-Development-Board

It is a low-cost, minimal-power system on a microcontroller with integrated Wi-Fi and Bluetooth facility. ESP32 is created and developed by Espressif Systems, a Shanghai-based Chinese company, and it is manufactured by TSMC using its 40nm chip technology. In this project, we can use ESP8266 NodeMCU but there is only one analog pin that comes with it. And ESP32 have so many analog pins. So according to our needs (Voltage and Current), we choose ESP32 in spite of ESP8266 NodeMCU.

DHT11 Temperature And Humidity Sensor

DHT11 Temperature SensorModule

It is a very accurate and low-cost temperature sensor that can measure both the real-time temperature and humidity of your surroundings. The applied supply voltage of this sensor is +5V.

TSOP1738-IR-Receiver

TSOP1838 IR Sensor

TSOP1838 is a type of IR receiver which has an inbuilt amplifier. It acts as a switch and converter. TSOP1838 has three pins, which are GND, VSS, and Output. Its operating frequency is 38 KHz. TSOP1838 is a modified version of TSOP1738, so you can use both of them.

Circuit Connection for Rainmaker Home Automation System

Connect all the switches with the GPIO pins as shown in the circuit diagram. The other ends of the switches are to be grounded. The output pin of TSOP1838 is connected to the D35 pin of the ESP32. The LDR is connected to the D34 pin of ESP32. The data pin of DHT11 is connected to the RX pin. The IN1, IN2, IN3, IN4, IN5, IN6, IN7 and IN8 of the relay module are connected to the D23, D22, D21, D19, D18, D5, D25 and D26 of the ESP32 board respectively. We provide a +5V/2A DC power supply to the ESP32 development board as well as sensors.

PCB Design

After designing the schematic diagram of the home automation system, the assembled components and wiring are too clumsy and unprofessional. In fact, the wiring also has a chance of loose connection. I realised that we need to design the whole system small so that it will fit in the electric box. To give it a clean and professional look I decided to build its PCB prototype using EasyEDA software as it is so simple to use. Now come to the main part, where we need to order our PCB prototype. I always prefer PCBWay for their quality assurance, fastest delivery and also for 24/7 customer support.

Gerber file for Rainmaker Home Automation System Gerber.

You can view the Gerber file here Gerber File Viewer.

Rainmaker Home Automation System 2D View
2D View
Rainmaker Home Automation System 3D View
3D View

Why I Choose PCBWay as My First Preference?

I’ve done several runs with PCBWay and am happy with the results, it’s good quality. The etching, solder mask, and hole sizes are all done well and that is what matters to me. It takes a few hours for a design to get approved and then a couple of days to finish and ship.

With more than a decade in the field of PCB prototype and fabrication, PCBWay has proved its assurance from time to time. They always look at the needs of the customer from different regions in terms of quality, on-time delivery, cost-effectiveness and any other demanding requests. PCBWay is a place that brings manufacturers and customers together. As one of the largest and most experienced PCB manufacturers in China, PCBWay is proud to be the best business partner in any aspect of PCB needs.

Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.

Aspects of PCBWay

High Delivery Rate

In previous years, the on-time delivery rate was 99%. Rather than PCB quality, PCBWay knows that the other most important factor is the shortest possible lead time, which is critical for R&D engineers, especially in the prototyping phase. PCBWay keeps working to ensure PCBs will be delivered to customers as soon as possible and they’re delighted. It takes only 3 to 15 days according to the courier service to deliver your products. After PCBWay moved to the new factory, the production capacity of multi-layer PCB can be as high as tens of thousands of square meters per month. So on-time delay is also reduced for that. They have the “Return and Refund” principle, for every unusable board caused by PCBWay, they will rebuild and refund the order soon.

Quality Assurance

When talking about quality assurance, all the PCB prototypes go through the most stringent tests rather than the basic visual checks. They have most of the testing and inspecting types of equipment used in the PCB prototyping industry, such as Flying Probe Tester, X-Ray Inspection Machine, and Automated Optical Inspection (AOI) Machine.

PCB Prototyping & Manufacturing

PCBWay New solder mask

PCBWay can also make advanced PCBs which are high-quality PCBs and they are recommended for industrial types of equipment, instrumentation, automotive electronics, communication types of equipment, etc. They produce FR-4 and Aluminum boards and advanced PCBs like Rogers, HDI, and Flexible and Rigid-Flex boards, at a very reasonable price. Just check this Instant Quote to order premium PCBs for your hobby projects.

PCBWay different types of solder masks

Previously there have 9 different types of solder masks available in their company. But now recently they have launched extra 4 solder masks that are pink, grey, orange and transparent solder masks.

PCBWay new solder masks 1

Also, there is a piece of great news about the price reduction of PCB prototypes. From 5th August you can now buy 4-layers & 6-layers with upto 20% discounts. As the price dropped, don’t think they will compromise on the quality. Check out the link “4-layer & 6-layer PCBs” where you can find more about it.

PCB Assembly

It not only offers PCB Prototyping but also offers PCB Assembly service. You can order a full PCB board with attached components by uploading your BOM file. SMT & THT assembly starts from only 30$ including free stencil and worldwide shipping. The components can be sourced and provided by PCBWay, or by clients themselves.

There are three types of assembly services:

  • Turnkey where PCBWay supplies all PCB parts.
  • Kitted or Consigned where the customer is responsible for buying and sending all parts to PCBWay.
  • Combo, where the customer supplies some parts and PCBWay, completes the rest.

3D Printing & CNC

It also produces Rapid Prototyping like 3D printing, CNC Machining, Sheet Metal Fabrication, and Injection Molding. The quality of the product is too premium and reliable. And also the best part is that you will receive your order within a minimum of 3 days.

Guide for Ordering PCB from

How To Configure IR Remote With ESP32

First, you have to install the ESP32 board manager.

Click on the “File” from the Arduino IDE. Then click on “Preference”. From the additional board manager, you have to paste this URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json. After that click on “Tools→Board→Boards Manager→Type ESP32 and install.

  • First, you have to upload the code to ESP32 using Arduino IDE and connect the IR receiver data pin with GPIO pin D35.
  • Then open the serial monitor and select the baud rate at 9600.
  • Now start to press all the remote buttons one by one which you want to control the keys and comment down which key is for what hex code.
  • Save all the HEX codes on the notepad.
  • Now you have to update the main code with the HEX codes. You need 8 HEX codes to control 8 relays.

Working Principle of Rainmaker Home Automation System

The working principle of this Rainmaker Home Automation System is too simple. You can control a total of 8 loads with your smartphone, any kind of IR remote and also via manually switches. The Rainmaker application is used here to control all the appliances smoothly. Here we use a DHT11 temperature sensor module to measure real-time temperature as well as humidity. The LDR is used in this project to measure the intensity of light in the room. The ESP32 is connected to a WiFi network as a main hub or controller.

First, get the HEX codes of unused IR Remote buttons. Then update HEX codes in the main code. When WiFi is not connected you can control it with the IR remote and manual switches.

The main work before this project is when the control pins of the relay module receive the LOW signal the relay will turn on and when it receives a HIGH signal it gets turned off (basically it works only for the relay module).

Libraries for Rainmaker Home Automation System

How to Operate Rainmaker to Control Appliances

After uploading the code to the ESP32 development board, you must open the serial monitor. Then press the boot button on the ESP32 board for 4 seconds and you can see the QR code. You just need to copy the link below of the QR code and paste it into the browser.

Now you can see a QR code on your screen. Now scan it with the Rainmaker application. You can download it from the playstore. Before scanning, you have to enable Bluetooth and GPS on your mobile. Then click add device and enter the WiFi credentials. You can see a blue LED glowing on the ESP32. In the rainmaker app, you can see all the switches you connected with the ESP32 board.

Leave a Comment