HonoSphere - A Temperature and Humidity Monitoring IoT Project Using ESP32 and Cloudflare Workers
Hey everyone! Today, I’m thrilled to introduce HonoSphere – an IoT project that combines an ESP32 microcontroller, environmental sensors, and the magic of Cloudflare Workers to deliver real-time environmental monitoring. In this post, I'll dive into how Cloudflare Workers make HonoSphere free and cost-effective, and why this project is perfect for beginners looking to explore the world of IoT. For the complete source code and more details, check out the HonoSphere repository on GitHub. Table of Contents What is HonoSphere? Why Cloudflare Workers? Tech Stack Overview Getting Started Backend Setup ESP32 Firmware Setup Use Cases Future Upgrades & Attachables Wrapping Up What is HonoSphere? HonoSphere is an innovative IoT project designed to monitor environmental conditions like temperature, humidity, heat index, mold risk, and vapor pressure deficit (VPD) in real-time. It uses an ESP32 and a DHT11 sensor to capture data, then sends this information to Cloudflare Workers where it’s processed and stored in a Cloudflare D1 Database. The data is finally visualized on a dynamic web dashboard built with HTML, Tailwind CSS, and Chart.js. This Project is Useful For: IoT Enthusiasts & Beginners: An accessible project for anyone starting with IoT, ESP32 programming, and sensor integration. Smart Home Automation: Enhance your smart home setup by monitoring and controlling temperature and humidity for optimal comfort. Greenhouse & Agricultural Monitoring: Keep your plants happy with real-time environmental data to adjust watering, ventilation, and heating systems. Office Environment & Indoor Air Quality: Maintain a healthy workspace by tracking and managing indoor climate conditions. Personal Weather Stations: Create your own remote weather station to gather local climate data for personal use or community sharing. Educational Projects: A practical project for learning about sensor networks, cloud computing, and real-time data visualization. Why Cloudflare Workers? One of the standout features of HonoSphere is its use of Cloudflare Workers. Here’s why they make this project an ideal choice for beginners and budget-conscious makers: Free Tier and Cost-Effectiveness: Cloudflare Workers offer a generous free tier, allowing you to run your code at the edge without incurring hefty costs. This means you can deploy your IoT project without worrying about monthly fees or scaling issues. Ease of Deployment: Cloudflare Workers simplify the deployment process. With just a few commands and minimal configuration, you can get your backend up and running in minutes. Low Maintenance: Since Cloudflare Workers are serverless, there’s no need to manage servers or worry about infrastructure. This leaves you free to focus on building and improving your IoT project. Edge Computing Benefits: By running your code on Cloudflare’s global network, you benefit from low latency and high performance, ensuring your IoT data is processed quickly and reliably no matter where you are. Beginner-Friendly Environment: The developer tools, documentation, and community support make Cloudflare Workers a great entry point for those new to serverless computing and IoT projects. Tech Stack Overview Backend Hono.js: A fast API framework that powers our endpoints. Cloudflare Workers: Serverless computing that makes deployment free and easy. D1 Database: A cloud-based SQL database from Cloudflare for storing sensor data. Frontend HTML & Tailwind CSS: For building a sleek, responsive dashboard. Chart.js & chartjs-plugin-zoom: For interactive, eye-catching charts. Hardware ESP32: Your IoT microcontroller that connects to WiFi. DHT11 Sensor: Captures temperature and humidity data. HonoSphere Architecture Visualize the flow of your project with this neat diagram: Installation & Setup Clone the Repository Kick things off by cloning the repository to your local machine: git clone https://github.com/Sigmakib2/HonoSphere.git cd HonoSphere Backend Setup Get ready to deploy the magic on Cloudflare! Cloudflare Workers Project Navigate and Install Dependencies: Jump into the Cloudflare Workers folder and install the necessary packages: cd cloudflare_worker npm install npm run dev Set Up Cloudflare D1 Database: Follow the Cloudflare D1 documentation to configure your database. Below you can see this process: Configure Wrangler Edit the wrangler.jsonc File: Update your configuration to connect to your D1 database and secure your endpoints with an API key: { "d1_databases": [ { "binding": "DB", "database_name": "honosphere", "database_id": "Your-d1_databases-ID" } ], "vars": { "AUTH_KEY": "YOUR_SECURE_API_KEY" } } Tip: The AUTH_KEY is crucial—it's w

Hey everyone! Today, I’m thrilled to introduce HonoSphere – an IoT project that combines an ESP32 microcontroller, environmental sensors, and the magic of Cloudflare Workers to deliver real-time environmental monitoring. In this post, I'll dive into how Cloudflare Workers make HonoSphere free and cost-effective, and why this project is perfect for beginners looking to explore the world of IoT.
For the complete source code and more details, check out the HonoSphere repository on GitHub.
Table of Contents
- What is HonoSphere?
- Why Cloudflare Workers?
- Tech Stack Overview
-
Getting Started
- Backend Setup
- ESP32 Firmware Setup
- Use Cases
- Future Upgrades & Attachables
- Wrapping Up
What is HonoSphere?
HonoSphere is an innovative IoT project designed to monitor environmental conditions like temperature, humidity, heat index, mold risk, and vapor pressure deficit (VPD) in real-time. It uses an ESP32 and a DHT11 sensor to capture data, then sends this information to Cloudflare Workers where it’s processed and stored in a Cloudflare D1 Database. The data is finally visualized on a dynamic web dashboard built with HTML, Tailwind CSS, and Chart.js.
This Project is Useful For:
IoT Enthusiasts & Beginners:
An accessible project for anyone starting with IoT, ESP32 programming, and sensor integration.Smart Home Automation:
Enhance your smart home setup by monitoring and controlling temperature and humidity for optimal comfort.Greenhouse & Agricultural Monitoring:
Keep your plants happy with real-time environmental data to adjust watering, ventilation, and heating systems.Office Environment & Indoor Air Quality:
Maintain a healthy workspace by tracking and managing indoor climate conditions.Personal Weather Stations:
Create your own remote weather station to gather local climate data for personal use or community sharing.Educational Projects:
A practical project for learning about sensor networks, cloud computing, and real-time data visualization.
Why Cloudflare Workers?
One of the standout features of HonoSphere is its use of Cloudflare Workers. Here’s why they make this project an ideal choice for beginners and budget-conscious makers:
Free Tier and Cost-Effectiveness:
Cloudflare Workers offer a generous free tier, allowing you to run your code at the edge without incurring hefty costs. This means you can deploy your IoT project without worrying about monthly fees or scaling issues.Ease of Deployment:
Cloudflare Workers simplify the deployment process. With just a few commands and minimal configuration, you can get your backend up and running in minutes.Low Maintenance:
Since Cloudflare Workers are serverless, there’s no need to manage servers or worry about infrastructure. This leaves you free to focus on building and improving your IoT project.Edge Computing Benefits:
By running your code on Cloudflare’s global network, you benefit from low latency and high performance, ensuring your IoT data is processed quickly and reliably no matter where you are.Beginner-Friendly Environment:
The developer tools, documentation, and community support make Cloudflare Workers a great entry point for those new to serverless computing and IoT projects.
Tech Stack Overview
Backend
- Hono.js: A fast API framework that powers our endpoints.
- Cloudflare Workers: Serverless computing that makes deployment free and easy.
- D1 Database: A cloud-based SQL database from Cloudflare for storing sensor data.
Frontend
- HTML & Tailwind CSS: For building a sleek, responsive dashboard.
- Chart.js & chartjs-plugin-zoom: For interactive, eye-catching charts.
Hardware
- ESP32: Your IoT microcontroller that connects to WiFi.
- DHT11 Sensor: Captures temperature and humidity data.
HonoSphere Architecture
Visualize the flow of your project with this neat diagram:
Installation & Setup
Clone the Repository
Kick things off by cloning the repository to your local machine:
git clone https://github.com/Sigmakib2/HonoSphere.git
cd HonoSphere
Backend Setup
Get ready to deploy the magic on Cloudflare!
Cloudflare Workers Project
- Navigate and Install Dependencies:
Jump into the Cloudflare Workers folder and install the necessary packages:
cd cloudflare_worker
npm install
npm run dev
- Set Up Cloudflare D1 Database:
Follow the Cloudflare D1 documentation to configure your database. Below you can see this process:
Configure Wrangler
- Edit the
wrangler.jsonc
File:
Update your configuration to connect to your D1 database and secure your endpoints with an API key:
{
"d1_databases": [
{
"binding": "DB",
"database_name": "honosphere",
"database_id": "Your-d1_databases-ID"
}
],
"vars": {
"AUTH_KEY": "YOUR_SECURE_API_KEY"
}
}
Tip: The
AUTH_KEY
is crucial—it's what keeps unauthorized users from writing data to your database!
Create & Configure the D1 Database
- Create the Database:
Execute this command to create a new database called honosphere
:
npx wrangler d1 create honosphere
(If you haven’t installed Wrangler yet, run npm install wrangler -g
.)
- Set Up Your Database Table:
Run the schema file to create the necessary table:
npx wrangler d1 execute honosphere --remote --file db/schema.sql
- Deploy Your Worker:
Finally, deploy your Cloudflare Worker:
npm run deploy
Once deployed, you’ll see an endpoint URL in your terminal like this:
https://..workers.dev
ESP32 Firmware Setup
Let’s power up the ESP32!