Temperature Detectors | MindPlus Coding Kit for Arduino Started Tutorial E17
Temperature Detectors
1. Learn to use WiFi IoT
2. Easy IoT platform
3. Mind+ IoT communication settings
4. Learn about temperature sensors
5. Send data to Easy-IoT
Key Points Analysis
1. Learn about Temperature Sensor
This is a LM35-based semiconductor temperature sensor that can be used to detect ambient temperature.
Commonly used sensors for temperature measurement include thermocouples, platinum resistors, thermistors, and semiconductor thermometry chip. Among them, thermocouples are often used for high temperature measurement, platinum resistances are used for medium temperature measurement (to about 800 degrees Celsius), and thermistor and semiconductor temperature work within 100-200 degrees Celsius. Among them, semiconductor temperature sensor can be applied with little effort, and demonstrates good linearity and high sensitivity.
LM35 semiconductor temperature sensor is a linear temperature sensor produced by National Semiconductor. The temperature measurement range is -40 ° C to 150 ° C, with sensitivity at 10mV / ° C, and the output voltage is directly proportional to the temperature. The LM35 linear temperature sensor is used in combination with the Arduino dedicated sensor expansion board to facilitate interactions about ambient temperature sensing.
2. Learn to use WiFi IoT
Besides that, the module is designed with easy-to-use Gravity interface and employs UART and I2C communication protocols. You can use it to build IoT applications with other mainboards like micro:bit, Arduino, STM32, etBesides that, the module is designed with easy-to-use Gravity interface and employs UART and I2C communication protocols. You can use it to build IoT applications with other mainboards like micro:bit, Arduino, STM32, etc.
To avoid conflict with other UART devices, I2C mode is recommended.
First, Get to know the WiFi IoT module interface, indicator light, and mode switch function:
· Interface: The WiFi IoT module needs to communicate with the UNO main control board through the two wires of D/R and C/T, that is, the receiving and sending ends.
· Mode Switch: dial to I2C, I2C communication; dial to UART, UART communication
· Status indicator: When Wi-Fi is connected, it is difficult to troubleshoot network problems.
You need to use the indicator’s color to determine the problem.
3. Easy IoT platform
Click IoT.dfrobot.com.cn to enter the EasyIOT platform, register for an account and log in.
· Register and log in
1) Before entering the terminal webpage of Easy IoT, you need to register a personal console monitoring account. Click " Register / Sign In " in the upper right corner.
2) Fill in the personal information, you can register through your personal mobile phone or email.
3) After the registration is successful, log in to your account to enter the workshop, as shown in the figure below. It is a data interface that can communicate with the local device. Click Add New Device to communicate with the device.
· Easy IoT and device communication settings
1) Hover your mouse over New Device and you will see " ". You can change the device name by clicking on it.
2) After adding a new device, a random topic name for the device will be generated. You can click on it and rename the Topic.
3) Click " Send Message " to enter the send message details page
4) Click " View Details " to see the generated icons.
· Others
5) IoT_id(user): ID, which is the user name. Since the ID randomly generated by Easy-IoT are unique, users can communicate with the device based on the IDs.
6) IoT_pwd (password): each username has its own password. Enhance account security protection.
7) Click on the small eye to view or hide the current account name and password.
8) Regenerate: Click to generate new IoT_id and IoT_pwd.
9)Allocated : Each account name enjoys 10,000 free information storage.
Command List
Hands-On
Hardware connection
Programming
1. Write the program
The function we want to achieve is to make the Arduino read the LM35 temperature sensor data and send the temperature data to the IoT device through the WiFi IoT module.
After selecting the master as UNO, click on the Extensions and select the WiFi IoT module at the communication module.
Then we can view the corresponding communication module:
Here, the IoT platform parameters (IoT_id, lot_pwd, Topic) need to exactly match the parameters on the Easy IoT platform. Set the Wi-Fi account and password and connect to the network.
Here, select “hard port” option. Arduino UNO serial communication divides into hard serial and soft serial ports. What do they mean? Hard serial port sets Pin0 for RX and Pin1 for TX by default. However, you can define which Pin is for TX and which pin is for RX -- this is soft serial port. In this project, we use hard serial ports, which are 0 and 1.
Click on the extension and find the relevant function module L35 in the sensor:
2. Reference program
3. Program results
Click EasyIoT to see the details. You can see intuitive charts, the data of which can also be exported in the form of Excel sheets.
4. Troubleshooting
At the beginning, I forgot adding wait time. And temperature sensor also failed to properly read data. EasyIoT details page was flooded by “hello” messages, making temperature data that were properly read later very hard to find. Is the WiFi IoT transmission disconnected? But WiFi IoT’s light has always been green, and everything was OK.
After some efforts, I found that you can select “Clear all messages” at workshop page, and you can set message storage limit at “settings”. With the settings changes, the display problem of temperature data is solved.
Further Reading
Gateways and IoT gateways
What is a gateway?
To walk from one room to another, you have to pass through a door. Similarly, sending information from one network to another must also pass through a "door", which is the gateway. The gateway is also called a network connector and a protocol converter.
What is an IoT gateway?
In the architecture of the IoT, an intermediate device is needed between sensing layer and the network layer, and that is the "Internet of Things Gateway".
The IoT gateway can be used for both WAN and LAN interconnection. In addition, the IoT gateway also needs to have device management functions. Through the IoT gateway device, network operators can manage the underlying sensing nodes, understand the relevant information of each node, and implement remote control.
Further Exercise
Now that you have learned to send local information to the cloud, can you try sending information to your local device?