Tumgir
theiotprojects · 3 hours ago
Text
Today’s project is all about ESP32 based Patient Health Monitoring System using MAX30100 Pulse Oximeter sensor, DS18B20 temperature sensor, and DHT22 Temperature & Humidity sensor. This system will monitor the parameters like room temperature, room Humidity, Heart Rate, Oxygen Saturation (Sp02) in blood, and body temperature of patients on the ESP32 Webserver. Overview: ESP32 Patient Health Monitoring System Healthcare technology is very popular in this pandemic situation because of coronavirus. Actually, health care technology is rapidly being revolutionized with the help of the Internet of Things (IoT). Monitoring the health status of a covid patient is a hard task because of our busy schedule and our daily work. Mostly, the elderly covid patients should be monitored periodically. So I thought to make an innovative system in this lockdown to automate the task. This device uses an ESP32 web server to track patient health using this monitoring system. Hence, patient health parameters such as body temperature, heart rate (BPM), blood oxygen levels (Sp02) as well as room temperature and humidity can be monitored from any device (like Smartphone, PC, Laptop, Smart TV,.) That support browsing capabilities. In this project, we will learn how to build an ESP32 based Patient Health Monitoring System. To measure Heart Rate/Pulse (BPM) and Blood Oxygen Level (SpO2), we use the MAX30100 pulse oximeter sensor. Similarly, to measure body temperature, we use the DS18B20 temperature sensor. Meanwhile, the patient is inside the room. So we need to monitor room temperature and humidity level as well. We should keep them in a room with a certain temperature and humidity level to not feel uncomfortable. Hence, we use the DHT22 Temperature & Humidity sensor. Additionally, we have NodeMCU based IoT Health Monitoring webserver which will monitor your patients. Components Required The following are the components required for making ESP32 based Patient Health Monitoring System. All the components are easily available. [table id=38 responsive="scroll"] Circuit Diagram: ESP32 based Patient Health Monitoring System Now let us design IoT Based Patient Health Monitoring with ESP32 Web Server. So the circuit diagram for interfacing MAX30100, DHT22 & DS18B20 with ESP32 is given below. Circuit Diagram of IoT Based Patient Health Monitoring using ESP32 MAX30100 PinsESP32 PinsSDAGPIO21 SCLGPIO22INTGPIO19 Vcc3.3VGNDGNDDS18B20 PinsESP332 PinsVcc3.3VGNDGNDSignalGPIO5DHT22 PinsESP32 PInsVcc3.3VGNDGNDSignalGPIO18  PCB Design & Assembly This circuit requires a custom PCB because the circuit assembled on a breadboard looks messy and isn’t portable too. So, I have designed a custom PCB for this project. The Gerber file for the PCB is given below. You can download the Gerber file and order the PCB online from NextPCB. Download: Gerber File for IoT Based Patient Health Monitoring from the button below. Download Now Now you can visit https://www.nextpcb.com/ and order the PCB. NextPCB is one of the biggest PCB manufacturer companies in China. They offer very good quality PCB at a reasonable price. The PCB quality and finishing are better than all other PCB Manufacturers. Source Code/Program Explanation The Program code for the ESP32 based Patient health monitoring system starts by including the following libraries: WiFi.h and WebServer.h library are used for connecting the ESP32 board to the Wi-Fi network and setting up a webserver. Wire.h library is for communicating any I2C device not just the MAX30100 Pulse Oximeter sensor. MAX30100_PulseOximeter.h for reading BPM and Sp02 from the oximeter sensor. OneWire.h and DallasTemperature.h library for reading data from the DS18B20 temperature sensor.
Finally, DHT.h for grabbing Humidity and Temperature from DHT11/DHT22 sensor. MAX30100 LibraryOneWire LibraryDallas Temperature LibraryDHT Library #include #include #include #include "MAX30100_PulseOximeter.h" #include #include #include "DHT.h" Here we defined the DHT sensor type, its signal pin interfaced with NodeMCU. Similarly, Dallas Temperature DS18B20 sensor pin and reporting period of 1000ms for MAX30100 sensor is also defined. #define DHTTYPE DHT22 #define DHTPIN 18 #define DS18B20 5 #define REPORTING_PERIOD_MS 1000 Five different variables (temperature, humidity, BPM, SpO2, and bodytemperature) are also defined. float temperature, humidity, BPM, SpO2, bodytemperature; Change your WiFi Network Credentials like WiFi SSID and Password here. /*Put your SSID & Password*/ const char* ssid = "Alsan Air WiFi 1"; // Enter SSID here const char* password = ""; //Enter Password here Initialize DHT sensor, Pulse Oximeter sensor, and DS18B20 Dallas Temperature sensor. DHT dht(DHTPIN, DHTTYPE);; PulseOximeter pox; uint32_t tsLastReport = 0; OneWire oneWire(DS18B20); DallasTemperature sensors(&oneWire); Start the webserver on ESP32 module on port 80. WebServer server(80); Begin serial debugging at a baud rate of 115200. Define ESP32 pin (GPIO 19) as output. Test the DHT 22 sensor and connect your microcontroller to the Wi-Fi network. After a successful connection, it will provide your IP address. Finally, Start the HTTP server and Initialize the MAX30100 sensor for testing and print results on the serial monitor. Serial.begin(115200); pinMode(19, OUTPUT); delay(100); Serial.println(F("DHTxx test!")); dht.begin(); Serial.println("Connecting to "); Serial.println(ssid); //connect to your local wi-fi network WiFi.begin(ssid, password); //check wi-fi is connected to wi-fi network while (WiFi.status() != WL_CONNECTED) delay(1000); Serial.print("."); Serial.println(""); Serial.println("WiFi connected..!"); Serial.print("Got IP: "); Serial.println(WiFi.localIP()); server.on("/", handle_OnConnect); server.onNotFound(handle_NotFound); server.begin(); Serial.println("HTTP server started"); Serial.print("Initializing pulse oximeter.."); if (!pox.begin()) Serial.println("FAILED"); for (;;); else Serial.println("SUCCESS"); pox.setOnBeatDetectedCallback(onBeatDetected); pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA); // Register a callback for the beat detection } Request sensor readings from all the sensors using ESP32 and print those five parameters (temperature, humidity, BPM, Sp02, and body temperature) on the serial monitor. server.handleClient(); pox.update(); sensors.requestTemperatures(); float t = dht.readTemperature(); String Temperature_Value = String(t); float h = dht.readHumidity(); String Humidity_Value = String(h); temperature = t; humidity = h; BPM = pox.getHeartRate(); SpO2 = pox.getSpO2(); bodytemperature = sensors.getTempCByIndex(0); if (millis() - tsLastReport > REPORTING_PERIOD_MS) Serial.print("Room Temperature: "); Serial.print(t); Serial.println("°C"); Serial.print("Room Humidity: "); Serial.print(h); Serial.println("%"); Serial.print("BPM: "); Serial.println(BPM); Serial.print("SpO2: "); Serial.print(SpO2); Serial.println("%"); Serial.print("Body Temperature: "); Serial.print(bodytemperature); Serial.println("°C"); Serial.println("*********************************"); Serial.println(); tsLastReport = millis(); } If there is a successful connection, we can send these parameters to the ESP32 local webserver. void handle_OnConnect() server.send(200, "text/html", SendHTML(temperature, humidity, BPM, SpO2, bodytemperature));
void handle_NotFound() server.send(404, "text/plain", "Not found"); Design Web Page with HTML and CSS We start the html code using an html string variable to display patient health monitoring parameters on the webpage dynamically String SendHTML(float temperature, float humidity, float BPM, float SpO2, float bodytemperature) String html = ""; Here, the html web page is made responsive in any web browser. Next, we have some CSS to style the web page’s appearance. html += ""; html += ""; html += "Patient Health Monitoring"; html += ""; html += ""; html += ""; html += ""; html += "body background-color: #fff; font-family: sans-serif; color: #333333; font: 14px Helvetica, sans-serif box-sizing: border-box;"; html += "#page margin: 20px; background-color: #fff;"; html += ".container height: inherit; padding-bottom: 20px;"; html += ".header padding: 20px;"; html += ".header h1 padding-bottom: 0.3em; color: #008080; font-size: 45px; font-weight: bold; font-family: Garmond, 'sans-serif'; text-align: center;"; html += "h2 padding-bottom: 0.2em; border-bottom: 1px solid #eee; margin: 2px; text-align: left;"; html += ".header h3 font-weight: bold; font-family: Arial, 'sans-serif'; font-size: 17px; color: #b6b6b6; text-align: center;"; html += ".box-full padding: 20px; border 1px solid #ddd; border-radius: 1em 1em 1em 1em; box-shadow: 1px 7px 7px 1px rgba(0,0,0,0.4); background: #fff; margin: 20px; width: 300px;"; html += "@media (max-width: 494px) #page width: inherit; margin: 5px auto; #content padding: 1px; .box-full margin: 8px 8px 12px 8px; padding: 10px; width: inherit;; float: none; "; html += "@media (min-width: 494px) and (max-width: 980px) #page width: 465px; margin 0 auto; .box-full width: 380px; "; html += "@media (min-width: 980px) #page width: 930px; margin: auto; "; html += ".sensor margin: 12px 0px; font-size: 2.5rem;"; html += ".sensor-labels font-size: 1rem; vertical-align: middle; padding-bottom: 15px;"; html += ".units font-size: 1.2rem;"; html += "hr height: 1px; color: #eee; background-color: #eee; border: none;"; html += ""; Ajax code makes our webpage dynamic. We don’t need to refresh the page to update data on a webserver. In every second new data is upload to the webserver. //Ajax Code Start html += "\n"; html += "setInterval(loadDoc,1000);\n"; html += "function loadDoc() \n"; html += "var xhttp = new XMLHttpRequest();\n"; html += "xhttp.onreadystatechange = function() \n"; html += "if (this.readyState == 4 && this.status == 200) \n"; html += "document.body.innerHTML =this.responseText\n"; html += ";\n"; html += "xhttp.open(\"GET\", \"/\", true);\n"; html += "xhttp.send();\n"; html += "\n"; html += "\n"; //Ajax Code END Next, heading of the web page is set with some styles that suits our application. html += ""; html += ""; html += ""; html += ""; html += "Health Monitoring System"; html += "https://theiotprojects.com"; html += ""; html += ""; html += ""; html += "Sensors Readings"; html += ""; Different Icon are used for defining the parameters and style the Web Page to Look More Professional. //For Temperature html += ""; html += ""; html += ""; html += " Room Temperature "; html += (int)temperature; html += "°C"; html += ""; html += ""; html += ""; //For Humidity html += ""; html += ""; html += ""; html += " Room Humidity "; html += (int)humidity; html += "%"; html += ""; html += ""; //For Heart Rate html += ""; html += ""; html += " Heart Rate "; html += (int)BPM; html += "BPM"; html += ""; html += ""; //For Sp02 html += ""; html += ""; html += " Sp02 "; html += (int)SpO2; html += "%"; html += ""; html += ""; //For Body Temperature html += ""; html += ""; html += " Body Temperature "; html += (int)bodytemperature; html += "°C"; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; return html; The Program/Source Code for ESP32 based Patient Health Monitoring Web Server is provided below.
To run this program code in your Arduino IDE, you need to install all the required libraries to your Arduino IDE. ESP32 based Patient Health Monitoring System Program Code Before Uploading the Code, don’t forget to change the Wi-Fi Network SSID & Password. // IoT Based Patient Health Monitoring on ESP32 Web Server #include #include #include #include "MAX30100_PulseOximeter.h" #include #include #include "DHT.h" #define DHTTYPE DHT22 #define DHTPIN 18 #define DS18B20 5 #define REPORTING_PERIOD_MS 1000 float temperature, humidity, BPM, SpO2, bodytemperature; /*Put your SSID & Password*/ const char* ssid = "Alsan Air WiFi 1"; // Enter SSID here const char* password = ""; //Enter Password here DHT dht(DHTPIN, DHTTYPE);; PulseOximeter pox; uint32_t tsLastReport = 0; OneWire oneWire(DS18B20); DallasTemperature sensors(&oneWire); WebServer server(80); void onBeatDetected() Serial.println("Beat!"); void setup() Serial.begin(115200); pinMode(19, OUTPUT); delay(100); Serial.println(F("DHTxx test!")); dht.begin(); Serial.println("Connecting to "); Serial.println(ssid); //connect to your local wi-fi network WiFi.begin(ssid, password); //check wi-fi is connected to wi-fi network while (WiFi.status() != WL_CONNECTED) delay(1000); Serial.print("."); Serial.println(""); Serial.println("WiFi connected..!"); Serial.print("Got IP: "); Serial.println(WiFi.localIP()); server.on("/", handle_OnConnect); server.onNotFound(handle_NotFound); server.begin(); Serial.println("HTTP server started"); Serial.print("Initializing pulse oximeter.."); if (!pox.begin()) Serial.println("FAILED"); for (;;); else Serial.println("SUCCESS"); pox.setOnBeatDetectedCallback(onBeatDetected); pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA); // Register a callback for the beat detection void loop() server.handleClient(); pox.update(); sensors.requestTemperatures(); float t = dht.readTemperature(); String Temperature_Value = String(t); float h = dht.readHumidity(); String Humidity_Value = String(h); temperature = t; humidity = h; BPM = pox.getHeartRate(); SpO2 = pox.getSpO2(); bodytemperature = sensors.getTempCByIndex(0); if (millis() - tsLastReport > REPORTING_PERIOD_MS) Serial.print("Room Temperature: "); Serial.print(t); Serial.println("°C"); Serial.print("Room Humidity: "); Serial.print(h); Serial.println("%"); Serial.print("BPM: "); Serial.println(BPM); Serial.print("SpO2: "); Serial.print(SpO2); Serial.println("%"); Serial.print("Body Temperature: "); Serial.print(bodytemperature); Serial.println("°C"); Serial.println("*********************************"); Serial.println(); tsLastReport = millis(); void handle_OnConnect() server.send(200, "text/html", SendHTML(temperature, humidity, BPM, SpO2, bodytemperature)); void handle_NotFound() server.send(404, "text/plain", "Not found"); String SendHTML(float temperature, float humidity, float BPM, float SpO2, float bodytemperature) String html = ""; html += ""; html += ""; html += "Patient Health Monitoring"; html += ""; html += ""; html += ""; html += ""; html += "body background-color: #fff; font-family: sans-serif; color: #333333; font: 14px Helvetica, sans-serif box-sizing: border-box;"; html += "#page margin: 20px; background-color: #fff;"; html += ".container height: inherit; padding-bottom: 20px;"; html += ".header padding: 20px;"; html += ".header h1 padding-bottom: 0.3em; color: #008080; font-size: 45px; font-weight: bold; font-family: Garmond, 'sans-serif'; text-align: center;"; html += "h2 padding-bottom: 0.2em; border-bottom: 1px solid #eee; margin: 2px; text-align: left;"; html += ".header h3 font-weight: bold; font-family: Arial, 'sans-serif'; font-size: 17px; color: #b6b6b6; text-align: center;"; html += ".box-full
padding: 20px; border 1px solid #ddd; border-radius: 1em 1em 1em 1em; box-shadow: 1px 7px 7px 1px rgba(0,0,0,0.4); background: #fff; margin: 20px; width: 300px;"; html += "@media (max-width: 494px) #page width: inherit; margin: 5px auto; #content padding: 1px; .box-full margin: 8px 8px 12px 8px; padding: 10px; width: inherit;; float: none; "; html += "@media (min-width: 494px) and (max-width: 980px) #page width: 465px; margin 0 auto; .box-full width: 380px; "; html += "@media (min-width: 980px) #page width: 930px; margin: auto; "; html += ".sensor margin: 12px 0px; font-size: 2.5rem;"; html += ".sensor-labels font-size: 1rem; vertical-align: middle; padding-bottom: 15px;"; html += ".units font-size: 1.2rem;"; html += "hr height: 1px; color: #eee; background-color: #eee; border: none;"; html += ""; //Ajax Code Start html += "\n"; html += "setInterval(loadDoc,1000);\n"; html += "function loadDoc() \n"; html += "var xhttp = new XMLHttpRequest();\n"; html += "xhttp.onreadystatechange = function() \n"; html += "if (this.readyState == 4 && this.status == 200) \n"; html += "document.body.innerHTML =this.responseText\n"; html += ";\n"; html += "xhttp.open(\"GET\", \"/\", true);\n"; html += "xhttp.send();\n"; html += "\n"; html += "\n"; //Ajax Code END html += ""; html += ""; html += ""; html += ""; html += "Health Monitoring System"; html += "https://theiotprojects.com"; html += ""; html += ""; html += ""; html += "Sensors Readings"; html += ""; //For Temperature html += ""; html += ""; html += ""; html += " Room Temperature "; html += (int)temperature; html += "°C"; html += ""; html += ""; html += ""; //For Humidity html += ""; html += ""; html += ""; html += " Room Humidity "; html += (int)humidity; html += "%"; html += ""; html += ""; //For Heart Rate html += ""; html += ""; html += " Heart Rate "; html += (int)BPM; html += "BPM"; html += ""; html += ""; //For Sp02 html += ""; html += ""; html += " Sp02 "; html += (int)SpO2; html += "%"; html += ""; html += ""; //For Body Temperature html += ""; html += ""; html += " Body Temperature "; html += (int)bodytemperature; html += "°C"; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; return html; Our Pervious projects: IoT Based Pulse Oximeter Using ESP8266 & BlynkMAX30100 Pulse Oximeter Webserver using NodeMCU ESP8266Pulse Oximeter using Arduino & MAX30100Send DS18B20 Temperature data over BLE using NRF24L01 & Arduino Project Demonstration Once the code is uploaded to your ESP32 development board, you can open the serial monitor to see the program into action. The ESP32 will connect to your Wi-Fi Network. Once connected, it will display the ESP32 IP Address. Now, copy the ESP32 IP Address and paste it on your Web Browser. It will display the room temperature, room humidity, Heart Rate, Blood Oxygen Level, and body temperature, etc., as shown in the images below. Similarly, you can monitor your patient’s health from any device that features browsing capability. The below image is the view of the Patient Health Status on Android SmartPhone. You simply need to copy the IP Address and paste it on the browser of any device. Video Tutorial & Guide https://youtu.be/hXDQpHICXEs Conclusion This tutorial shows you how to make a local webserver Based Patient Health Monitoring System Using ESP32 board. I hope this tutorial was interesting to you. If you need any type of help related to this project, then let me know in the comment section below.
0 notes
theiotprojects · a day ago
Text
Welcome to The IoT Projects. In this tutorial, we are going to see a sensor that measures the Temperature and Humidity. We will also interface the DHT-11 Temperature and Humidity Sensor to the Arduino by Programming it. Hence today's topic is all about Interfacing Temperature and Humidity Sensor with Arduino. Interfacing Temperature and Humidity Sensor with ArduinoComponents RequiredDHT-11 PinoutsSchematic of DHT-11 and ArduinoProgramming Sketch/CodesFinal Sketch/CodesVideo TutorialsConclusion Components Required Arduino UNODHT-11 Temperature and Humidity SensorJumper wires DHT-11 Pinouts This is the sensor that we are going to use in this tutorial. Its name is DHT-11, It can give the temperature and Humidity using one wire called Data. The power supply pin(VCC) can be connected to the range of 3.5 to 5 volts. DHT-11 Temperature and Humidity Sensor Pinouts Schematic of DHT-11 and Arduino Actually, the connection in this tutorial is very simple because there are only three wires that are VCC, GND, and Data. Circuit Diagram of Interfacing DHT-11 to the Arduino Connect the Ground(GND) of the Arduino board to the GND pin of the ArduinoNow, connect 5 volts to the VCC pin.Finally, connect the pin number 2 of the Arduino board to the Data Pin of the DHT-11 Sensor. Programming Sketch/Codes Now, let's program the Arduino board using this sketch. But, before that let me explain these few lines of codes. So that it will be easier to understand the codes. As we are using the DHT library. The header file has to be included. So open the tools menu and upload the library file. #include Download SimpleDHT Library A variable called "pinDHT11" is declared with a value 2 as the pin of the Arduino board where the Data pin is connected to. // for DHT11, // VCC: 5V or 3V // GND: GND // DATA: 2 int pinDHT11 = 2; The next variable called "dht11" of type "simpleDHT11" is declared to handle the communication with the sensor. SimpleDHT11 dht11; Inside the function setup() the serial interface is initialized with 9600 as the baud rate. void setup() Serial.begin(9600); Every time that we send the information to the computer. we will start with a separation line and the text "Sample DHT11..." Serial.println("Sample DHT11..."); Here, we have declared 3 variables, an array of 40 elements called "data" that will hold the raw data from the sensor. And the variables "temperature" and "Humidity" for the values of measured magnitudes. // read with raw sample data. byte temperature = 0; byte humidity = 0; byte data[40] = 0; The function "read" is called with the pin "pinDHT11" and a reference to the variable "Temperature", "Humidity" and the "Data" array. How these variables are going to be populated inside the function. Basically, the passing has to be done by reference (&). The data array is already a reference and does not need &. The "read" function will return a 0. If everything went well. if (dht11.read(pinDHT11, &temperature, &humidity, data)) { The 40 bits received from the sensor are sent to the PC. Serial.print("Sample RAW Bits: "); for (int i = 0; i < 40; i++) { Serial.print((int)data[i]); if (i > 0 && ((i + 1) % 4) == 0) Serial.print(' '); Finally, the Temperature in (Celsius) and Humidity in (Percentage) are sent. Serial.print((int)temperature); Serial.print(" *C, "); Serial.print((int)humidity); Serial.println(" %"); Under the loop function, we added a 1-sec delay. Therefore, we sent the data every second. delay(1000); Final Sketch/Codes //https://theiotprojects.com/ //2020.2.29 #include // for DHT11, // VCC: 5V or 3V // GND: GND // DATA: 2 int pinDHT11 = 2; SimpleDHT11 dht11; void setup() Serial.begin(9600); void loop() // start working... Serial.println("================================="); Serial.println("Sample DHT11..."); // read with raw sample data.
byte temperature = 0; byte humidity = 0; byte data[40] = 0; if (dht11.read(pinDHT11, &temperature, &humidity, data)) Serial.print("Read DHT11 failed"); return; Serial.print("Sample RAW Bits: "); for (int i = 0; i < 40; i++) Serial.print((int)data[i]); if (i > 0 && ((i + 1) % 4) == 0) Serial.print(' '); Serial.println(""); Serial.print("Sample OK: "); Serial.print((int)temperature); Serial.print(" *C, "); Serial.print((int)humidity); Serial.println(" %"); // DHT11 sampling rate is 1HZ. delay(1000); Video Tutorials https://youtu.be/6XPNOlQxc3w Conclusion Finally, we have completed Interfacing Temperature and Humidity Sensor with Arduino. Now, you can see the temperature and Humidity from the Serial Monitor. We hope you found this project useful!&nbsp;Drop a comment below if you have any doubts or queries. We’ll do our best to answer your questions.
0 notes
theiotprojects · 2 days ago
Text
Today's world is adopting new working technology to make human tasks faster and easier. Yes! Now we're going to discuss one of those technologies, the Internet of Things (IoT) and Industrial Internet of Things (IIoT). IoT vs IIoT and Some IoT ProtocolsWhat is (IoT) Internet of Things?What does a Thing Mean in IoT?Protocols used in IoTBluetoothWiFiZigBeeMQTT IoTCoAPDDSNFCIoT vs IIoTThe difference between IoT and IIoTConclusion on IoT vs IIoT What is (IoT) Internet of Things? The Internet of Things, or IoT, is a system of built-in computer devices, mechanical and digital machines, objects, animals, or persons that provided with unique identifiers. They have the ability to transfer data over a network without any interaction between human-to-human or human-to- Computer. What does a Thing Mean in IoT? A Thing on the Internet of Things could be a patient heart monitor implant, a farm animal with a biochip transponder, a vehicle with built-in sensors to alert the driver when the tire pressure is low, or some other natural or man-made object that can be assigned an Internet Protocol (IP) address and is capable of transferring data over a network. Recommended Reading: Top 10 Coolest IoT Devices of 2020 Protocols used in IoT Nowadays, we can collect, send, and process data on other servers and other applications by collecting a range of objects around. The IoT protocol is a system that transfers data online. But it transfers data only when the communication network between the two connected devices is secure. We can divide the Internet of Things protocol into two basic types: IoT Network Protocols and IoT Data Protocols. Bluetooth Bluetooth is one of the most widely used short-range wireless technologies. You can quickly get Bluetooth apps that provide you with wearable technology for pairing with smart gadgets. Among the IoT protocols the most recently introduced Bluetooth protocol is BLE or Bluetooth low-energy protocol. It carries the range of traditional Bluetooth with low power consumption supremacy Standard: Bluetooth 2.2 core specificationFrequency: 2.4GHz (ISM)Range: 50-150m (Smart / BLE)Data rates: 1Mbps (smart / BLE) WiFi For IoT integration, WiFi is a favorable option according to many electronic designers. This is because of the infrastructure that it causes. It has a fast data transfer rate with the ability to control a large amount of data. Standard: Based on 802.11n (commonly used in homes today)Frequencies: 2.4GHz and 5GHz bandsRange: about 50mData rates: M00 Mbps max, but 150-200 Mbps is more specific, based on channel frequency used and number of antennas (current 802.11-AC standard should offer 500Mbps-1Gbps) Note: This IoT protocol has its drawbacks that can consume excessive power for IoT application ZigBee Like Bluetooth, there is a huge user base of ZigBee. On the Internet of Things protocol, ZigBee is designed for more industrial and fewer consumers. It typically operates at a frequency of 2.4GHz. This is ideal for industrial sites where data is usually transferred between homes or buildings at small rates. ZigBee and the popular ZigBee Remote Control are popular as well-known IoT security protocols for supplying secure, low-power, scalable solutions with high node calculations. ZigBee 3.0 takes the protocol to a single standard. Standard: ZigBee 3.0 is based on IEEE802.15.4 Frequency: 2.4GHzRange: 10-100 metersData rates: 250kbps MQTT IoT MQTT IoT is a messaging protocol and full form Message Queue Telemetry Transport. MQTT's main task is to get data from multiple electrical devices. It works on top of TCP for providing reliable but simple streams of data. This MQTT protocol is made up of three core components or mechanisms: Subscribers/Members, Publishers, and Brokers. The work of the publisher is generating data and transmitting the data to the client with the help of the broker. It is the job of the broker to ensure security. It does this by checking and verifying the authenticity of Subscribers and publishers.
CoAP COAP is designed to enable simple, constrained devices to join IoT through constrained networks, including low bandwidth and low availability. It is commonly used for machine-to-machine (M2M) applications such as smart energy and building automation. CoAP or constrained application protocol, Internet productivity, and utility protocol are primarily developed for restricted smart gadgets. CoAP is designed to be used between similar devices that have a similarly restricted community. It includes common nodes and devices on the Internet and various restricted networks and devices that are connected to the Internet. DDS Among the Internet of Things protocols, the IoT messaging protocol - DDS or Data Distribution Service - is a standard for high-performance, scalable, and real-time machine-to-machine communication. Data Distribution Service -is Developed and designed by DDA and OMG or Object Management Group. With the help of DDS, you can transfer data through both low-tracking devices and cloud platforms. Data Distribution services involve two important layers. These are DCPS and DLRL. DCPS or Data-centric publish works by providing information to subscription customers. DLRL or Data Local Reconstruction Layer does its job by providing an interface to the data-centric public membership functionality. NFC NFC or Near Field Communications allows customers to connect to electronic devices, use digital content, and make contactless payment transactions. The essential task of the NFC is to expand the "contactless" card technology. It works between 4cm (between devices) by enabling the devices to share information. IoT vs IIoT The Internet of Things brings the physical world into the digital world, expanding in detail what information technology can achieve. By connecting digital assets to the digital realm using sensors and actuators, we can electronically monitor and manage our 'things'. IIoT is the Industrial Internet of Things - it applies IoT technology to the construction industry. Also known as the Industrial Internet, IIoT focuses on improving connectivity, efficiency, scalability, time savings, and cost savings for industrial organizations, and will sometimes be used in conjunction with Industry 4.0 The difference between IoT and IIoT S.NIoT (Internet of things)S.NIIoT (Industrial Internet of Things)1Served applications can be used in all IoT verticals. This means the IoT is used not only in industrial applications but also in personal or research-oriented cases.1IIoT cannot be used in all verticals. Moreover, it means Industrial IoT is an industry application-specific platform.2Sensors used in IoT Ultimately, sensors can be of any type. For example Soil moisture, Motion Sensor, heart rate monitoring, gas sensors, or any other sensors that can be accessed through the cloud. 2The sensors used in industrial IoT are the sensors that are most often used in various industries. For example instance heat, temperature, flow, air, light, vibration, and pressure sensors.3The most common type of cloud technology used in IoT is the public cloud.3But, industrial IoT uses the private cloud. By comparison, IIoT is safer than IoT.4Cybersecurity IoT is not much more secure than industrial IoT. In other words, IoT is mostly used as open access. 4Moreover, industrial IoT maintains very strong cybersecurity. IIoT has been implemented in a very important area of ​​the industry.5Operation Safety is not always very high in IoT. 5Industrial IoT operation Safety is the most important thing. While the lack of safety measures leads to explosion/property damage / human death.6For example, we use IoT in agriculture or healthcare or banking. 6For example, IIoT can be used in the oil or gas sector within a particular industry. Conclusion on IoT vs IIoT The term IoT refers to the connection of devices (things) over the Internet so that they can collect and share data without human assistance. The Industrial
Internet of Things (IIOT) refers to the use of Internet of Things (IoT) technology in manufacturing and related industries such as agriculture, gas and oil, utilities, and transportation to build smart, self-regulating systems. IIoT is Opening a new era of economic growth and competitiveness, it will transform companies and countries. We look to the future where the intersection of people, data, and intelligent machines will have an impact on the productivity, efficiency, and operation of industries around the world. Recommend Readings: Top 10 IoT (Internet of Things) ProjectsIoT Based LED Control using Google Firebase & ESP8266Interfacing PIR Sensor with ESP8266 and EasyIoTIoT Based Patient Health Monitoring System Using ESP8266/ESP32 Web ServerFire Security System using Arduino & Flame SensorTemperature Controlled Home Automation using ArduinoESP8266 Plot Sensor readings to Webserver in Real-Time ChartIoT Web Controlled Smart Notice Board using NodeMCU ESP8266Home Automation with MIT App Inventor and ESP8266
0 notes
theiotprojects · 3 days ago
Text
Overview: BME680 IAQ Monitoring on ESP32 Webserver In this project, we will monitor the BME680 Indoor Air Quality Monitoring with the ESP32 webserver. We will use the advanced BSEC library for BME680 and monitor its parameters including IAQ on a webserver. So, that you can monitor the sensor values remotely from your local network.&nbsp; In our previous projects, we have interfaced Arduino with an integrated BME680 Environmental Sensor. Further, we made a BME680 based Indoor Air Quality Monitoring system with esp8266. This could calculate the IAQ value, i.e. Index of Air Quality, C02 equivalent, and percentage of (VOC) Volatile Organic Compound, and measure the environmental parameters like temperature, humidity, pressure, and altitude. So in this tutorial, we will use a highly advanced BME680 Library called the BSEC library, which is now supported by NodeMCU ESP8266 and ESP32 Development Board. With the help of this library, we can measure the Temperature, Humidity, Pressure, value of IAQ, equivalent carbon dioxide, and Total volatile compound. ESP32 web server is used to monitor environmental data remotely. The ESP32 connects to your Local Wi-Fi network & uploads the data regularly to the webserver. Components Required The list of components we need to make this Local Area-based IAQ monitoring project can be found below. You can purchase all the components from the Amazon links. [table id=39 responsive="scroll"] BME680 Environmental Sensor The BME680 is a digital 4-in-1 sensor that can measure gas, humidity, pressure, and temperature measurement based on proven sensing principles. It is the upgraded version of its previous sensors like BMP180, BMP280, or BME280. The gas sensor on the BME680 can detect a wide variety of volatile organic compounds (VOCs) to monitor indoor air quality. The sensor has high linearity and high accuracy. The sensor operates from 1.7V to 3.6V. The standby power consumption of this module is 0.29 to 0.8 uA and while in sleep mode the power consumption is between 0.15 to 1 uA. SensorAccuracyOperation RangeTemperature+/- 1.0ºC-40 to 85 ºCHumidity+/- 3%0 to 100 %Pressure+/- 1 hPa300 to 1100 hPaAltitude+/- 1 M0 – 30,000ft BME680 can measure the Air quality index (IAQ) from 0 to 500 PPM. The default I2C address of the sensor is 0x76 but it can be changed to 0x77 simply by connecting SDO to 3.3v. To learn more about the BME680 Sensor, you can check BME680 Datasheet. Circuit: Interfacing BME680 with ESP32 For BME680 Indoor Air Quality Monitoring with ESP32 webserver, the major component used is ESP32 Development Board and BME680. This board has a built-in Wi-Fi chip that can upload the data to the internet or server using a Wi-Fi Network. Here is a connection diagram between ESP32 and BME680 Sensor. Connect the BME680 SCL & SDA Pin to GPIO22&nbsp; & GPIO21 &nbsp;default I2C pin of ESP32 Board. Supply the 3.3v power to VCC and SDO pin through 3.3V Pin of ESP32 Board. This is important because we programmed the original code to use the alternative I2C address (0x77). You can access this I2C address from the BME680 sensor by connecting the SDO pin to the 3.3v. You can try this connection on a breadboard or simply use a custom-designed PCB Board. I prefer a breadboard connection for testing the circuit. But, if you want to use this project to monitor IAQ value, I recommend you use PCB. You can simply download the Gerber file and order the PCB from https://www.NextPCB.com at a cheap price. NextPCB is the professional in PCB manufacturing Company. You can try their services at extremely low prices. Only $5 for 10 PCBs and $30 in total for 20 PCBs assembly. Besides this, the new members also get a $5 as a sign-up bonus. If you are a new user, you can order 10 PCBs for free using this platform. Preparing Arduino IDE For BME680 BSEC Library For calculating IAQ and other VOCs gas parameters, we use the BSEC Library for BME680. It is a complicated and advanced library, where BSEC means Bosch Sensortec Environment Cluster.
They conceptualize this library to provide a higher-level processing signal. The library receives raw sensor values from the sensor API, then processes the BME680 signals to provide the requested output. Check the BSEC GitHub Repository for more details. BSEC library is supported by a 32, 16 & 8-Bit controller. It doesn’t support most of the Arduino Boards but supports ARM Controllers, ESP8266, ESP32, MSP430 & Raspberry Pi. You can install the library from the library manager as well. Solving BSEC Library Compilation issue Before using this library you need to change some system files as per the instructions. 1. Go up to the following folder: C:\Users\username\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6 2. Open the file platform.txt. 3. Look for the following piece of code on line 58 # These can be overridden in platform.local.txt compiler.c.extra_flags=compiler.c.elf.extra_flags=compiler.S.extra_flags=compiler.cpp.extra_flags=compiler.ar.extra_flags=compiler.objcopy.eep.extra_flags=compiler.elf2hex.extra_flags= 3. Now we need to add this little piece of code at the bottom on line no.67 compiler.libraries.ldflags= 4. Now look for the following piece of code on line 87: ## Combine gc-sections, archives, and objectsrecipe.c.combine.pattern="compiler.pathcompiler.c.elf.cmd" build.exception_flags -Wl,-Map "-Wl,build.path/build.project_name.map" compiler.c.elf.flags compiler.c.elf.extra_flags -o "build.path/build.project_name.elf" -Wl,--start-group object_files "archive_file_path" compiler.c.elf.libs -Wl,--end-group "-Lbuild.path" 5. We need to add these lines to the above code: compiler.libraries.ldflags You may find difficulty in finding the exact lines. So I would suggest deleting the entire above code from line 87 and replace with the following code. ## Combine gc-sections, archives, and objectsrecipe.c.combine.pattern="compiler.pathcompiler.c.elf.cmd" build.exception_flags -Wl,-Map "-Wl,build.path/build.project_name.map" compiler.c.elf.flags compiler.c.elf.extra_flags -o "build.path/build.project_name.elf" -Wl,--start-group object_files "archive_file_path" compiler.c.elf.libs compiler.libraries.ldflags -Wl,--end-group "-Lbuild.path" 6. The last step is to save the file. That’s it, now you can close it. Source Code: BME680 Indoor Air Quality Monitoring Here is BME680 Indoor Air Quality Monitoring with ESP32 Webserver program code to retrieve BME680 IAQ value & other gas parameters. You can use this code for Indoor Air Quality Monitoring ESP32 webserver. Before uploading the code make sure to change your Wi-Fi Network credentials. // Replace with your network credentials const char* ssid = "xxxxxx-xxxxx"; // Enter SSID here const char* password = "xxxx-xxxx-xxx-xxx"; //Enter Password here Copy final program code for IAQ Monitoring on Webserver from below. #include #include #include "bsec.h" #include #include #define SEALEVELPRESSURE_HPA (1013.25) Bsec iaqSensor; String output; void checkIaqSensorStatus(void); void errLeds(void); float temperature; float humidity; float pressure; float IAQ; float carbon; float VOC; const char* IAQsts; Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire); // Replace with your network credentials const char* ssid = "The_IoT_Projects"; // Enter SSID here const char* password = "Qwertyuiop"; //Enter Password here WebServer server(80); void setup() // put your setup code here, to run once: Serial.begin(115200); delay(100); Wire.begin(); Serial.println(F("Starting...")); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) // Address 0x3D for 128x64 Serial.println(F("SSD1306 allocation failed")); for(;;); Serial.println("OLED begun"); display.display(); delay(100); display.clearDisplay(); display.display(); display.setTextSize(1); display.setTextColor(SSD1306_WHITE); display.setRotation(0); Serial.println("Connecting to "); Serial.println(ssid);
//Connect to your local wi-fi network WiFi.begin(ssid, password); //check wi-fi is connected to wi-fi network while (WiFi.status() != WL_CONNECTED) delay(1000); Serial.print("."); Serial.println(""); Serial.println("WiFi connected..!"); Serial.print("Got IP: "); Serial.println(WiFi.localIP()); server.on("/", handle_OnConnect); server.onNotFound(handle_NotFound); server.begin(); Serial.println("HTTP server started"); iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire); output = "\nBSEC library version " + String(iaqSensor.version.major) + "." + String(iaqSensor.version.minor) + "." + String(iaqSensor.version.major_bugfix) + "." + String(iaqSensor.version.minor_bugfix); Serial.println(output); checkIaqSensorStatus(); bsec_virtual_sensor_t sensorList[10] = BSEC_OUTPUT_RAW_TEMPERATURE, BSEC_OUTPUT_RAW_PRESSURE, BSEC_OUTPUT_RAW_HUMIDITY, BSEC_OUTPUT_RAW_GAS, BSEC_OUTPUT_IAQ, BSEC_OUTPUT_STATIC_IAQ, BSEC_OUTPUT_CO2_EQUIVALENT, BSEC_OUTPUT_BREATH_VOC_EQUIVALENT, BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE, BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY, ; iaqSensor.updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_LP); checkIaqSensorStatus(); void loop() // put your main code here, to run repeatedly server.handleClient(); display.setCursor(0,0); display.clearDisplay(); unsigned long time_trigger = millis(); if (iaqSensor.run()) // If new data is available output = String(time_trigger); output += ", " + String(iaqSensor.rawTemperature); output += ", " + String(iaqSensor.pressure); output += ", " + String(iaqSensor.rawHumidity); output += ", " + String(iaqSensor.gasResistance); output += ", " + String(iaqSensor.iaq); output += ", " + String(iaqSensor.iaqAccuracy); output += ", " + String(iaqSensor.temperature); output += ", " + String(iaqSensor.humidity); output += ", " + String(iaqSensor.staticIaq); output += ", " + String(iaqSensor.co2Equivalent); output += ", " + String(iaqSensor.breathVocEquivalent); Serial.println(output); else checkIaqSensorStatus(); Serial.print("Temperature = "); Serial.print(iaqSensor.temperature); Serial.println(" *C"); display.print("Temperature: "); display.print(iaqSensor.temperature); display.println(" *C"); Serial.print("Pressure = "); Serial.print(iaqSensor.pressure / 100.0); Serial.println(" hPa"); display.print("Pressure: "); display.print(iaqSensor.pressure / 100); display.println(" hPa"); Serial.print("Humidity = "); Serial.print(iaqSensor.humidity); Serial.println(" %"); display.print("Humidity: "); display.print(iaqSensor.humidity); display.println(" %"); Serial.print("IAQ = "); Serial.print(iaqSensor.staticIaq); Serial.println(" PPM"); display.print("IAQ: "); display.print(iaqSensor.staticIaq); display.println(" PPM"); Serial.print("CO2 equiv = "); Serial.print(iaqSensor.co2Equivalent); Serial.println(" PPM"); display.print("CO2eq: "); display.print(iaqSensor.co2Equivalent); display.println(" PPM"); Serial.print("Breath VOC = "); Serial.print(iaqSensor.breathVocEquivalent); Serial.println(" PPM"); display.print("VOC: "); display.print(iaqSensor.breathVocEquivalent); display.println(" PPM"); if ((iaqSensor.staticIaq > 0) && (iaqSensor.staticIaq 51) && (iaqSensor.staticIaq 101) && (iaqSensor.staticIaq 151) && (iaqSensor.staticIaq 201) && (iaqSensor.staticIaq 301) && (iaqSensor.staticIaq 500)) IAQsts = "Very Very Bad"; Serial.print("IAQ: Very Very Bad"); display.print("IAQ: Very Very Bad"); Serial.println(); display.display(); delay(2000); // Helper function definitions void checkIaqSensorStatus(void) if (iaqSensor.status != BSEC_OK) if (iaqSensor.status < BSEC_OK) output = "BSEC error code : " + String(iaqSensor.status); Serial.println(output);
for (;;) errLeds(); /* Halt in case of failure */ else output = "BSEC warning code : " + String(iaqSensor.status); Serial.println(output); if (iaqSensor.bme680Status != BME680_OK) if (iaqSensor.bme680Status < BME680_OK) output = "BME680 error code : " + String(iaqSensor.bme680Status); Serial.println(output); for (;;) errLeds(); /* Halt in case of failure */ else output = "BME680 warning code : " + String(iaqSensor.bme680Status); Serial.println(output); void handle_OnConnect() temperature = iaqSensor.temperature; humidity = iaqSensor.humidity; pressure = iaqSensor.pressure / 100.0; IAQ = iaqSensor.staticIaq; carbon = iaqSensor.co2Equivalent; VOC = iaqSensor.breathVocEquivalent; server.send(200, "text/html", SendHTML(temperature, humidity, pressure, IAQ, carbon, VOC, IAQsts)); void handle_NotFound() server.send(404, "text/plain", "Not found"); String SendHTML(float temperature, float humidity, float pressure, float IAQ, float carbon, float VOC, const char* IAQsts) String html = ""; html += ""; html += ""; html += "BME680 Webserver"; html += ""; html += ""; html += ""; html += ""; html += "body background-color: #fff; font-family: sans-serif; color: #333333; font: 12px Helvetica, sans-serif box-sizing: border-box;"; html += "#page margin: 18px; background-color: #fff;"; html += ".container height: inherit; padding-bottom: 18px;"; html += ".header padding: 18px;"; html += ".header h1 padding-bottom: 0.3em; color: #f4a201; font-size: 25px; font-weight: bold; font-family: Garmond, 'sans-serif'; text-align: center;"; html += "h2 padding-bottom: 0.2em; border-bottom: 1px solid #eee; margin: 2px; text-align: center;"; html += ".box-full padding: 18px; border 1px solid #ddd; border-radius: 1em 1em 1em 1em; box-shadow: 1px 7px 7px 1px rgba(0,0,0,0.4); background: #fff; margin: 18px; width: 300px;"; html += "@media (max-width: 494px) #page width: inherit; margin: 5px auto; #content padding: 1px; .box-full margin: 8px 8px 12px 8px; padding: 10px; width: inherit;; float: none; "; html += "@media (min-width: 494px) and (max-width: 980px) #page width: 465px; margin 0 auto; .box-full width: 380px; "; html += "@media (min-width: 980px) #page width: 930px; margin: auto; "; html += ".sensor margin: 10px 0px; font-size: 2.5rem;"; html += ".sensor-labels font-size: 1rem; vertical-align: middle; padding-bottom: 15px;"; html += ".units font-size: 1.2rem;"; html += "hr height: 1px; color: #eee; background-color: #eee; border: none;"; html += ""; //Ajax Code Start html += "\n"; html += "setInterval(loadDoc,1000);\n"; html += "function loadDoc() \n"; html += "var xhttp = new XMLHttpRequest();\n"; html += "xhttp.onreadystatechange = function() \n"; html += "if (this.readyState == 4 && this.status == 200) \n"; html += "document.body.innerHTML =this.responseText\n"; html += ";\n"; html += "xhttp.open(\"GET\", \"/\", true);\n"; html += "xhttp.send();\n"; html += "\n"; html += "\n"; //Ajax Code END html += ""; html += ""; html += ""; html += ""; html += "BME680 IAQ Monitoring System"; html += ""; html += ""; html += ""; html += ""; html += "IAQ Status: "; html += IAQsts; html += ""; html += ""; //For Temperature html += ""; html += ""; html += ""; html += " Temperature "; html += temperature; html += "°C"; html += ""; html += ""; html += ""; //For Humidity html += ""; html += ""; html += " Humidity "; html += humidity; html += "%"; html += ""; html += ""; //For Pressure html += ""; html += ""; html += " Pressure "; html += pressure; html += "hPa"; html += ""; html += ""; //For VOC IAQ html += ""; html += ""; html += ""; html += " IAQ "; html += IAQ; html += "PPM"; html += ""; html += ""; //For C02 Equivalent html += ""; html += ""; html += " Co2 Eq. "; html += carbon; html += "PPM"; html += ""; html += ""; //For Breath VOC html += ""; html += ""; html += " Breath VOC ";
html += VOC; html += "PPM"; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; return html; void errLeds(void) pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, HIGH); delay(100); digitalWrite(LED_BUILTIN, LOW); delay(100); Now, go to the tools menu and select the ESP32 Development Board from the list. Then select the COM port & finally hit the upload button to upload the code. Open the Serial Monitor now. You will find the IP address of your ESP32 Board. Simply copy the IP address and paste it into a web browser. A beautiful web page loads and you will be able to monitor the BME680 sensor readings remotely from the same network. It will display the following parameters on the webserver in every second: IAQ Status: Depending upon static IAQ Index value (see the IAQ Index and Air Quality Table above)Temperature in °CRelative Humidity in %Pressure in hPaIAQ index in PPM (begins at 25 after startup and takes 15-20 minutes to get stable readings).CO2 equivalent (estimation of the CO2 equivalent in ppm in the environment)Breath VOC equivalent output (estimates the total VOC concentration in ppm in the environment) After the BME680 sensor reading gets stable, you can check the correct value of IAQ, CO2 & VOC. BME680 Indoor Air Quality Monitoring with ESP32 ESP32 Board will try connecting to the Wi-Fi Network using the given SSID & Password. BME680 IAQ data is uploaded to the ESP32 after the interval of every second. We can monitor the data on a Serial Monitor and on smartphones or PC. The data changes whenever the sensor pushes some values. The beautiful widgets for pressure, temperature, humidity, IAQ, CO2 & VOC will appear here. This is how you can use BME680 with ESP32 to monitor the indoor air quality and outdoor air quality. It’s a very simple and nice way of monitoring the environmental air quality in the Local Area Network. Conclusion So, that’s all about BME680 Indoor Air Quality Monitoring with the ESP32 Webserver project. I hope the project was informative and helpful. If yes comment down below: https://youtu.be/bINRrzQjVts
0 notes
theiotprojects · 5 days ago
Text
Hello everyone How are you doing? I hope you all are well and safe. So, this is a quick project on How to make ESP8266 based Coronavirus Tracker for your country. The main aim of this article is to inspire electronics enthusiasts and students to spend their valuable time at home by making some creative projects and enhance their skills. ESP8266 based Coronavirus Tracker for your countryStory Behind this Coronavirus TrackerRequirements of Covid-19 Virus TrackerCircuit Diagram of Coronavirus TrackerProgram Sketch/CodeFinal Program/sketchVideo TutorialConclusion: This is a simple, portable and quick project that keeps the track of Covid-19 outbreak of your country. It updates you about the total Number of Covid-19 Confirmed patients, Number of Deaths, and Recovered as well in a real Time. Here, on the above image, you can see the latest updates of my country where the Confirmed Patient is 4, 0 Deaths, and 1 Recovered. This simple tracker can be configured to display the details of your own country. Also Read: RFID Based Attendance System Using NodeMCU with PHP Web App NodeMCU ESP8266 Monitoring DHT11/DHT22 Temperature and Humidity with Local Web Server Simple Weather station using Arduino & BME280 Barometric Pressure Sensor Home Automation with ESP8266 Web Server & Relay Module Control Appliances from Local Network Story Behind this Coronavirus Tracker With the lockdown in different countries. People are staying at home and making some exciting and Creative projects to avoid this dangerous virus. In this free time, I decided to spend my time learning something. So, I thought to make this simple project. Note: Social Distancing, Washing Hands, and wearing a mask, are some advice that you should follow to Control the Spread of the Covid-19 Virus. Requirements of Covid-19 Virus Tracker In this Quick project, we are using the following components that are cheap and easily available:&nbsp; NodeMCU ESP826616x2 LCD Screen10k PotentiometerBreadboardJumper Wires In this project, we are using NodeMCU ESP8266 as Microcontroller. 16x2 LCD to Display Virus Details and 10k potentiometer to adjust the contrast of the Screen. By Using Covid-19 API we have made a simple live updater. It is very easy to build, Simple and portable. Circuit Diagram of Coronavirus Tracker Here the connections are very simple, Firstly we will interface 16x2 LCD Screen to NodeMCU ESP8266 and then add a 10k potentiometer to adjust its contrast.&nbsp; Connect the RS Pin of the LCD to D0 pin of NodeMCUEN(Enable) Pin of LCD to D1 Pin of the NodeMCUSimilarly, D4, D5, D6, and D7 pin of the LCD Screen to D2, D3, D4, and D5 GPIO Pin of&nbsp; the NodeMCUNow, its time to connect VSS, RW, and K pin of LCD to GND.Similarly, VDD and A Pin of LCD to the 5 volts.Connect the middle pin of the potentiometer to the Vo pin of the LCDNow connect the other two terminals of a potentiometer to GND and Vcc as shown in the Diagram.Finally, Provide 5 volts and GND to the breadboard from Vin and GND pin of the NodeMCU respectively. Program Sketch/Code Now, let’s move towards the programming part. Firstly, download the required file from the link provided below. Extract the zip file and open the corona.ino file in Arduino IDE. Similarly, Open the other wificonnect.h file in any text editor. For the demonstration, I am using a sublime text editor. However, You can use Notepad++ as well. Now, Edit the WiFi Credentials according to your wifi network and then save it. Download All Files Note: If you are using NodeMCU ESP8266 for the first time then you have to install board manager library files. You can read my previous article to know how it’s done? Or search on Youtube you will find lots of tutorials. First, we need to include all the libraries. ESP8266Wifi library is used for TCP/IP Communication. Liquid Crystal library for LCD Display. Place these wifiConnect.h and json_parser.h two files under the same folder. Other Wise you will get errors.
#include #include #include "json_parser.h" #include "WifiConnect.h" Define country code link:http://coronavirus-19-api.herokuapp.com/countries #define country_code "Nepal" //* My Country is Nepal On the code Sketch, you have to define your country code. To know your country code. Simply follow the above link. Now press the Control + F and type your country name to find your country code. MAC users can press Command + F in the same way. Finally, copy that code and paste it on the Arduino IDE code as I did it here.&nbsp; Final Program/sketch #include #include #include "json_parser.h" #include "WifiConnect.h" #define s2ms(second) (second*1000) unsigned long long prev_millis(0); #define country_code "Nepal" LiquidCrystal lcd(D0, D1, D2, D3, D4, D5); int interval = s2ms(60); unsigned long long PreviousMillis = 0; unsigned long long CurrentMillis = interval; bool bFirstKickMillis = false; extern bool bGotIpFlag; static String build_url_from_country(String country) String url = "http://coronavirus-19-api.herokuapp.com/countries/"; url = url + country; return url; void setup(void) lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("Covid-19 Nepal"); #if defined JSON_DEBUG Serial.begin(9600); #endif JSON_LOG("Connecting..."); vConnWifiNetworkViaSdk(); void loop() if (bGotIpFlag) bGotIp(); if (bFirstKickMillis) CurrentMillis = millis(); if (!bGotIpFlag && CurrentMillis - PreviousMillis >= interval) if (!bFirstKickMillis) CurrentMillis = 0; bFirstKickMillis = true; PreviousMillis = CurrentMillis; HTTPClient http; http.begin(build_url_from_country(country_code)); int httpCode = http.GET(); if (httpCode > 0) String payload = http.getString(); char* JsonArray = (char *)malloc(payload.length() + 1); if (!JsonArray) JSON_LOG("upssss fuck"); payload.toCharArray(JsonArray, payload.length() + 1); JSON_LOG(JsonArray); if (json_validate(JsonArray)) int confirmed = (int)get_json_value(JsonArray, "cases", INT); int deaths = (int)get_json_value(JsonArray, "deaths", INT); int recovered = (int)get_json_value(JsonArray, "recovered", INT); JSON_LOG(confirmed); JSON_LOG(deaths); JSON_LOG(recovered); lcd.clear(); lcd.print("Cnfrmd"); lcd.setCursor(7, 0); lcd.print("dths"); lcd.setCursor(12, 0); lcd.print("rcvd"); lcd.setCursor(2, 1); lcd.print(confirmed); lcd.setCursor(8, 1); lcd.print(deaths); lcd.setCursor(14, 1); lcd.print(recovered); free(JsonArray); http.end(); At the END choose your NodeMCU ESP 8266 Board and COM Port from Tools Menu. Finally, Compile the code and upload it to the NodeMCU ESp8266 board. Basically, you can open the serial monitor to see the details of the Corona Virus Patients in real-time.&nbsp; Video Tutorial https://youtu.be/d3tmibU0E90 Conclusion: We have completed the simple, cheap, and quick ESP8266 based Coronavirus Tracker for your country project. This simple project can be configured to display the details of your own country.&nbsp; Also at the end, I will advise you all ladies and gentlemen to stay at home Quarantine. However, you can spend this free time in reading, enhancing your skills, and do some creative projects. As one of the famous Chinese proverbs says that “Crisis comes with opportunities”. Hence, this is the best time to come up with ideas. Always use your skills and ideas to implement then in your real life.&nbsp; I hope you enjoyed reading this article. A huge thanks to Volkan Unal for helping me out. Other ESP8266 Based Projects Resources: ESP8266 based IoT Health Care Panic Alarm for Elderly Folks IoT Based RFID Smart Door Lock System Using NodeMCU ESp8266 ESP8266 Plot Sensor readings to Webserver in Real-Time Chart
0 notes
theiotprojects · 6 days ago
Text
In this tutorial, we will learn how to Connect RFID to PHP & MySQL Database with NodeMcu ESP8266. Here I have interfaced RFID-RC522 Module with NodeMcu ESP8266 and then I'm sending data of RFID to MySQL Database. Actually, we are just reading the serial data coming from NodeMcu ESP8266 and then publishing that to MySQL Database through python code. Unlike others, This project is Protable because we can access data from any device connected to the Internet. Basically, this project can store the Credentials of Students or employes. Connect RFID to PHP & MySQL Database with NodeMcu ESP8266Hardware Components RequiredSoftware Required with Download Links RFID RC522 Module Specifications & Pin Details Interfacing RFID RC522 with NodeMcu ESP8266 Module Installation of XAMPP server: Deploying our PHP Web App Setting up Arduino IDE for ESP8266 BoardSelecting Port and BoardProgram/Sketch CodeVideo TutorialsConclusion Hardware Components Required The components required to make project can be bought through the link provided below: [table id=16 responsive="scroll"] Software Required with Download Links Arduino IDE XAMPP serverPHP Source CodeRFID-RC522 Library NodeMcu ESP8266 Library and Board Manager Now before getting started with this project, let's learn What is RFID? with its specifications and Features. We Have Few More IoT Based Projects Resources: RFID Based Attendance System Using NodeMCU with PHP Web App IoT Based RFID Smart Door Lock System Using NodeMCU ESp8266 ESP8266 based IoT Health Care Panic Alarm for Elderly Folks ESP8266 Plot Sensor readings to Webserver in Real-Time Chart RFID RC522 Module t first, let's learn a little bit about RFID. RFID is the short form of Radio Frequency Identification. RFID modules use electromagnetic fields for transferring data between the card and the reader. Different RFID tags are attached to objects like Keychain, cards, etc. and whenever we place that object in front of the RFID reader, the reader reads that tags. The next benefit of RFID is that it doesn’t require to be in a straight line to get detected. Unlike a barcode, in RFID there’s no such restriction. So, here are some features of RFID RC522. Features: - Module Name: MF522-ED - Working current:13—26mA/ DC 3.3V - Standby current:10-13mA/DC 3.3V - Sleeping current:
0 notes
theiotprojects · 7 days ago
Text
Hello and Welcome to The IoT Projects. In this article, you will learn to make a Dual Axis Solar Tracker Arduino Project Using LDR and Servo Motors in Step by Step manner. In this project, we are going to use some Light Sensitive Sensors like (LDR) to track the sunlight and direct the solar panels towards the areas that Increase its efficiency. I have divided the article into 7 segments as: Dual Axis Solar Tracker ArduinoComponents required for this projectWorking Principle of LDR SensorProject SimulationTinkercad Dual Axis Solar Tracker Arduino Simulation fileInterfacing Dual Axis Solar Tracker Arduino Project Using LDR & Servo MotorsProgramming Arduino for Dual Axis Solar Tracker ProjectFinal Program code/sketchConnecting all the parts togetherVideo TutorialsConclusion Components required for this project The following list is the list of all the components that are required for this project: [table id=15 responsive="scroll"] Our Popular Arduino Based Projects: Interfacing Temperature and Humidity Sensor with Arduino DIY Mobile Phone using GSM Module & Arduino with Nextion Display Simple Weather station using Arduino & BME280 Barometric Pressure Sensor RFID Based Attendance System Using NodeMCU with PHP Web App Capacitive Soil Moisture Sensor with OLED Display & Arduino Working Principle of LDR Sensor Here, LDR Works as a light detector. It is also known as a photoresistor. Actually, It is a light Sensitive device. As shown in the graph, the resistance decreases as light falls on it. In this project, we are using 4 LDRs to detect the Sunlight. And when they send Signal to the Arduino, It will guide two Servo Motors to better place the solar panel to maximize its efficiency. Working Process of LDR Project Simulation Here, we will show you a complete overview of this project. Later on, we will discuss its wiring system. But, now we will stimulate this project. Project Simulation When we power on the Arduino all the sensors and servo motors are into the actions. As you can see the above image. Usually, when we increase the light intensity on the LDR Sensor, the signal is sent to the Arduino. And Hence it guides the two servo motors to better place the solar panel. To increase its efficiency. Actually, you can see here as we increase or decrease the light intensity the Servo Motors are into their actions. Using these two potentiometers you can control the speed of Servo Motors as well. We will talk about it later in the programming section. Tinkercad Dual Axis Solar Tracker Arduino Simulation file https://youtu.be/mxeAabavp6M Download Solar Tracker Tinkercad File Interfacing Dual Axis Solar Tracker Arduino Project Using LDR & Servo Motors Interfacing Dual Axis Solar Tracker Arduino Project Using LDR & Servo Motors Connect 5volt pin from the Arduino to the Lower horizontal row of the breadboard.Similarly, connect the GND pin from the Arduino to a second lower horizontal row of the breadboard.Extend the 5 volt and GND Rows to the upper horizontal rows of the breadboard respectively.Now connect the power pins of both Vertical and Horizontal servo motor to the 5 volts.Similarly, Connect the GND pin of the Both Horizontal and Vertical Servo motor to the Ground.Now, connect the Signal pin of the Vertical Servo Motor to the Digital Pin No. 10 of the Arduino.Again, connect the Signal pin of the horizontal Servo Motor to the Digital Pin No. 9 of the Arduino.Connect one terminal of both potentiometers to the Ground and Other end terminals of both potentiometer to the VCC 5 volt.Now, connect all LDRs one terminal to the 5 volt and other terminals to the Ground Through 10k-ohm resistors.Let's connect the wiper pin of the potentiometer-1 one to the Analog Pin A4 and A5 to another wiper pin of Potentiometer-2.Connect bottom left LDR voltage Divider point to A1 pin of Arduino.Again, Connect Top Left LDR voltage Divider Point to A0 pin of the Arduino.Similarly, Top Right LDR Voltage Divider Point to the A2 pin.
Finally, Connect the Bottom Right Voltage Divider Point of LDR to the A3 pin of the Arduino. Programming Arduino for Dual Axis Solar Tracker Project #Include is used to include a servo header library file. #include Configuration for Horizontal servo. The Servo Horizontal is set to 180 degrees. Servo Horizontal Limit When Signal is High is set to 175 degrees. Again, Servo Horizontal Limit when Signal value is low is set to 5 degrees. Servo horizontal; // horizontal servo int servoh = 180; int servohLimitHigh = 175; int servohLimitLow = 5; // 65 degrees MAX This is the Servo Configuration for Vertical The Servo Vertical is set to 45 degrees. Servo Vertical Limit When Signal is High is set to 60 degrees. Also, Servo Vertical Limit when Signal value is low is set to 1 degree. Servo vertical; // vertical servo int servov = 45; int servovLimitHigh = 60; int servovLimitLow = 1; LDR Pin Connections ldrlt is for Top Left ldrrt is for Top Right ldrld is for Down Left ldrrd is for Down Right // LDR pin connections // name = analogpin; int ldrlt = A0; //LDR top left - BOTTOM LEFT avr) servoh = --servoh; if (servoh < servohLimitLow) servoh = servohLimitLow; else if (avl < avr) servoh = ++servoh; if (servoh > servohLimitHigh) servoh = servohLimitHigh; else if (avl = avr) delay(5000); horizontal.write(servoh); delay(dtime); Connecting all the parts together Connecting all the printed parts together Video Tutorials https://youtu.be/Cg3fhdAnp9I Conclusion Finally, we have completed Interfacing Dual Axis Solar Tracker Arduino Project Using LDR & Servo Motors. Now, you can use this Project to track the solar panel and increase its efficiency by 40%. We hope you found this project useful!&nbsp;Drop a comment below if you have any doubts or queries. We’ll do our best to answer your questions.
0 notes
theiotprojects · 8 days ago
Text
Overview Welcome to The IoT Projects. In this tutorial, we are going in-depth with a DHT11 sensor that measures Humidity and Temperature. We will also interface LCD Screen and DHT11&nbsp;Temperature and Humidity Sensor to the Arduino by Programming&nbsp;it. Hence today’s topic is all about Interfacing DHT11 Humidity and Temperature Sensor with Arduino & LCD. DHT11 Sensor with Arduino & LCDOverviewComponents RequiredHardware Overview of DHT11 SensorWorking PrincipleFeatures of DHT11 SensorInterfacing DHT11 Humidity & Temperature Sensor with Arduino & LCD Program Sketch/Codes: ExplanationFinal Program Sketch/CodesVideo Tutorials:Conclusion: Basically, the DHT11 Humidity and Temperature Sensor is Pre Calibrated, i.e. we don't need any extra components to start measuring relative Humidity and Temperature. Actually, DHT11 is a calibrated digital Sensor that has high reliability and longterm excellent stability. The sensor includes a resistive element like NTC. NTC is a temperature measuring sensor. Hence, DHT11 has good quality and durability. The best thing that we love about this sensor is inexpensive. Components Required Arduino UNODHT11/DHT22 Humidity and Temperature Sensor10K Potentiometer16x02 LCD ScreenBreadboardJumper Wires: Male to Male and Male to Female Hardware Overview of DHT11 Sensor DHT11 is a Digital Humidity and Temperature Sensor. It measures humidity from 20 to 80% with an accuracy of 5%. Similarly, the temperature from 0°C to 50°C with ±2.0°C accuracy. Usually, DHT11 requires a 10k-ohm external pull-up resistor between VCC and Digital Pin for proper interfacing. However, the DHT11 module has built-in resistors. Hence, an additional resistor is not required. It also has a decoupling capacitor to filter noise on the power supply. DHT11 Humidity and Temperature Sensor Pinouts This sensor provides data to the Arduino using Data Pin. The power supply pin(VCC) can be connected to the range of 3.5 to 5 volts. Learn More about Arduino UNO Working Principle The sensor includes a humidity sensing component, an NTC temperature sensor (or thermistor) and an IC on the rear side of the sensor. Working of DHT11 Humidity and Temperature Sensor Basically, for measuring temperature these sensors use an NTC temperature sensor or a thermistor. A thermistor is truly a variable resistor that changes its resistance with the change of the temperature. These sensors are made by sintering of semiconductive materials like ceramics or polymers in order to produce larger changes within the resistance with just small changes in temperature. The term “NTC” means “Negative Temperature Coefficient”, which suggests that the resistance decreases with an increase in the temperature. Features of DHT11 Sensor Cheap in Price.3 to 5V power and I/O2.5mA max current use during conversion (while requesting data)Good for 20-80% humidity readings with 5% accuracyGood for 0-50°C temperature readings ±2°C accuracyNo&nbsp;over&nbsp;1 Hz&nbsp;rate&nbsp;(once every second)Body size 15.5mm x 12mm x 5.5mm3 pins with 0.1" spacing Interfacing DHT11 Humidity & Temperature Sensor with Arduino & LCD Now lets wire up DHT11 and LCD to the Arduino board. The Connection is fairly simple. First of all, interface the LCD to the Arduino. Interfacing DHT11 Humidity and Temperature Sensor with Arduino and LCD LCD to Arduino Connection RS pin to digital pin 7 Enable pin to digital pin 8D4 pin to digital pin 9D5 pin to digital pin 10D6 pin to digital pin 11D7 pin to digital pin 12R/W pin to groundVSS pin to groundVCC pin to 5V Connection with 10K Potentiometer: VO pins to Center Pin of the Potentiometer. Ends to +5V and Ground Interfacing DHT11 Connect the&nbsp;Ground(GND)&nbsp;of the Arduino board to the&nbsp;GND pin&nbsp;of the ArduinoNow, connect&nbsp;5 volts&nbsp;to the&nbsp;VCC pin.Finally, connect the pin number&nbsp;2&nbsp;of the Arduino board to the&nbsp;Data Pin&nbsp;of the DHT-11 Sensor.
Program Sketch/Codes: Explanation Now, let’s program the Arduino board using this sketch. But, before that let me explain these few lines of codes. So that it will be easier to understand the codes. These lines of code include LiquidCrystal and DHTLib library files. Download DHTLib #include #include The OutPin defines the Data pin connected to the Arduino. #define outPin 2 Basically, these two lines define the LCD Data Pins and Create LCD and DHT objects. LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // Create an LCD object. dht DHT; // Create a DHT object LCD.begin command to Initialize the LCD. lcd.begin(16,2); // Initialize the LCD In the Loop function, we have used the read11 function. It reads data from the sensor. void loop() { int readData = DHT.read11(outPin); Float is used to read temperature and Humidity when they are calculated. float t = DHT.temperature; float h = DHT.humidity; Char function is used to display small degree characters to the LCD Screen and "%" Symbol for Humidity. lcd.setCursor(0,0); lcd.print("Temp.: "); lcd.print(t); lcd.print((char)223);//shows degrees character lcd.print("C"); lcd.setCursor(0,1); lcd.print("Humi.: "); lcd.print(h); lcd.print("%"); Under the loop function, we added a 1-sec delay. Therefore, we sent the data every second. delay(1000); Final Program Sketch/Codes This is the final sketch of this project. Using this sketch you can interface DHT11 Sensor with Arduino and Display the final output to the LCD Screen. //https://theiotprojects.com #include // Include LiquidCrystal Library #include // Include DHTlib Library- Download from Description. #define outPin 2 LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // Create an LCD object. dht DHT; // Create a DHT object void setup() lcd.begin(16,2); // Initialize the LCD void loop() int readData = DHT.read11(outPin); float t = DHT.temperature; float h = DHT.humidity; lcd.setCursor(0,0); lcd.print("Temp.: "); lcd.print(t); lcd.print((char)223);//shows degrees character lcd.print("C"); lcd.setCursor(0,1); lcd.print("Humi.: "); lcd.print(h); lcd.print("%"); delay(1000); Video Tutorials: https://youtu.be/1yrZPVEU1Vo Conclusion: Finally, we have completed Interfacing DHT11 Humidity and Temperature Sensor with Arduino & LCD. Now, you can see the Humidity and Temperature from the LCD Screen. We hope you found this project useful!&nbsp;Drop a comment below if you have any doubts or queries. We’ll do our best to answer your questions.
0 notes
theiotprojects · 9 days ago
Text
Welcome to The IoT Projects. In this tutorial, we are going to see a sensor that measures the Temperature and Humidity. We will also interface the DHT-11 Temperature and Humidity Sensor to the Arduino by Programming it. Hence today's topic is all about Interfacing Temperature and Humidity Sensor with Arduino. Interfacing Temperature and Humidity Sensor with ArduinoComponents RequiredDHT-11 PinoutsSchematic of DHT-11 and ArduinoProgramming Sketch/CodesFinal Sketch/CodesVideo TutorialsConclusion Components Required Arduino UNODHT-11 Temperature and Humidity SensorJumper wires DHT-11 Pinouts This is the sensor that we are going to use in this tutorial. Its name is DHT-11, It can give the temperature and Humidity using one wire called Data. The power supply pin(VCC) can be connected to the range of 3.5 to 5 volts. DHT-11 Temperature and Humidity Sensor Pinouts Schematic of DHT-11 and Arduino Actually, the connection in this tutorial is very simple because there are only three wires that are VCC, GND, and Data. Circuit Diagram of Interfacing DHT-11 to the Arduino Connect the Ground(GND) of the Arduino board to the GND pin of the ArduinoNow, connect 5 volts to the VCC pin.Finally, connect the pin number 2 of the Arduino board to the Data Pin of the DHT-11 Sensor. Programming Sketch/Codes Now, let's program the Arduino board using this sketch. But, before that let me explain these few lines of codes. So that it will be easier to understand the codes. As we are using the DHT library. The header file has to be included. So open the tools menu and upload the library file. #include Download SimpleDHT Library A variable called "pinDHT11" is declared with a value 2 as the pin of the Arduino board where the Data pin is connected to. // for DHT11, // VCC: 5V or 3V // GND: GND // DATA: 2 int pinDHT11 = 2; The next variable called "dht11" of type "simpleDHT11" is declared to handle the communication with the sensor. SimpleDHT11 dht11; Inside the function setup() the serial interface is initialized with 9600 as the baud rate. void setup() Serial.begin(9600); Every time that we send the information to the computer. we will start with a separation line and the text "Sample DHT11..." Serial.println("Sample DHT11..."); Here, we have declared 3 variables, an array of 40 elements called "data" that will hold the raw data from the sensor. And the variables "temperature" and "Humidity" for the values of measured magnitudes. // read with raw sample data. byte temperature = 0; byte humidity = 0; byte data[40] = 0; The function "read" is called with the pin "pinDHT11" and a reference to the variable "Temperature", "Humidity" and the "Data" array. How these variables are going to be populated inside the function. Basically, the passing has to be done by reference (&). The data array is already a reference and does not need &. The "read" function will return a 0. If everything went well. if (dht11.read(pinDHT11, &temperature, &humidity, data)) { The 40 bits received from the sensor are sent to the PC. Serial.print("Sample RAW Bits: "); for (int i = 0; i < 40; i++) { Serial.print((int)data[i]); if (i > 0 && ((i + 1) % 4) == 0) Serial.print(' '); Finally, the Temperature in (Celsius) and Humidity in (Percentage) are sent. Serial.print((int)temperature); Serial.print(" *C, "); Serial.print((int)humidity); Serial.println(" %"); Under the loop function, we added a 1-sec delay. Therefore, we sent the data every second. delay(1000); Final Sketch/Codes //https://theiotprojects.com/ //2020.2.29 #include // for DHT11, // VCC: 5V or 3V // GND: GND // DATA: 2 int pinDHT11 = 2; SimpleDHT11 dht11; void setup() Serial.begin(9600); void loop() // start working... Serial.println("================================="); Serial.println("Sample DHT11..."); // read with raw sample data.
byte temperature = 0; byte humidity = 0; byte data[40] = 0; if (dht11.read(pinDHT11, &temperature, &humidity, data)) Serial.print("Read DHT11 failed"); return; Serial.print("Sample RAW Bits: "); for (int i = 0; i < 40; i++) Serial.print((int)data[i]); if (i > 0 && ((i + 1) % 4) == 0) Serial.print(' '); Serial.println(""); Serial.print("Sample OK: "); Serial.print((int)temperature); Serial.print(" *C, "); Serial.print((int)humidity); Serial.println(" %"); // DHT11 sampling rate is 1HZ. delay(1000); Video Tutorials https://youtu.be/6XPNOlQxc3w Conclusion Finally, we have completed Interfacing Temperature and Humidity Sensor with Arduino. Now, you can see the temperature and Humidity from the Serial Monitor. We hope you found this project useful!&nbsp;Drop a comment below if you have any doubts or queries. We’ll do our best to answer your questions.
0 notes
theiotprojects · 10 days ago
Text
Hello, everyone in this LDR Tutorial we are going to Interface LDR Photo Resistor to Arduino and Control LEDs. Firstly, We will learn to Interface 74HC595 IC and 8 LEDs to the Arduino. Secondly, we will program the Arduino board to control the light using Analog input LDR i.e. Light Dependent Resistor. Finally, we will test the whole system. Connect LDR Photo Resistor to Arduino and Control LEDsComponents Required for this projectWorking Process of LDR SensorLab Work with LDR74HC595 IC PinoutsInternal overview of 74HC595 ICInterfacing 74HC595 IC, LEDs and LDR to ArduinoSketch/Program codesFinal Sketch/ProgramVideo TutorialsConclusion Components Required for this project Arduino UNOLDR Photo Resistor Breadboard1 -1k-ohm resistor8 - 220- ohm resistors8 - LEDs74HC595 ICJumper Wires Working Process of LDR Sensor As I have already mentioned, In this tutorial we are going to learn How to measure Light Intensity using an analog input (LDR) Light Dependent Resistor. As you can see in the image table below. The value of resistance decreases as the light intensity increases. Lab Work with LDR Actually, we are going to set up a voltage divider with the LDR and 1K-ohm resistor. We will connect the midpoint of the voltage divider to the analog input of Arduino. As you can see in the below image that the voltage increasing over the light intensity. LDR Connections with Arduino 74HC595 IC Pinouts The 74HC595 IC has 16 pins in which power supply pins are number 8 (GND) and 16 (VCC). We will use 5 volts for VCC. Pin no. 10 is Master Reset, We have to keep this pin to high level to ensure proper operation of IC.Pin no 14 is DS, Data Serial Input. We simply call it Data Pin.Pin no. 11 is SHCP, that is known as Clock pin.Pin 12 is STCP known as Latch pin.Pin no. 13 is OE, Output Enable. It is used to enable the output. So we will set this pin always low (Always Active)Pin Q0 to Q7 are the outputs pins. We will connect them to LEDs.Finally, Pin Q7 is used when you want to connect multiple 595IC in a cascade. 74HC595 IC Pinouts Learn more about Arduino UNO Pinout from this article Internal overview of 74HC595 IC Internally, the 595IC contains three Registers. The upper one is called "Shift Register". It receives the data through the DS pin. On every rising edge of the SHCP(Clock) signal the register will shift to the left. The Middle Register is used to store the values of the Shift Register. To copy the Shift Register to the Storage Register we need a rising edge on the STCP (i.e LATCH) Pin. The Lower Register is the actual values of the Output. This will be either High Impedance if Output Enable (OE) is high or the value of the storage Register If Output Enable is Low. Internal overview of 74HC595 IC At every rising edge at the SHCP(clock) in the shift register is shifted by the level of the DS Pin. Basically, after 8 rising edges on the clock signal the shift register is full of Data. with a rising edge of the latch signal (STCP) pin the values of the shift register are copied on to the storage register. But the outputs are no updated and they are still in High Impedance because the pin Output Enable is High. The output Enable Signal becomes low and the outputs reflect the values of the storage register. A second byte has entered the shift register. At the next rising edge of the latch signal (STCP), the storage Register is copied with the value of the shift register. And the outputs are updated with the new value because the Output Enable pin is low. Interfacing 74HC595 IC, LEDs and LDR to Arduino Let's begin with the connections of 74HC595 IC and LEDs. Connect GND and 5v pin of the Arduino to the upper horizontal rows of the breadboard. Schematic of 74HC595 IC, LEDs and LDR to Arduino Connection of 74HC595 IC pins: Power Pins 8 - GND and 16 - 5 volts.Master Pin- 10 to the 5 volts. To have it always enabled.Pin 13 (Output Enable) to GND to have outputs always active.
Arduino pin 12 to Data Pin (14) of ICConnect Arduino Pin 9 to Latch pin (12)Q0 to Q7 are outputs pin. Connect them to the LEDs through 220-ohm resistors. Note that the pin 9 (Q7) of the iC is not connected. Connect one end of the LDR to 5 volts.Now Connect another end of the LDR to 1k resistor.Other ends of the resistor to the GND.Mid pint of the voltage divider to the analog input pin A0 of the Arduino. Sketch/Program codes The variable reading will hold the analog value of the voltage divider formed by the LDR and 1k resistor. int reading = analogRead(lightPin); The variable "numLEDSLit" is the number of LEDs that we have to switch on: The calculations are explained as follows: The maximum value of the analog input is 1023. As we have 8 LEDs. we divide it by 9, and also by 2 because the divider will show the half to the value. When the value of the LDR resistance is 1k. int numLEDSLit = reading / 57; //1023 / 9 / 2 With the if Statement you limit the number of LEDs to light to 8. leds=0 means no LEDs to start if (numLEDSLit > 8) numLEDSLit = 8; leds = 0; // no LEDs light to start Similarly, with the for loop, you add so many 1 as LED to turn "ON" for (int i = 0; i < numLEDSLit; i++) leds = leds + (1
0 notes
theiotprojects · 11 days ago
Text
Overview Hello and welcome to the Arduino Projects. In this article, I will teach you how to connect the joystick to the Arduino board. And we will use our knowledge from the previous article to connect four LEDs through the Arduino board as well. Then we will program the Arduino so that we can control the four LEDs using the joystick. Hence, today's topic is all about the Arduino tutorial to control LEDs using Joystick. What is Joystick? The very first thing that comes to our mind while listening to the word "Joystick" is simply a game controller. Because everybody has seen it while playing video games. But, apart from gaming, it can wide range of applications in electronics. Actually, the joystick is the combination of two potentiometers for the X and Y Plane. It gives analog data to the Arduino by reading the voltage from the potentiometer. This analog value get changes as we move the joystick shaft. Generally, it has five pinouts: GND 5 Volt/VCC VRX VRY SW A typical&nbsp;Joystick module Arduino tutorial to control LEDs using JoystickOverviewWhat is Joystick?Components Required for this projectCircuit Diagram of this project Interface LEDs to the Arduino Interface Joystick with the Arduino Program Source Code Explanation Full Source CodeVideo TutorialsConclusion Components Required for this project Arduino UNOJoystick Module4 LEDs4 Resistor: 220-ohmConnecting wiresBreadboard Circuit Diagram of this project Circuit Diagram Interface LEDs to the Arduino Firstly, let’s begin by attaching the Arduino GND pin to the corner of the breadboard using a jumper wire. Now we connect the second row of the breadboard to the last row of the breadboard as you can see in this circuit diagram. Using a second jumper wire. In this way, we have connected the second column of the breadboard to the GND pin of the Arduino Board. Secondly, we will connect one leg of the 220-ohm resistor to the ground. Similarly, the other leg will be somewhere on the board(in a suitable place). Now we'll take our LED and all you people know that&nbsp; LED has two legs. The shorter one is the cathode and the long leg is the anode. As always, the cathode is negative and the anode is positive. Hence, we will connect the cathode the short leg to the ground through the resistor. So, the resistors connect to the ground and then it's connected to the cathode leg of the LED. Now we will repeat this process for the other three LEDs. Okay, now we've connected the four LEDs.&nbsp; The cathode Leg of each LED connected to the ground through the 220-ohm resistor. Finally, we will start connecting the anode legs of each LED to the Arduino board. As shown in the circuit diagram. First LED Anode to the Pin 5 on the digital side of the Arduino. The second LED Anode to Pin 6 on the digital side of the Arduino. Third LED Anode to Pin 5 on the digital side of the Arduino. The fourth LED Anode to Pin 5 on the digital side of the Arduino. Interface Joystick with the Arduino Basically, Joystick has five pins Ground, 5Volt, VRX, VRY, and SW -we're gonna just ignore that. So let's connect these pins with the Arduino. GND pin to the GND pin of Arduino +5 volt pin to the 5volt pin of Arduino VRX pin to the A0 pin of Arduino VRY pin to the A1 pin of Arduino Finally,&nbsp; we have finished the wiring and we're ready to upload the code. Program Source Code Explanation Let's begin by defining or declaring variables that represent our LEDs. So we have LED one, two, three, and four and they're connected to pin 5, 6, 9, and 10 respectively. int led1 = 5; int led2 = 6; int led3 = 9; int led4 = 10; We also have to define the joystick in the VRX and VRY. VRX is connected to A0. And so we're going to create the variable until a joystick_ x give it the value from A0 pin. Similarly, the other variable is joystick_y and going to give it the value to A1. // define joystick pins int joystick_x = A0;
int joystick_y = A1; Next, we declared two variables joystick_ xvalue and &nbsp; joysticks_yvalue. These two variables will store the X and Y read incoming from the joystick respectively. //read values from the analog pin int joystick_xvalue = 0; int joystick_yvalue = 0; Then we have the setup section.&nbsp;In the setup section, we have to define the LEDs as a digital output. So we use the pinMode function. And when you set the LEDs as digital output pins, we use the same function to define the joystick_x as an input pin A0 and the joystick_y as an input pin A1. void setup() // put your setup code here, to run once: pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); pinMode(led4, OUTPUT); pinMode(joystick_x, INPUT); pinMode(joystick_y, INPUT); Then you have the loop section. I start by assigning the values 0 to joystick_x value and joystick_y values. Every time we loop they're gonna be assigned the value zero and then we'll get to reading to see where the joystick is at? void loop() { // put your main code here, to run repeatedly: joystick_xvalue = 0; joystick_yvalue = 0; //read values from joystick_x joystick_xvalue = analogRead(joystick_x); joystick_xvalue = map (joystick_xvalue, 0, 1023, -90, 90); //read values from joystick_y joystick_yvalue = analogRead(joystick_y); joystick_yvalue = map (joystick_yvalue, 0, 1023, -90, 90); Finally, I have added some of the if statements to control LEDs using Joystick. if(joystick_xvalue < -5) digitalWrite(led1, HIGH); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, LOW); else if(joystick_xvalue > 5) digitalWrite(led1, LOW); digitalWrite(led2, HIGH); digitalWrite(led3, LOW); digitalWrite(led4, LOW); else if(joystick_yvalue < -5) digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, HIGH); digitalWrite(led4, LOW); else if(joystick_yvalue > 5) digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, HIGH); else digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, LOW); Full Source Code int led1 = 5; int led2 = 6; int led3 = 9; int led4 = 10; // define joystick pins int joystick_x = A0; int joystick_y = A1; //read values from the analog pin int joystick_xvalue = 0; int joystick_yvalue = 0; void setup() // put your setup code here, to run once: pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); pinMode(led4, OUTPUT); pinMode(joystick_x, INPUT); pinMode(joystick_y, INPUT); void loop() // put your main code here, to run repeatedly: joystick_xvalue = 0; joystick_yvalue = 0; //read values from joystick_x joystick_xvalue = analogRead(joystick_x); joystick_xvalue = map (joystick_xvalue, 0, 1023, -90, 90); //read values from joystick_y joystick_yvalue = analogRead(joystick_y); joystick_yvalue = map (joystick_yvalue, 0, 1023, -90, 90); if(joystick_xvalue < -5) digitalWrite(led1, HIGH); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, LOW); else if(joystick_xvalue > 5) digitalWrite(led1, LOW); digitalWrite(led2, HIGH); digitalWrite(led3, LOW); digitalWrite(led4, LOW); else if(joystick_yvalue < -5) digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, HIGH); digitalWrite(led4, LOW); else if(joystick_yvalue > 5) digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, HIGH); else digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, LOW); delay(15); Video Tutorials https://youtu.be/_SlZJHdskOk Control LEDs using Joystick Arduino Tutorial Conclusion Finally, we have completed the Arduino Tutorial to Control LEDs using Joystick.
Now, you can control the four LEDs using the Joystick module Interfaced with Arduino Board. We hope you found this project useful!&nbsp;Drop a comment below if you have any doubts or queries. We’ll do our best to answer your questions.
0 notes
theiotprojects · 12 days ago
Video
youtube
IoT-based Thermostat Remote Controller using DWIN TC041C11W04 Download project files: https://theiotprojects.com/iot-based-thermostat-remote-controller-using-dwin-tc041c11w04/ Video tutorial: https://youtu.be/KrC5tAeYxj4 #Dwindisplay #iotthermostat #smartdisplay #dwincloud #iotdisplay #esp8266 #wifi #tc041c11w04
0 notes
theiotprojects · 12 days ago
Text
In this article, we’re going to do a water level sensor Arduino tutorial. We’ll go through the entire process of wiring the sensor, and it's working principle. We will provide you a Program Code examples to get you started with these projects. Actually, This sensor can be used as a water leak detection sensor as well. WATER LEVEL SENSOR ARDUINO TUTORIALHardware OverviewWorking Principle of Water Level SensorPinout of Water Level SensorComponents Required for this ProjectInterface the Water Level Sensor with ArduinoArduino water level sensor with LCD DisplayProgram Code for (Serial Console) Calibration MethodArduino Water level Code (LCD Screen)Video TutorialUses of The Water Level SensorConclusion: Hardware Overview Basically, this water level sensor comes with only 3 pins. Namely, Ground, +5Volt, and Signal Pin. Hence it is very easy to interfere with the Arduino board. Here the signal pin is an analog output so we will connect it to any analog pin on the Arduino board. This analog water level sensor board has several copper traces on it. Five of them are power traces and five are sense traces. These copper traces are not connected but, they will be bridged by water when submerged in water. Note: As we all know power water is non-conductive. But, Actually, the minerals and impurity present in the water make it conductive. This point is very important to understand because your sensor may be more or less sensitive based on the type of water you have used. Usually, you need to change the value in the code to get accurate readings.&nbsp; Ultimately, we’re just studying the resistance of the impurities in your water. Current can easily pass when more of the traces are bridged. While reading the Water level sensor output with an analog input pin on Arduino. It will provide results between 0 and 500 only with the typical water that we get in public places. Working Principle of Water Level Sensor The working principle of the Water Level Sensor is very straightforward. Basically, the series of parallel conductors seen on the sensor acts as a variable resistor (Similar to the potentiometer). The resistance varies with the increase or decreases in the water level. Hence the change in the resistance is inversely proportional to the distance from the top of the sensor to the surface of the water. Working of Water Level Sensor The resistance is inversely proportional to the height of the water. More the sensor immersed in water results in better conductivity and will result in lower resistance.Lesser the sensor immersed in water will result in higher resistance due to poor conductivity. Usually, this sensor provides output voltage according to the resistance, so by measuring it, we can determine the water level. Pinout of Water Level Sensor The Water Level sensor is super easy to connect because it has only three pinouts. Pinout of Water Level Sensor S (Signal) pin is an analog output pin and will always be connected to the analog inputs pin in Arduino. + (VCC) pin is the power supply pin for the sensor. supplies power for the sensor. The recommended power of the water level sensor is between 3.3V - 5V. Note: analog output will vary depending on the voltage provided to the sensor. (GND) pin is for the ground connection. Components Required for this Project Here is a quick list of the components that are required to get started with this Arduino and Water level sensor project: Arduino Uno or Arduino Mega 2560 Water Level Sensor (Leak Detection Sensor) Breadboard and Wires LCD Character Display (optional) &nbsp;10K Potentiometer (optional) Interface the Water Level Sensor with Arduino Interfacing the water level sensor is incredibly simple.&nbsp; We’ll use the following Circuit diagram to wire it up. And use it with the serial console, to get accurate readings out of your water level sensor. Hence, it is recommended to calibrate the sensor for the particular type of water that you plan to monitor.
Connections for Water Level Sensor and Arduino Signal pin to Arduino A5 +5V pin to Arduino 5V (-)GND to Arduino GND Circuit Diagram of Water level sensor with Arduino Arduino water level sensor with LCD Display Finally, if you want to make it more advanced then add an LCD screen to display the output. Actually, you can follow the LCD connecting to Arduino Instructions to make it more advanced. So, here is the complete circuit diagram to Interface Arduino Water Level Sensor with an LCD. Interface LCD to Arduino UNO VSS pin to groundVDD pin to 5VVo to Center Pin of PotentiometerRS pin to digital pin 12R/W pin to groundEnable pin to digital pin 11D4 pin to digital pin 5D5 pin to digital pin 4D6 pin to digital pin 3D7 pin to digital pin 2Potentiometer Ends to +5V and ground Circuit diagram of Arduino water level sensor with LCD Display Program Code for (Serial Console) This code is for those who don't have LCD or Don't want to display characters on this project. This code will print the output on the Serial Console. Basically, this is a great piece of code that helps you to learn to use a water level sensor with Arduino. Here are the things to note about this code. You can delay time according to your needs.&nbsp;To check the data faster than around 100ms you have to turn off the serial output. You may need to adjust the numbers. Because, it depends upon the impurities (minerals) present in your water. The sensor may be more or less sensitive to certain waters. Remember, pure water is non-conductive, its the minerals that make this work.&nbsp; The numbers I used to work well in my water. You can follow the calibration method to get perfect data to adjust this code numbers. int resval = 0; // holds the value int respin = A5; // sensor pin used void setup() // start the serial console Serial.begin(9600); void loop() resval = analogRead(respin); //Read data from analog pin and store it to resval variable if (resval 100 && resval 155 && resval 170) lcd.print("High "); delay(1000); Calibration Method To get accurate readings out of your water level sensor. It is recommended to calibrate the sensor for the particular type of water that you plan to monitor. Actually, you can use the code provided below for calibration. Using the circuit diagram above, note the outputs from the serial Monitor when the sensor is completely dry -vs- partially submerged in the water -vs- completely submerged. Arduino Water level Sensor Calibration For example, using the same circuit above, and program code below. You will see the values like this in the serial monitor. For me, when the senor is dry (0) and when it is partially merged in the water (~420) and when it is completely merged (~520). int resval = 0; // holds the value int respin = A5; // sensor pin used void setup() // start the serial console Serial.begin(9600); void loop() resval = analogRead(respin); //Read data from analog pin and store it to resval variable Serial.println(resval); delay(1000); Arduino Water level Code (LCD Screen) This is the LCD version of the program code. Basically, it adds a loop to print to the LCD and move the cursor back on each cycle. // include the library code: #include //initialise the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int resval = 0; // holds the value int respin = A5; // sensor pin used void setup() // set up the LCD's number of columns and rows: lcd.begin(16, 2); void loop() // Print a message to the LCD. lcd.print("WATER LEVEL: "); // set the cursor to column 0, line 1 lcd.setCursor(0, 1); resval = analogRead(respin); //Read data from analog pin and store it to resval variable if (resval 100 && resval 155 && resval 170) lcd.print("High "); delay(1000); lcd.clear(); Video Tutorial https://youtu.be/up6AElfGFTU Uses of The Water Level Sensor
Usually, we can use the water level sensor for many projects. It is actually more versatile than you think. So, here are some useful project ideas using this sensor. Can be used in&nbsp;water tanks&nbsp;to control water levelsWater leakage detection Automatically turn ON/OFF pumps Can be used in factories, commercial complexes, apartments, home,Fuel tank level gaugingOil tank level control Rain Monitoring Systemand many more. Conclusion: Finally, we have completed the Water Level Sensor Arduino Tutorial. Now, your LCD screen (or serial console) should be showing the water level. We hope you found this project useful!&nbsp; Leave a comment below if you have any doubts or queries. We’ll do our best to answer your questions.
0 notes
theiotprojects · 13 days ago
Text
Introduction to Arduino What is an Arduino?  Arduino is an Open-Source physical computing platform that is designed for experimenting with electronics and has more fun with intuitive. Actually, Arduino has its own programming language, huge potential uses, and vast support of Network. That makes it a perfect platform for both Beginners and Advanced Enthusiasts.  Getting Started with Arduino
0 notes
theiotprojects · 14 days ago
Text
Overview In this tutorial, we will learn to make Distance Measurement using the HC-SR04 Ultrasonic Sensor and Arduino. We will also learn the Working Principle of HC-SR04 Ultrasonic Sensor and Hence Provide a Program Code to measure the distance. Hope you’ll enjoy it. Distance Measurement using HC-SR04 Ultrasonic Sensor and ArduinoOverviewAbout this ProjectComponents and Supplies Working Principle of HC-SR04 Ultrasonic Sensor Circuit Diagram of this projectSource Codes/ProgramVideo TutorialConclusion About this Project Honestly, I always love these types of tracking devices. Because I came to know about this tiny device from spy movies. I thought they were so cool and hoped to get one on my hands. I searched on many online stores to buy a similar type of products but, I came to know that they don’t sell those sorts of the device outside. Now, my curious nature started thinking If I could manage to build myself. Few days before I had bought an Arduino Starter Kit. Suddenly I opened the box and search for the sensor. Actually, The ultrasonic sensor that was included in my Arduino Starter Kit was the main reason I got into this.&nbsp; I started looking up for projects online, found numerous tutorial but, none of them work for me. I tried to make my “dream-device” through my coding skills. And Finally, the end was pretty much worth. I know, it is missing a lot of features but, also it was pretty much a Kickstarter for me to follow new projects afterward. Hopefully, those who are just getting into this stuff, will be a Kickstarter project for everyone, and I hope you'll enjoy it!  Components and Supplies The Components required for this project are mentioned in the following points:&nbsp; * Arduino UNO&nbsp; * USB Cable&nbsp; * Ultrasonic HC-SR04&nbsp; * LCD1602 Screen&nbsp; * 10kΩ Potentiometer&nbsp; * Few jumper wires&nbsp; Working Principle of HC-SR04 Ultrasonic Sensor This tutorial uses the popular Parallax PING ultrasonic distance sensor HC-SR04 to measure the distance to an object. The range of this module is ranging from 2cm to around 4m. Actually, the Ultrasonic sensors provide the measurement of the time that it takes for sound to bounce off an object and return back to the sensor. The “ping” sound pulse is generated when the pingPin level goes HIGH for 10 micro-seconds. The module will generate a pulse that gets terminated when the sound returns back. The width of the pulse is proportional to the distance of the sound traveled and we use the pulseIn() function to measure that duration.&nbsp; Working Principle of HC-SR04 Ultrasonic Sensor We all know the speed of sound is 340 meters per second, which is 29 microseconds per centimeter. The formula to calculate the distance of the trip is( RoundTrip) = microseconds / 29. Hence, the formula for the one-way distance in centimeters is: microseconds / 29 / 2&nbsp; Circuit Diagram of this project   Know More About Arduino from here: Getting Started with Arduino UNO | Getting Started For Beginners LCD VSS pin to groundLCD VDD pin to 5VLCD Vo Pin to Center Pin of PotentiometerLCD RS pin to digital pin 12LCD R/W pin to groundLCD Enable pin to digital pin 11LCD D4 pin to digital pin 5LCD D5 pin to digital pin 4LCD D6 pin to digital pin 3LCD D7 pin to digital pin 2Potentiometer Ends to +5V and groundHC_SR04 Ultrasonic VCC pin to +5vHC_SR04 Ultrasonic GND pin to GNDHC_SR04 Ultrasonic Trig pin to Digital pin 7HC_SR04 Ultrasonic Echo pin to&nbsp; Digital pin 6 Source Codes/Program First of all, you have to define TrigPin and EchoPin on the program codes. In this project, I have set TrigPin to the Digital Pin 7 and EchoPin to Digital Pin 6 on the Arduino Board. Similarly, the long variable named “Duration” to get travel time from the sensor. And integer variable is used for “Distance”. In the setup, we need to define The Echopin as an INPUT and TrigPin as an OUTPUT. &nbsp; #include // includes the LiquidCrystal Library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7) const int trigPin = 7; const int echoPin = 6; long duration; int distanceCm, distanceInch; void setup() lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); void loop() digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distanceCm= duration*0.034/2; distanceInch = duration*0.0133/2; lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be displayed lcd.print("Distance: "); // Prints string "Distance" on the LCD lcd.print(distanceCm); // Prints the distance value from the sensor lcd.print(" cm"); delay(10); lcd.setCursor(0,1); lcd.print("Distance: "); lcd.print(distanceInch); lcd.print(" inch"); delay(10); Video Tutorial https://youtu.be/Sc9q0DCk8uE Conclusion So with this, we came to the conclusion of this Distance Measurement using the HC-SR04 Ultrasonic Sensor and Arduino Project. But, we are going to come up with a lot more interesting articles and various Projects on Arduino and IoT (Internet of Things). So if there’s some project that really you want to know more about please allow us to know within the comment section below. With this thank you and goodbye I hope you have enjoyed reading this article. Please be kind enough to share it on social media.&nbsp; You can comment on any of your doubts and queries and we will reply to them as soon as possible. Actually, you subscribe to our website newsletter to learn more happily.
0 notes
theiotprojects · 15 days ago
Text
The IoT Projects Welcome you to this interesting article on Top 10 Internet of Things Projects. Now in this article, we'll be talking about the Top 10 Projects which are outstanding themselves in the Internet of Things. Now before talking about each of these projects let me start off with a simple introduction to what is the Internet of Things? What is the Internet of Things (IoT)? Internet of Things basically is a concept or a technology that aims to connect all the devices to the Internet. And help them communicate with one another using the internet as a medium. Basically, these devices can be anything, it could be a TV,  Mobile phone, watch or even your car. Actually, anything that can be connected to the Internet can be considered as a device for the Internet of Things (IoT).The intention of using the Internet as a medium of communication is to help you to achieve a wider and greater reach. But, the end aim of the Internet of Things is to help you create a smart world. So, this was a short introduction to what is the Internet of Things (IoT). You can read more about IoT in our previous post.  Now let's talk about each of these projects. Top 10 (IoT) Internet of Things Projects of 2020Air Pollution Monitoring SystemStreet Light Monitoring SystemSmart Irrigation SystemBiometric SystemSecurity Camera and Door Unlock SystemSmart Home SystemSmart CityZelda OcarinaSmart Parking SystemJarvis Personal AssistantFinal ThoughtsConclusion on Top 10 IoT Internet of Things Projects Air Pollution Monitoring System Air pollution is a major common problem in today's world. Usually, Air pollution brings lots of diseases. As you know every month people suffer from a new disease. Let’s take an example now coronavirus is spreading all around the world. One of the main reasons behind the spreading of this virus is due to polluted air. Different particles like mold spores, lead, carbon dioxide, sulfur dioxide, and pollen are the main factors for polluting air. Hence, this polluted air brings lots of new diseases. Nowadays, it is very essential to measure and monitor the air pollution level in an area. Different Research on IoT projects has brought a new solution. Recently, invented&nbsp; IoT devices can do regular monitoring of air pollution levels and save data to the web servers. Usually, IoT project inventions like air pollution meters bring a solution to the existing problems. Unlike previous air pollution meters, this device uses the Internet to save data to the webserver. Hence this device will not get out of Memory and we can check log data remotely from anywhere in the world. This project is built on the Arduino Uno platform. The main feature of this project is it can be used to detect flammable gas leaks as well. Street Light Monitoring System According to our research, street light consumes more than 20% of the world's energy. Most of the street lights remain ON all the time due to the lack of a light monitoring system. But, newly discovered ideas like IoT based street lights monitoring system brings a solution. Basically, this project consists of sensors that monitor vehicles and people around the lights. This means when the sensor detects any movement the lights are ON otherwise remains close. Usually, the device sense the movement around it and then the sensor sends a signal to the Microcontroller. After that, the device takes action according to the received signal. If no movement is found Microcontrollers Switch Off the lights. Actually, with this IoT project, we can save lots of energy. It has special features like automatically shut down during day time, which saves energy. Smart Irrigation System Next, we have a Smart Irrigation System. Let you are someone who personally likes gardening a lot. Now, this is something that would really make your life easier. Because usually what you can do is that on Sundays you spend your two hours just watering and looking after your plants.
Through a smart irrigation system what it does is that it checks the moisture present within the environment. Or the moisture present in the soil using the sensor. Again, to help you understand how it works? Usually, there are two main Internet of Things devices that you can use which are the Adreno board and the Raspberry Pi. Your Raspberry Pi becomes the main processing unit and you can place an Arduino board for each of your water channels. These Arduino nodes themselves are connected to multiple sensors that are part of this water channel. So what these sensors do is that they check the moisture present in the soil. As such, let's assume that a specific link does not meet the minimum required moisture. Then what it would do is that it would send a signal to the Raspberry Pi.&nbsp; Again all these devices are connected on the same wireless router network. Now, the Raspberry Pi would identify the lack of moisture and pass a signal to the relay. The relay, in turn, would initiate the water pump and water would be irrigated.&nbsp; Now in order to ensure that water is not wasted. We would create gate controls.&nbsp; Only the gate where the moisture is a smaller amount would the gate be open. Once your sensor detects that the moisture level has gone beyond my required limit, it would again send another signal to the Raspberry Pi. Asking it to stop the pump as well. Hence,&nbsp; this, in turn, helps you to save a lot of water and also makes your life quite easier. So after this, your only task in your garden would be either setting up new plans or creating a new water channel. Biometric System A biometric system is something that we always encounter on a daily basis. Because we always either use a fingerprint sensor or use an iris scanning even to unlock our phones. Being on the age of 2020 attendance at school, colleges, and offices is done with A Biometric System.&nbsp; So, it depends from organization to organization. But, how does this System actually work?&nbsp; Let us take a case of this example. let the system have a fingerprint scanner. Now when you are presenting your fingerprint for the first time. The system scans the fingerprint and considers this as part of an enrollment process. From this fingerprint template what it does is,&nbsp; It extracts certain key features that make it different from others. Then stores it into a database. After this process, the system forwards the data every time that I placed my finger on top of this fingerprint scanner. Firstly, it creates a template and compares this with all the templates that are present in the database. Secondly,&nbsp; if it matches then correspondingly it gives you attendance. or lets me access a Door. Finally, if it does not match the Biometric data, then it raises an alert. Again, this is just a foundation. As I said this biometric system can be a fingerprint, Iris scanning or it can be a combination of both as well. The voice recognition system is one of the key products in the Biometric System. Security Camera and Door Unlock System Next, the project on our list is a security camera and door unlock system. Now, this is something that's quite interesting.&nbsp; I've personally tried to start out and it's really something that you just should try out. Here what happens is that you simply place a camera on top foot door which successively clicks the photo of an individual, who comes into the frame. Now, this photo is sent to an analytical system that compares this with all the photos that it possesses.&nbsp; In order to identify whether to let the user open the door or not. Basically, an evolution to this is that if it does not find a photo of that person. It can notify the concern that this person is trying to access this door. Would you like to authorize this person? Also, the system adds his information to the database or would you like to deny access to this person as well. Usually, this is used in areas where you have highly sensitive information stored.
In order to maintain strict control over access to this information. Another usage of the security camera and unlock system can be even useful at our homes. Using this system we can identify who is coming to our home when we're not there. And either decide to give them access to our homes or not as well. Smart Home System Now the next thing is a few things that we all really desire to possess which could be a smart home system. The smart home system can be something that really makes our life quite easy. Starting from energy management where the light control system, the AC, the appliances that we use, the thermostat all of these things are managed. In short, trying to cut down the power consumption that's taking place in my door management system is also part of this Smart Home System. It is also part of my water irrigation system as well. Again, these are key things that really stand out in the smart home system. But, again what I would personally recommend is that the limitations of a smart home are where our imagination stops. Anything that you wish to automate or may wish to make your life easier can be part of a Smart Home System. Basically,&nbsp; a smart home System usually is going to be a base for our next project which is a Smart City. Smart City Actually,&nbsp; A smart city is an evolution of a smart home. Here it's not just the sensors of a single home that is connected. Smart City is the correlation or a network or a connection between various organizations’ various domains as well as various segments of that city. The life of every single dependent person in that city becomes easier as a whole additionally.&nbsp; In turn, it will really help to develop that city to a greater extent. Now, the key factor here for a smart city is government support as well. If the government is really willing to take this step then I hope we would see a smart city completely built on the Internet of Things. Maybe in the next five to ten years, we can see this project in real life.&nbsp; Zelda Ocarina The next project is something that really stands out on a personal level. This is Zelda Ocarina’s controlled home automation system. This is personally something that I feel is the closest to a smart home system. Well, most of the elements of the home are completely controlled by an ocarina. What Allen pan has done here is that he's created a node-based recognition system that completely automates his home. But, rather than telling more about this. let's just look at a quick video that will give you a glimpse into how he has done this and what has he done?&nbsp; https://youtu.be/glZnkpIDWSE Smart Parking System Nowadays, Finding parking space is one of the problems for the driver. Sometimes lots of time is wasted to find a parking spot. But, now the IoT based project called smart parking system brings a solution. The main theme and purpose of discovering this project are to avoid unnecessary traveling by a driver for the parking spot. Basically, this device monitors the whole area even while driving and provides an entire image of the parking spot. It also provides a facility to choose the free parking space and park their vehicles. This project is completely based on the Daily Life Problem solution using IoT.&nbsp; The infrared proximity sensor and IR Sensor can be used for discovering free parking space. Jarvis Personal Assistant The number one IoT project if you've not already guessed is Javis. Javis is the artificial intelligence system that Facebook's creator Mark Zuckerberg has built for his home automated system. I am quite sure you've already seen the video of Mark Zuckerberg interacting with Jarvis that has Morgan Freeman's voice. If you have not here is a quick glimpse into the same. https://youtu.be/ZGLPxEv_EWo Final Thoughts Now what you need to understand here is that the Internet of things is not something that is just dependent on a sensor or a few sensors which are connected to a Raspberry Pi or an Arduino.
When I check out the whole architecture of IoT. This is a complete ecosystem where my sensors gather information. That is again stored on a platform and then processed.&nbsp; If there have been any issues or failures that have been reported by these sensors then, I really need to create actionable items in order to ensure that this is never really repeated again. But, the information, once it’s been processed the processed data, is then passed into machine learning and artificial intelligence in order to understand analyze and identify various patterns. It also helps to pass this information back to the sensor. This, in turn, helps you to have a better experience and also improve the system as a whole.&nbsp; A system where I come home every day at 8:30 start off my AC and wait for 15 minutes for it to cool down. This is really a tedious process. But, today my Internet of Things (IoT)&nbsp; platform identifies this pattern and already switches on the AC at 8:15. Then I just need to come home and I can relax right away.&nbsp; This is one of the key examples or one of the key ideas that are out there today and the limitation here again is just your imagination. Conclusion on Top 10 IoT Internet of Things Projects You can find lots of IoT projects on the Internet. But, These Top 10 IoT Internet of Things Projects presented here will change our lifestyle. We are still working on IoT based Projects. Because it is a blessing to the new world with a huge source of solutions. So with this, we came to the conclusion of this Top 10 IoT Internet of Things Projects. But, we are going to come up with a lot more interesting articles and various Projects on IoT (Internet of Things). So if there's some project that really you want to know more about please allow us to know within the comment section below. With this thank you and goodbye I hope you have enjoyed reading this article. Please be kind enough to share it on social media.  You can comment on any of your doubts and queries and we will reply to them as soon as possible. Actually, you subscribe to our website newsletter to learn more happily. You Love IoT Projects? Some of them are here: NodeMCU ESP8266 Monitoring DHT11/DHT22 Temperature and Humidity with Local Web ServerRFID Based Attendance System Using NodeMCU with PHP Web AppTemperature Controlled Home Automation using ArduinoIoT Based Voice Controlled Home Automation Using NodeMCU & AndroidESP8266 based Coronavirus Tracker for your countryInternet Clock Using NodeMCU ESP8266 and 16×2 LCD without RTC ModuleIoT Based Flood Monitoring System Using NodeMCU & ThingspeakHome Automation with MIT App Inventor and ESP8266Capacitive Soil Moisture Sensor with OLED Display & Arduino
0 notes
theiotprojects · 16 days ago
Text
Introduction to Raspberry Pi Raspberry Pi today has become so common that you can find it across most household items. Today it has become one of the cheapest and common computing devices that can be found almost everywhere. But let’s actually go back to understand the ideology which bought a Raspberry Pi into development itself. So, today we will learn what is Raspberry Pi? Introduction, Capabilities, OS Installation, Hardware Specifications, and Hands-on review. Raspberry Pi: Introduction, Capabilities, Installation, and Hands-onIntroduction to Raspberry PiWhat is Raspberry Pi?Capabilities of Raspberry PiHardware Specification of Raspberry PiRaspberry Pi 3 Hardware:OS installation on Raspberry PiDownloading The Raspberry Pi Operating System Rasbian OS Installation ProcessConclusion Now, Raspberry Pi basically, was bought by the Raspberry Pi Foundation to introduce or to bring in Information Technology(IT) back to the schools. Where students can learn how to program from scratch. The growth of technology today has grown to such a level, that everyone today has ease of access to do anything on a computer. But, back in the early late ’90s and 2000, to use computers you need to know how to program and how to work around with respect to it. So, this, in turn, have to build a very strong foundation for programming knowledge.&nbsp; Actually, with the growth of UI, everything has become so easy that today you don’t need to learn to program to use computers. But, at the same time, this has made it harder for people to identify and understand good programmers from those who are not. So, in order to build a generation, which starts with a very strong programming foundation and fundamentals. The main ideology was to introduce or take back IT to the basics. And hence made it accessible across every school as well. I have already told you it was introduced by the Raspberry Pi Foundation in 2012. What is Raspberry Pi? Moving Forward, What exactly is Raspberry Pi? This is one of the questions most of you would have across your mind as well. Because you might have heard about Raspberry Pi but might still not have clarity. So, Let me help you clarify that right away. Now as per the definition of Raspberry Pi basically is a series of very small single-board computers. Which actually have additional features like Bluetooth, WiFi, USB Capabilities, General input/output ports. Basically, it is a very small low-cost credit card computer. Which actually can be plugged into any Monitor as well as include a keyboard and Mouse. It increases the capability to explore, learn and understand how to program. Now, the latest version of Raspberry Pi is Raspberry Pi 3, which was released in February 2016.&nbsp; Raspberry Pi basically is a combination of Raspberry Operating System and Pi which basically stands for Python Programming Language. https://youtu.be/uXUjwk2-qx4 Learn more about Raspberry Pi Capabilities of Raspberry Pi Here are the capabilities of Raspberry Pi: Browse the Internet and play HD Videos: It enables you to browse the Internet and play HD videos as well. All you need to have is an HD video supported Display.Making Documents, Spreadsheets, and presentations: It can do basic Operations like making Spreadsheets, WordProcessing and Presentation. All these can be done on Raspberry Pi.Play Games: Here, huge sets of games that are available. Which can be Played on Raspberry Pi. Making it quite interesting and easy for people to enjoy the component as well.Infra-red Cameras and Security System: Then you have various add-on capabilities like infra-red cameras and security systems. Which can be built keeping Raspberry Pi as the core hardware.Music- Machines and detectors for weather stations: You can also muse many music machines as well as the detection of weather stations. Which we actually had done in our previous session. These are just some of the top capabilities that I have picked up from the list.
Raspberry Pi today has become one of the biggest components that has enabled users to achieve and create a lot as well. Today the capability of Raspberry Pi is restricted just to your imagination. &nbsp;Whatever, you can imagine can be done using Raspberry Pi. Hardware Specification of Raspberry Pi Now, let’s look at the Raspberry Pi hardware. Here in the picture, you can see the components of Raspberry Pi. You can see HDMI port, Charging port, SD card slot, GIPo pins, USB ports, Ethernet port, Audio Port, Processor and System on Chip, etc. CSI Port for connecting Camera directly to Raspberry Pi. Finally, the DSI Port which is the &nbsp;Display Serial Input Port. Raspberry Pi 3 Hardware: Hardware Components of Raspberry Pi 3 Processor: Broadcom BCM2837 SoC, 1.2 GHz, 64bit Quad Core ARM Cortex-A53 processor.RAM: 1 GB (Shared with GPU)Networking: 10/100 Mbit/s Ethernet, 802.11n Wireless, Bluetooth 4.1Peripherals: USB 2.0 Ports, 3.5 mm Audio Input/Output port, Standard HDMI Port, and SD-Card Slot.Video: H.265 decoding hardware, full HD video can be played on the HD display.Connectors: 17xGIPO plus the same specific functions and HAT ID Bus. OS installation on Raspberry Pi Let’s begin the Raspberry Pi installation process here. Note: The Raspberry Pi Foundation recommends the use of Rasbian, a Debian- based Linux Operating System. Now, Let’s look at the different Operating Systems that are available at present for Raspberry Pi. Basically, Raspberry Pi itself supports multiple Operating Systems. But we will mainly be working on Raspbian OS. Okay, these are some of the most popular Operating Systems supported on Raspberry Pi. RISC OSFreeBSDNetBSDPlan 9 from Bell LabsWindows 10 IoT Note: For this session, we’re not going to go into the Windows 10. We will stick to the core Raspberry Pi Operating System. Downloading The Raspberry Pi Operating System Now for downloading the operating system for Raspberry pi. You can go to the official site i.e Rasberrypi.org. Here, you can see the downloads tab, by clicking on it you can go to the downloads page to download the Raspberry Pi Operating System. Now if you are starting with Raspberry Pi and the Internet of Things (IoT). Trust me, this is the best place that you can find a lot of information with respect to it. You can find a lot of help as well as good information to get started with your projects. Okay, I would recommend that you go with NOOBS Package. Because this is a complete package with respect to different Operating Systems. Again You will have two Options NOOBS and NOOBS Lite. My recommendation will be NOOBS. But, make sure you use a 32GB Memory Card of Class 10 to get better performance. Actually, Do not make me wrong, you can install OS on 8GB Memory Card as well. But, trust me you will have the worst experience with it. Because the system has less memory to work. Once you Download the File extract the Zip file. It may take some time to extract the zip file. Now, copy each and every file and folders that are inside NOOBS Folder and paste it to your SD_Card. Note: Do not directly copy-paste the extracted file. If you do so, It actually, do not recognize the OS as part of Rasberry Pi. Hence, Copy everything that you have extracted and then paste it to SD-Card. Again, this is why I recommend a high-class memory card. Because it takes a lot of time with respect to fetching the data. Also, Read: DIY Mobile Phone using Nextion Display and Arduino Rasbian OS Installation Process Now, let’s insert the Memory Card to the Raspberry Pi and Begin the Operating System installation. Just turn on Raspberry Pi.Now, installing process gets initiatives. So, the Raspberry Pi is getting loaded.Here Choose Rasbian OS and click on Install.Choose the corresponding Language as per your requirements.Click Yes because we are going to format our data and begin afresh OS Installation process.After the process gets completed. Click on Ok to reboot the Raspberry Pi.
Now as you can see the Raspberry Pi Operating System has successfully been installed. So, this is your Raspberry Pi OS would be looking like. Conclusion Today we have learned actually, What is Raspberry Pi? Introduction Capabilities Installation and Hands-on. Even we have gone through Raspberry Pi 3 hardware Specifications and Features. I hope you loved this article. We will bring more amazing content like this. Please let us know if you have any doubts and queries left regarding today's topic " What is Raspberry Pi? Introduction Capabilities Installation and Hands-on". Subscribe to our Newsletter and Never Miss any updates.
0 notes