This is our Demo store. We do not accept any payment from here. If some one is asking about payment then contact us on mobile. 9935149636 Dismiss

ADD ANYTHING HERE OR JUST REMOVE IT…
  • Newsletter
  • FAQs
Select category
  • Select category
  • 8051 Projects
  • Accessories
  • Arduino Projects
  • Arduino Projects With Android App
  • Blynk App IOT Project
  • Electrical Projects
  • ESP32 Camera Projects
  • ESP32 Projects
  • ESP8266 Projects
  • Gsm Interfaced Projects
  • Mini Projects
  • Our TOP IOT Projects
  • PI PICO W Projects
Login / Register
0 Wishlist
0 Compare
0 items / ₹0.00
Menu
projectiot
0 items / ₹0.00
Browse Categories
  • ESP32 Projects
  • ESP8266 Projects
  • 8051 Projects
  • PIC Microcontroller Projects
  • Arduino Projects
  • Blynk App IOT Project
  • Our TOP IOT Projects
  • Arduino Projects With Android App
  • ESP32 Camera Projects
  • Electrical Projects
  • Mini Projects
  • PI PICO W Projects
  • Home
  • Shop
  • Track Order
  • Contact Us
  • About us
Awaiting product image
Click to enlarge
Home PI PICO W Projects PI PICO W based DHT11 Temperature & Humidity Data to Mysql Database
Intelligent Transformer Protection & Load Management System
Intelligent Transformer Protection & Load Management System ₹3,000.00
Back to products
Dustbin Status Monitor Using IOT Interfaced
Dustbin Status Monitor Using IOT Interfaced ₹5,000.00Nos

PI PICO W based DHT11 Temperature & Humidity Data to Mysql Database

Compare
Add to wishlist
SKU: AP-974387 Category: PI PICO W Projects
Share:
  • Description
  • Reviews (0)
  • Fill Form & Contact us
Description
https://vimeo.com/51589652
Schematic_Transformer-Overload-protection_Using_Led_2025-02-12

Project Report: IoT-Based Environmental Monitoring System using Raspberry Pi Pico W

  1. Abstract

This project focuses on the design and implementation of a wireless Environmental Monitoring System utilizing the Raspberry Pi Pico W. The system measures real-time ambient temperature and humidity using a DHT11 sensor. The data is processed locally to be displayed on an I2C LCD module for immediate visual feedback and simultaneously transmitted to a remote web server via Wi-Fi. The data transmission utilizes the HTTP POST method to securely send sensor readings to a PHP-based endpoint (insert_data.php), which logs the information into a MySQL database. The system is powered by a 5V DC source and operates on a 10-second data update interval, offering a robust solution for remote data logging.

  1. Introduction

In the rapidly evolving field of the Internet of Things (IoT), the ability to collect and analyze physical data remotely is crucial for applications ranging from smart agriculture to industrial server room monitoring. Traditional data loggers often lack real-time connectivity.

Project Objectives:

  1. Sensing: Accurate acquisition of temperature and humidity data.
  2. Visualization: Local display of data for on-site users.
  3. Connectivity: Wireless transmission of data to a centralized server.
  4. Storage: Permanent logging of data in a relational database (MySQL) for historical analysis.
  1. System Architecture

The system follows a typical IoT node-to-cloud architecture:

  1. Sensor Node: The Raspberry Pi Pico W gathers data from the DHT11.
  2. Network Layer: The Pico W utilizes its onboard Infineon CYW43439 chip to connect to a Wi-Fi access point.
  3. Application Layer: Data is encapsulated in an HTTP POST request.
  4. Server Side: The PHP script located at www.projectiot.in parses the POST data and executes SQL queries to store it.
  1. Hardware Implementation
  2. Raspberry Pi Pico W

The core controller is the Raspberry Pi Pico W, chosen for its dual-core ARM Cortex-M0+ processor and native Wi-Fi capabilities.

  • Voltage Logic: 3.3V System.
  • Role: It acts as the I2C master for the LCD and the single-wire master for the DHT11.
  1. DHT11 Sensor

Used for measuring temperature and humidity.

  • Operating Voltage: 3.3V to 5V.
  • Interface: Single-Wire Serial.
  • Sampling Rate: 1Hz (maximum once per second).
  1. I2C LCD Module (16×2)

A 16-character, 2-line display equipped with a PCF8574 I2C backpack.

  • Interface: I2C (SDA, SCL).
  • Benefit: Reduces the wiring requirement from ~10 pins (parallel) to just 2 pins (serial).
  1. Power Supply
  • Input: 5V DC.
  • Distribution:
    • Pico W: Powered via the VSYS pin (which accepts 1.8V to 5.5V).
    • Sensors/LCD: Powered directly from the 5V rail (sharing a common Ground).
  1. Circuit Diagram & Connections

The circuit is assembled on a breadboard with the following pin mapping:

Power Bus

  • 5V Source (+): Connected to Pico VSYS, LCD VCC, and DHT11 VCC.
  • Ground (-): Connected to Pico GND, LCD GND, and DHT11 GND.

Signal Lines

Component Pin Connected To (Pico W) Description
DHT11 DATA GP15 (Example) Digital Input (Requires Pull-up)
LCD SDA GP0 (I2C0 SDA) Serial Data Line
LCD SCL GP1 (I2C0 SCL) Serial Clock Line

 

Technical Note: While the DHT11 and LCD are powered by 5V, the Pico W GPIOs are 3.3V. In many DIY setups, the I2C pull-ups on the module allow this to function, but level shifting is recommended for long-term industrial stability.

6. Software Implementation

A. Client-Side Firmware (MicroPython)

The firmware running on the Pico W performs the following loop every 10 seconds:

  1. Read Sensor: The dht library queries the sensor.

  2. Display: The machine.I2C library sends the formatted string to the LCD address.

  3. Prepare Data: The temperature and humidity values are packed into a JSON object or a form-data dictionary.

  4. Send Request (HTTP POST):

    • URL: https://www.projectiot.in/dht11/roshan/dht_read.php

    • Header: {'Content-Type': 'application/x-www-form-urlencoded'}

    • Body: temperature=25&humidity=60

  5. Wait: A time.sleep(10) ensures the 10-second interval.

B. Server-Side Backend (PHP & MySQL)

1. Database Schema: The MySQL database contains a table (e.g., dht11_logs) with columns:

  • id (INT, Primary Key)

  • temp_value (FLOAT)

  • hum_value (FLOAT)

  • created_at (TIMESTAMP)

2. PHP Script (dht_read.php): Unlike GET requests where data is visible in the URL, the POST method hides parameters in the body, which is more secure and standard for uploading data.

<?php

// Database Configuration

$servername = “localhost”;

$username = “projectiot_user”;

$password = “password123”;

$dbname = “projectiot_db”;

 

// Create connection

$conn = new mysqli($servername, $username, $password, $dbname);

 

// Check if data is received via POST

if ($_SERVER[“REQUEST_METHOD”] == “POST”) {

    $temp = $_POST[‘temperature’];

    $hum = $_POST[‘humidity’];

 

    $sql = “INSERT INTO dht11_logs (temp_value, hum_value) VALUES (‘$temp’, ‘$hum’)”;

 

    if ($conn->query($sql) === TRUE) {

        echo “New record created successfully”;

    } else {

        echo “Error: ” . $sql . “<br>” . $conn->error;

    }

}

$conn->close();

?>

7. Results and Observations

  1. Local Output: Upon powering up, the LCD initializes and displays the current environment stats (e.g., “T: 32C H: 65%”).

  2. Remote Output: Every 10 seconds, the Pico W LED (if programmed) blinks to indicate transmission.

  3. Data Verification: Accessing the MySQL database (via phpMyAdmin) shows a new row added exactly every 10 seconds with the correct timestamp.

8. Conclusion

This project successfully demonstrates a complete Sensor-to-Cloud pipeline. By using the HTTP POST method, the system adheres to standard web practices for data submission. The 10-second interval provides high-resolution temporal data, making this system ideal for monitoring critical environments where rapid temperature changes need to be logged and analyzed.

Reviews (0)

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Fill Form & Contact us

Loading

2025 CREATED BY http://projectiot.in. PREMIUM PROJECT SOLUTIONS.
payments
  • Menu
  • Categories
  • ESP32 Projects
  • ESP8266 Projects
  • 8051 Projects
  • PIC Microcontroller Projects
  • Arduino Projects
  • Blynk App IOT Project
  • Our TOP IOT Projects
  • Arduino Projects With Android App
  • ESP32 Camera Projects
  • Electrical Projects
  • Mini Projects
  • PI PICO W Projects
  • Home
  • Shop
  • Track Order
  • Contact Us
  • About us
Shopping cart
close

Sign in

close

Lost your password?

No account yet?

Create an Account

HEY YOU, SIGN UP AND CONNECT TO WOODMART!

Be the first to learn about our latest trends and get exclusive offers

Will be used in accordance with our Privacy Policy

Shop
0 Wishlist
0 items Cart
My account