Buy from US | Buy from UK | Buy from DE | Buy from IT | Buy from FR | Buy from ES | Buy from JP |
In Lesson 2, we learned how to use browser send control signal to a remote Arduino device and turn On/Off an LED. In this lesson, we’ll show how to read remote sensor data to your browser. We will use a photoresistor(light sensor) to read remote environment light value. This is very useful in farms, greenhouses to control the light of plants.
Arduino UNO board x 1
OSOYOO ESP8266 WIFI Shield x 1
Photoresistor sensor Module x 1
USB cable x 1
Jumper wires several
First, please insert the ESP8266 wifi Shield into your UNO board,
Make sure jumper cap connected E_TX to D4 and E_RX to D5.
Connect your Photoresistor with Uno as following diagram,
A couple of notes before you get started:
Arduino UNO Board | Photoresistor sensor module |
A0 | S |
GND | – |
5V | + |
Step A) Install latest Arduino IDE (If you have Arduino IDE version after 1.1.16, please skip this step).
Download Arduino IDE from https://www.arduino.cc/en/Main/Software?setlang=en, then install the software.
Step B) Connect the Arduino UNO board to computer via USB cable,
Step C) Open the Arduino IDE and choose corresponding board type and port type for you project.
Step D)Download the sketch file from : https://osoyoo.com/driver/wifi-iot/lesson3/esp8266-lesson3.zip
Unzip the download file and enter the folder esp8266-lesson3
Step E) Arduino IDE: Click file -> click Open -> choose code “esp8266-lesson2”, load up the sketch onto your Arduino.
In the sketch, find following lines:
char ssid[] = "******"; // your network SSID (name) char pass[] = "******"; // your network password please replace the ****** with your correct wifi SSID and password, otherwise your project can not connect to Internet. Step F) Upload the sketch to your Arduino.
Open your Serial Monitor, you can see your router will assign an IP address to your Arduino as following:
In above example, 192.168.50.9 is the IP address of my Arduino.
Now use another computer or your cell phone’s browser to visit url : http://192.168.50.9
In your photoresistor sensor is exposure under light. Your browser will show following result:
Real time Photoresistor value: 545,47% of maximum sensor value.
1% means the environment is very dark.
DownLoad Url osoyoo.com
viagra otc
WiFi Internet of Things Learning Kit for Learn Coding with Arduino IDE 3: Photoresistor Sensor « osoyoo.com
You must be logged in to post a comment.
Error Correction:
Step E) should direct to open/choose code for “wifi-lesson3” instead of “wifi-lesson2”.
hi, mark.g
you are right. It should be wifi-lesson3 in Step E. We just corrected the tutorial.
Thanks
For Step A, my program result stop as ” You’re connected to the network,press any key in APP to get remote data!”. I can not get the Step A result as you wrote.
My result is as below:
10:15:07.283 -> [Win APP to get remote data!
10:15:08.807 -> [WiFiEsp] Initializing ESP module
10:15:13.526 -> [WiFiEsp] Initilization successful – 1.5.4
10:15:13.590 -> Attempting to connect to WPA SSID: 23SS72BDFGDF
10:15:20.644 -> [WiFiEsp] Connected to 23SS72BDFGDF
10:15:20.678 -> You’re connected to the network,press any key in APP to get remote data!
I can not have IP address and target port mumber. Could you please confirm again that we can really get this result?