An IoT project using a Raspberry Pi Pico W to monitor temperature and humidity, sending data to a backend server and displaying it in a real-time React dashboard.
- Real-time temperature and humidity monitoring
- LED indicators for temperature status
- REST API for data communication
- WebSocket for real-time updates
- React frontend for data visualization
- Node.js installed
- Python installed
- Raspberry Pi Pico W with MicroPython
- MongoDB for the backend database
-
Clone the repository:
git clone https://github.com/JwanMardini/RaspberryPi-IoT-Dashboard.git cd RaspberryPi-IoT-Dashboard/server
-
Install dependencies:
npm install
-
Create a
.env
file in thebackend
directory with the following content:MONGO_URL=your_mongo_url PORT=your_port
-
Start the backend server:
npm start
-
Navigate to the frontend directory:
cd ../client
-
Install dependencies:
npm install
-
Create a
.env
file in thebackend
directory with the following content:VITE_WS_URL=your_websocket_url
-
Start the frontend development server:
npm run dev
- Flash MicroPython on the Raspberry Pi Pico W.
- Copy the Python script to the Pico W and ensure the necessary libraries are included.
- Create
keys.py
file in lib folder - Update the URL in the
keys.py
file to point to your backend server. - Update WIFI_SSID in the
keys.py
file - Update WIFI_PASS in the
keys.py
file
- Power on the Raspberry Pi Pico W.
- Access the React dashboard via the frontend development server.
- Raspberry Pi Pico W: Collects temperature and humidity data and sends it to the backend.
- Backend: An Express.js server with a MongoDB database to store and serve data.
- Frontend: A React application to visualize the data in real-time.
- Pico W reads data from the DHT sensor.
- Data is sent to the backend server via a POST request.
- Backend stores the data in MongoDB.
- Frontend fetches data from the backend and displays it.
- WebSocket used for real-time updates to the dashboard.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.