Climate Station utilizing STM32 with ThingSpeak IoT



Remark errors or corrections discovered for this circuit, and get the prospect to win huge!

It is a easy “Climate Station utilizing STM32 with ThingSpeak IoT” powered by STM32 ARM Cortex (Blue Tablet), this method detects environmental parameters reminiscent of temperature, humidity, and Soil Moisture. DHT11 is a Temperature and humidity sensor that because the identify implies is used to measure the atmospheric temperature and humidity in a selected atmosphere or in a confined closed house and a Soil Moisture Sensor is used to measure the Soil Stage on the Earth.

Now the right way to interface the favored DHT11 Temperature, Humidity sensor, and Soil Moisture Sensor with STM32 microcontroller utilizing Arduino IDE as proven beneath Block Diagram. For many who are new, the STM32 also referred to as the Blue Tablet growth board consists of the STM32F103C8T6 microcontroller from ST Microelectronics. It’s a 32-bit ARM Cortex M3 controller with a excessive clock frequency appropriate for high-speed and energy constraint functions.

Weather Station
Fig. 1: Block Diagram

Development & Working precept

The principle parts used on this venture are

  1. STM32 (Blue Tablet)
  2. DHT11 Sensor
  3. Soil Moisture Sensor
  4. ESP8266 WiFi Module
  5. 16X2 LCD Show

The detailed description of every factor is mentioned right here as follows.

DHT11 Sensor:

The DHT11 sensor is used to measure Temperature and humidity. The sensor comes with a devoted in-built NTC to measure temperature. It has an 8-bit microcontroller on board to output the values of temperature and humidity as serial knowledge by way of the one-wire protocol. This implies, that the sensor has just one knowledge pin by way of which each the temperature and humidity values may be learn, thus saving pins on the microcontroller facet. The sensor can be manufacturing facility calibrated and therefore straightforward to interface with different microcontrollers.

DHT11 Specs:
  1. Working Voltage: 3.5V to five.5V
  2. Working present: 0.3mA (measuring) 60uA (standby)
  3. Output: Serial knowledge
  4. Temperature Vary: 0°C to 50°C
  5. Humidity Vary: 20% to 90%
  6. Decision: Temperature and Humidity each are 16-bit
  7. Accuracy: ±1°C and ±1% as proven beneath in determine 2.
DHT11 Sensor
Fig. 2: DHT11 Sensor

Soil Moisture Sensor:

Soil moisture is principally the content material of water current within the soil. This may be measured utilizing a soil moisture sensor which consists of two conducting probes that act as a probe. It may measure the moisture content material within the soil based mostly on the change in resistance between the 2 conducting plates. The resistance between the 2 conducting plates varies in an inverse method with the quantity of moisture current within the soil as proven in determine 3.

Soil Moisture Sensor
Fig. 3: Soil Moisture Sensor

ESP8266 WiFi Module:

The ESP8266 wifi module is a low-cost standalone wi-fi transceiver that can be utilized for end-point IoT developments. ESP8266 wifi module permits web connectivity to embedded functions. It makes use of TCP/UDP communication protocol to attach with the server/consumer. To speak with the ESP8266 wifi module, the microcontroller wants to make use of a set of AT instructions. The microcontroller communicates with ESP8266-01 wifi module utilizing UART having specified Baud fee (Default 115200) as proven beneath in determine 4.

ESP8266 Wi-Fi Module
Fig. 4: ESP8266 Wi-Fi Module

STM32F103C8T6 (Blue Tablet):

As proven beneath in Determine 5 the actual view of the Blue Tablet Controller. These boards are extraordinarily low-cost in comparison with the official Arduino boards and likewise the {hardware} is open supply. The microcontroller on high of it’s the STM32F103C8T6 from STMicroelectronics. Other than the Microcontroller, the board additionally holds two crystal oscillators, one is an 8MHz crystal, and the opposite is a 32 kHz crystal, which can be utilized to drive the interior RTC (Actual Time Clock). Due to this, the MCU can function in deep sleep modes making it splendid for battery-operated functions.

STM32F103C8T6 (Blue Pill)
Fig. 5: STM32F103C8T6 (Blue Tablet)

STM32F103C8T6 Specs:

The ARM Cortex M3 STM32F103C8 Microcontroller is used within the Blue capsule board. In contrast to the identify, “Blue Tablet” the Microcontroller’s identify STM32F103C8T6 has a which means behind it.

  • STM » stands for the producer’s identify STMicroelectronics
  • 32 » stands for 32-bit ARM structure
  • F103 » stands to point that the structure ARM Cortex M3
  • C » 48-pin
  • 8 » 64KB Flash reminiscence
  • T » bundle kind is LQFP
  • 6 » working temperature -40°C to +85°C

Now allow us to look into the specs of this Microcontroller Desk-1.

Specifications of the STM32 (Blue Pill)
Desk 1: Specs of the STM32 (Blue Tablet)


The working precept of the venture is to measure the climate monitoring parameters constantly and put up all climate monitoring parameters like Temperature, Humidity, and Soil Moisture values on a 16X2 LCD Show in addition to add them right into a cloud platform. Right here I’m utilizing the ThingSpeak IoT Platform to retailer the info in a real-time atmosphere. The circuit Diagram implementation is proven beneath in determine 6.

Schematic Diagram
Fig. 6: Schematic Diagram

The facility requirement of the venture is 5V for STM32 also referred to as Blue Tablet Growth Board 3.3V~3.6V for ESP8266 Wi-Fi Module. Right here I merely transformed 5V to three.6V utilizing a Potential divider circuit, the diodes D3, D4, and 1K ohm Resistor is related in collection kind, and every silicon diode is cutin voltage 0.7V. Right here I’m utilizing two diodes in collection 0.7V+0.7V=1.4V so the overall voltage 5V-1.4V ~=3.6V. the circuit diagram of RPS (Regulated Energy Provide) is proven in determine 7.

Regulated Power Supply (RPS)
Fig. 7: Regulated Energy Provide (RPS)

The best way to add the info in ThingSpeak IoT Platform and registration course of steps as follows

1. Initially, the consumer must Create an Account on, then Signal In and click on on Get Began.

Weather Station

2. Now go to the ‘Channels’ menu and click on on the New Channel possibility on the identical web page for additional course of.

Weather Station

3. Now you will note a kind for creating the channel, fill within the Identify and Description as per your selection. Then fill ‘Temperature’, ‘Humidity’ & Soil Stage in Subject 1, Subject 2, and Subject 3 labels, and tick the examine packing containers for all three Fields. Additionally, tick the examine field for the ‘Make Public’ possibility beneath within the kind, and eventually Save the Channel. Now your new channel has been created.

Weather Station

4. Now click on on the ‘API keys’ tab and save the Write and Learn API keys, right here we’re solely utilizing the Write key. You must Copy this key in char *api_key within the Code.

Weather Station

5. After it, within the sharing possibility, it is advisable to choose the “Share channel view with everybody” within the listing which suggests the channel is configured as a public mode, and the Climate station knowledge can entry wherever on the earth as proven beneath.

Weather Station

Now lastly The captured knowledge Temperature, Humidity & Soil Moisture Sensor knowledge as proven beneath within the figures

The above pictures are taken in System (Desktop or Laptop computer) captured pictures we are able to monitor the info within the system and in addition to android Cell pictures with the assistance of Thingview Android app it’s obtainable within the google play retailer, Right here I’m offering google play retailer hyperlink particularly to observe Climate station knowledge in cellular if you find yourself in outstation or you’re within the journey as proven beneath cellular screenshots.


The best way to Program STM32F103C8T6 STM32 Blue Tablet Board

The STM32 is simply one other microcontroller from the STMicroelectronics household. So all the present strategies to program an ARM chip can be utilized for the STM32 board as properly. One well-known and generally used IDE is the Keil ARM MDK and other than that we are able to additionally use IAR workbench, Atollic TrueStudio, MicroC Professional ARM, Crossworks ARM, Experience 7, PlatformIO+STM32, and many others.

However what made this board so much in style is its capacity to be programmed with the Arduino IDE. This fashion individuals can get began and construct initiatives with STM32 very quickly since many shall be conversant in Arduino IDE and its easy-to-use programming language and available libraries. So on this STM32F103C8T6 Arduino IDE tutorial, we are going to use the Arduino IDE to get began with STM32.

Programming SMT32 by way of Micro USB Board

Now you could be questioning if we’re utilizing the micro-USB port to program the board. Truly, the STM32 Blue Tablet growth board when bought doesn’t include a bootloader to make it Arduino IDE appropriate. Nevertheless, this bootloader may be flashed into the STM32 board, after which the micro-USB port may be straight used to add the applications.

Right here I’ve supplied the Youtube hyperlink

The best way to load Bootloader tutorial Based mostly on this tutorial you’ll simply add Bootloader programming. After profitable completion, you’ll use an onboard micro USB Board.

Getting ready the Arduino IDE for STM32 (Blue Tablet)

Observe the beneath steps to obtain and put together the Arduino IDE for use with the STM 32 Growth board.

Step 1: In case you have not but put in the Arduino IDE, obtain and set up it from this hyperlink. Be sure you choose your appropriate working system.

Step 2: After Putting in the Arduino IDE open and obtain the required packages for the STM32 board. This may be carried out by choosing File -> Preferences.

Step 3: Clicking on Preferences will open the below-shown dialog field. Within the further Boards Supervisor, the URL textual content field pastes the hyperlink and press OK. As proven beneath in determine A.

STM32 JSON link pastes in Arduino IDE Preferences
Fig. A: STM32 JSON hyperlink pastes in Arduino IDE Preferences

Step 4: Now go to Device -> Boards -> Board Supervisor. This may open the Boards supervisor dialog field, seek for “STM32F1” and set up the bundle that seems.

Step 5: After the bundle, set up is accomplished. Go to Instruments and scroll down to seek out the Generic STM32F103C collection as proven beneath. Then be sure that the variant is 64k Flash kind, CPU velocity is 72MHz, and alter the add methodology to Serial as proven beneath in determine B.

STM32F103C Board Selection Process
Fig. B: STM32F103C Board Choice Course of

Step 6: Now, join your Micro USB board to the pc and examine to which COM port the STM32 board is related utilizing the gadget supervisor. Then, choose the identical port quantity in Instruments->Port

Step 7: After all of the modifications are made, examine the underside proper nook of the Arduino IDE and you must discover the next setting being set. My STM32 (Blue Tablet) board is related to COM9 however yours may differ, Now the Arduino IDE is able to program the STM 32 Blue Tablet Growth Boards Lastly the prototype of the venture is proven beneath in Determine C.

Project Prototype
Fig. C: Challenge Prototype



Please enter your comment!
Please enter your name here