Wi-Fi Sensor
About this section, we are showing how to use the Wi-Fi sensor in arduino.
Motivation
In order to send data to firebase, we use Wi-fi sensor to upload it.
Experiments
- Experiment 1: Temperature measuring
- Purpose
- We need to send data from one sensor to another one. We would like to send the Arduino sensor data to Wi-fi sensor, and send the Wi-fi time data to Arduino.
- Method
- We use Arduino TX to send sensor data to Wi-fi RX, then upload data to database. And we use Wi-fi TX to send time data to Arduino RX, then print it on LCD.
- Precaution
- Because we only can send data by byte, so we need to separate the data from one by one. For instance, 25 may be send by 2 and 5. Then merge it on another sensor. For instance, 2 and 5 may merge by 2*10+5=25.
- Result
- We send an array which is 25、26、27 from Arduino to Wi-fi sensor. And we let the Wi-fi sensor Serial to print the data read by byte. Then we merge the data to what it should be originally.
- Materials used
- Arduino UNO
- Wi-fi sensor (NodeMcu)
- Arduino Code
Wiring