DIY IoT Wind Direction & Weather Sensor
by s70632 in Circuits > Raspberry Pi
90 Views, 0 Favorites, 0 Comments
DIY IoT Wind Direction & Weather Sensor
"You don't know you're beautiful", but our project certainly is! We are group One Direction, and while we aren't chasing the spotlight, we are chasing the perfect breeze. We decided to build a DIY IoT Wind Direction & Weather Sensor to prove that environmental monitoring can be smart, robust, and accessible.
Our project is designed specifically for coastal environments where wind is the primary factor. By using a Raspberry Pi Pico W, we’ve engineered a station that tracks wind direction such as N, S, E, W, and beyond. Along with real-time temperature and humidity. Every part of this build was carefully thought out from the heavy duty metal base to ensure stability on the sand, to the custom 3D-printed wind vane we commissioned to get the perfect aerodynamic balance. We are One Direction, and we are here to show you how we navigated the technical challenges of weather sensing!
Supplies
To build this beach ready station, we gathered a mix of high-tech sensors and everyday items:
- The Brain: Raspberry Pi Pico W (chosen for its Wi-Fi capabilities).
- The Direction Logic: 4x IR Sensors (used for our optical encoding mechanism).
- The Climate Tracker: DHT11 Sensor (to measure temperature and humidity).
- The Foundation:
- Round Metal Base: Provides the weight needed to stay upright in beach winds.
- Metal Rod & Bearings: Allows the wind vane to rotate 360° with minimal friction.
- 3D-Printed Wind Vane: A custom-ordered aerodynamic arrow for precise rotation.
- The Housing & Optics:
- 95° Reflective Plate (Using Plastic): The "key" that triggers our IR sensors.
- Stacked Plastic Cups: A DIY shield to keep the DHT11 cool and accurate.
- Small & Large Plastic Containers: Weatherproofing for the internal sensors.
- Black Electrical Tape: Used to ensure the IR sensors only detect our reflective plate.
- Power & Setup: Portable Powerbank, Micro-USB cable, breadboard, and jumper wires.
- Tools:
- 3D printer
- drill
- hot glue
- computer
For data visualization and remote monitoring, the system is integrated with the ThingSpeak IoT platform. The Raspberry Pi Pico W transmits the wind direction, temperature, and humidity data via Wi-Fi to a dedicated ThingSpeak channel. This allows us to view real-time environmental data through a customized web-based dashboard, enabling live tracking and historical data analysis from any location.
The Foundation & Custom Vane
Every weather station needs a strong base so it does not fall over when the wind blows. For our project, we started with a heavy round metal base to keep everything stable, especially in coastal wind. A heavier base gives a lower center of gravity, which helps the structure stay upright.
On top of this base, we mounted a ball bearing directly onto the surface. This bearing became the main rotating point of our system. Then we inserted a metal rod through the bearing, so the rod could stand vertically and spin smoothly at the same time. At the top of this rod, we attached our 3D‑printed arrow vane by sliding it straight onto the rod.
This simple arrangement , base at the bottom, bearing fixed on the base, rod passing through the bearing, and arrow on top , formed the heart of our wind direction mechanism. Because of the bearing, the rod and arrow can rotate freely, so even a gentle breeze is enough to make the vane turn and point in the direction of the wind.
During this stage, we learned something important: physics and design go hand in hand. Even a few grams of extra weight could affect how the vane moved. That’s when we truly understood how delicate and precise weather instruments need to be.
The Optical Direction Mechanism
Now that the vane could move perfectly, the next challenge was figuring out how to read its position digitally. That’s when we turned to infrared (IR) sensors , our way of letting the wind “speak” in data.
Inside the plastic sensor housing, we positioned four IR sensors in a vertical pattern. Then on the spinning shaft of the vane, we fixed a small 95° reflective plate. As the vane turns, this plate reflects the IR signals back to different sensors.
Here’s where the magic happens: depending on where the vane points, certain sensors detect light and others don’t, creating a unique pattern of “High” and “Low” signals. The Raspberry Pi Pico W reads this pattern similar to how a Gray Code system works and instantly translates it into a specific direction like North, South, East, or West.
Building the Radiation Shield
Temperature sensors can be tricky , if the sun hits them directly, they often show higher readings than the real air temperature. To avoid this common problem with sensors like the DHT11, we decided to build our own Passive Radiation Shield.
We used several white plastic cups and turned them into a simple but effective shield. The idea was straightforward: block direct sunlight while still allowing air to move freely around the sensor. We drilled small holes around each cup to improve airflow and stacked them in layers, almost like a small beehive structure. The white surface helps reflect sunlight, and the gaps between the cups let the air circulate, keeping the inside closer to the true ambient temperature.
We placed the DHT11 sensor in the center of this shield, safely protected from direct sun but still exposed to passing air. This kind of setup is commonly used in weather stations to improve the accuracy of temperature and humidity readings without needing expensive professional shields.
What we really liked about this part of the project was how DIY creativity met scientific logic. Using just plastic cups, a drill, and some planning, we were able to apply a real meteorological technique in a low cost way that fits perfectly with our project goals.
Blackout & Weatherproofing
Now that the sensors and vane were set up, it was time to protect the project’s “brain.” Our Raspberry Pi Pico W and power bank were stored inside a durable IP65-rated grey project box. This tough enclosure protects against dust, rain, and salty coastal air basically, it’s like a tiny armored shelter for the electronics.
We carefully organized the wiring so it looked neat and wouldn’t get tangled. It felt good to see how all the components came together inside the box .Almost like setting up a computer inside a mini weatherproof lab.
Then came a tricky discovery: during daytime tests, our IR sensor readings suddenly went wild. After a bit of head-scratching, we realized that sunlight was leaking into the sensor area that make the IR sensors confusing. Our quick solution? Electrical tape! We wrapped the sensor enclosure using black tape on the outside (to block sunlight) and white tape on the inner side (to reflect heat).
It might not sound fancy, but after that simple fix, the sensor readings became rock solid. Sometimes the best engineering solution really is a roll of tape and a good idea!
Cloud Integration With ThingSpeak
After our sensors were working properly, we wanted a way to see all the weather data easily, without opening any code or terminals. So we designed a simple IoT flow where the data moves from the hardware, to the cloud, and finally to our own custom web dashboard.
We programmed the Raspberry Pi Pico W in Python using Thonny , so that it connects to Wi‑Fi and sends the latest readings like temperature, humidity, and wind direction to an online IoT service (ThingSpeak) at fixed time intervals. This platform stores the data in the cloud and makes it accessible through the internet as structured values and charts.
On top of that, our group built a custom dashboard website that acts as the front end. The dashboard is created using web technologies like HTML, CSS, and JavaScript and is designed to pull or display the data that has been uploaded. When we open the dashboard link in a browser, we can monitor the live readings through our own interface, with clearer layout and styling that matches our project theme.
In other words, the weather station stays outside collecting data, the Pico W sends it online, and One Direction simply opens the dashboard page to watch the weather update in real time.
Here we attach the coding in Thonny:
Downloads
Testing & Troubleshooting (The "Trial & Error" Phase)
Before the official deployment, our team ran a full outdoor test to make sure everything worked in real conditions. This step was important because some issues only appear when the hardware faces real sunlight, wind, and longer running time.
One of the first problems we noticed was unstable wind direction readings. This kind of issue often happens when light from the environment interferes with optical or infrared sensors, especially if the housing is not fully shielded. A common solution is to block stray light using darker materials or better enclosures so that only the intended reflected signal reaches the sensor.
Power usage was another key concern. IoT devices that send data frequently over Wi‑Fi can drain batteries faster than expected. Many low power designs solve this by using sleep modes and reducing how often data is transmitted, which helps extend battery life without losing the main functionality of the system.
Through this trial-and-error phase, our group learned how important it is to test early, identify the real cause of each problem, and adjust both hardware and software to make the system more stable and efficient.
Deployment Day
After all the lab testing, it was finally time to deploy our DIY weather station for 7 days at UMT Beach. On the first day, our whole One Direction team was very excited to see the station working in a real coastal environment. We set up the system, fixed the base firmly in the sand, and watched the wind vane start to move with the sea breeze.
However, real-world deployment quickly showed us new challenges. The Wi‑Fi connection at the beach was quite weak, so we had to move to several different spots to find a stable signal for our Raspberry Pi Pico W to connect and send data. At the same time, we noticed that sometimes the data did not update properly on ThingSpeak and our dashboard, which meant there might be issues in the code, wiring, or network flow. As a team, we worked together to check the Python code, confirm the API settings, inspect the wiring, and test the connections until the data started flowing again.
Over the next few days, we kept visiting the deployment site to make sure everything was still running well. There were moments when we had to change the power bank, and other times we needed to inspect the arrow vane to confirm that it was still rotating smoothly and pointing correctly with the wind. By the second day, our wind direction readings became stable, and the data was successfully sent to ThingSpeak and displayed on our dashboard just the way we planned. This day felt like a big milestone for the whole group, because it proved that our system could survive and operate in a real outdoor environment.
What We Gained From the Project
At the end of the 7‑day deployment, our DIY weather station project gave us much more than just graphs and numbers on a screen. It showed us how a complete system can be built from scratch, starting with mechanical parts and sensors, moving through microcontroller programming, and ending with cloud data and a custom web dashboard that anyone can open and understand. Seeing real wind direction, temperature, and humidity values appear on our own interface made all the long nights of building and debugging feel truly worth it.
This project also taught our One Direction team important lessons about teamwork, problem-solving, and persistence. We experienced real field issues like unstable Wi‑Fi, data not updating, power limitations, and the need to physically revisit the site to fix small problems just like real engineers maintaining a live system. Through all of that, we learned how to divide tasks, support each other, and keep improving the design until it worked reliably. In the end, we did not just build a weather station; we built confidence, experience, and a shared achievement that we can proudly carry into future projects.
If this project had an ending theme, our group One Direction would choose a song like “History” or “Best Song Ever” by One Direction to play over the credits as a reminder of all the memories we built together.