Wind Direction and Environmental Monitoring System
by falia_04 in Circuits > Microcontrollers
85 Views, 0 Favorites, 0 Comments
Wind Direction and Environmental Monitoring System
This project involves the creation of a weather station capable of monitoring environmental parameters like wind direction, temperature, humidity, and air quality (carbon monoxide). The system is designed to be deployed outdoors in various weather conditions, ensuring durability with weatherproof casing. Using a Raspberry Pi Pico microcontroller, a combination of off-the-shelf sensors, and DIY sensors, this project integrates the core principles of IoT systems, combining hardware, connectivity, and cloud-based data visualization. The goal is to collect environmental data and display it in real-time through a monitoring dashboard.
Supplies
Hardware Components:
- Raspberry Pi Pico (Microcontroller)
- DHT22 (Temperature and Humidity Sensor)
- Carbon Monoxide Sensor
- IR Sensors (For wind direction measurement)
- Breadboard (For wiring connections)
- Bearing (To allow rotation for wind vane)
- Cardboard (For creating the wind vane tail)
- Hot Glue Gun (For assembling the components)
- IP66 Enclosure Box (Weatherproof casing for all electronics)
- Wires (For connecting the components)
- Power Supply (Power bank for deployment)
- Plastic Bottle (For weatherproofing the sensors)
Tools:
- Soldering Iron (For connections)
- Scissors/Cutting Tools (For cutting)
- Drill (For holes in the enclosure box to thread wires)
- Hot Glue Gun (For securely attaching components)
Place the DHT22 and CO Sensor
- Prepare the plastic bottle: Start by using a plastic bottle to house the sensors. The bottle will protect the sensors from rain and other weather elements.
- Insert the DHT22 and CO sensor: Place the DHT22 sensor (temperature and humidity) and the Carbon Monoxide sensor inside the bottle. Ensure that both sensors are positioned correctly to collect accurate data. You can secure them using a small amount of hot glue.
- Seal the bottle: Once the sensors are in place, securely glue the cap or opening of the bottle to prevent rain from entering and interfering with the sensors.
- Attach the bottle to the IP66 enclosure box: Drill small holes in the enclosure box to pass the wires of the sensors through. Use the hot glue gun to seal the edges of the bottle to the enclosure, ensuring everything is waterproof.
Building the Wind Direction Mechanism
- Create the wind vane: Cut out the tail of the wind vane from cardboard. Attach it to the rotating shaft using a bearing. The bearing will allow the wind vane to rotate smoothly in response to changes in wind direction.
- Mount the wind vane to the base: Attach the wind vane to a pipe or another stable structure. Ensure the rotating shaft is securely fixed inside a bearing so the vane can rotate freely.
- Prepare the IR sensors: Use 4 IR sensors and glue them onto a white circular base (you can use a small piece of cardboard or plastic). These sensors will measure the rotation of the vane to determine wind direction. Ensure they are placed in a way that each IR sensor will detect a position as the vane rotates.
- Install the bearing: Install a bearing inside the wind vane mechanism to ensure smooth and easy rotation, even with light breezes. This step is important for ensuring that the wind vane can rotate without resistance.
- Light Shielding: Use a circular rubber pipe or plastic tube and cover it with black tape. Place this over the IR sensors to block sunlight. This will prevent interference from the sun and ensure accurate readings from the sensors.
Wiring the Components
- Set up the breadboard: Place the Raspberry Pi Pico and breadboard inside the IP66 enclosure box. Use the breadboard to make all necessary connections between the sensors and the microcontroller.
- Connect the DHT22, CO sensor, and IR sensors: Wire the DHT22 (for temperature and humidity), Carbon Monoxide sensor, and IR sensors to the Raspberry Pi Pico based on their pinout configurations:
DHT22 (temperature and humidity sensor):
- VCC → 3.3V Pin of the Raspberry Pi Pico
- GND → GND Pin of the Raspberry Pi Pico
- Data → GPIO16 on the Raspberry Pi Pico for communication.
Carbon Monoxide (CO) Sensor:
- VCC → VBUS Pin of the Raspberry Pi Pico
- GND → GND Pin of the Raspberry Pi Pico
- Analog Output (A0) → GPIO26 of the Raspberry Pi Pico to read the analog output from the sensor.
IR Sensors (to detect the wind direction):
- VCC → 3.3V Pin of Raspberry Pi Pico
- GND → GND Pin of Raspberry Pi Pico
- OUT →GPIO12, GPIO13, GPIO14, GPIO15 to read the state of each IR sensor.
IR Sensor Pin Configuration (Wind Direction):
- GPIO12 → North direction.
- GPIO13 → East direction.
- GPIO14 → South direction.
- GPIO15 → West direction.
- Thread the wires: Drill small holes in the enclosure to pass the wires through. Make sure the wires are securely threaded through the box and do not have any exposed connections.
Internal Wiring and Sensor Protection
- Sensor protection: Make sure that the sensors inside the plastic bottle are well-sealed. This step ensures they are fully protected from rain and humidity, which could affect their readings.
- Wire management: Ensure that all wiring is neat and securely fastened inside the enclosure to avoid damage from wind or movement.
Database Integration With ThingSpeak
- Create a ThingSpeak account: Go to ThingSpeak and create an account.
- Create a new channel: Set up a new channel for your environmental data (wind direction, temperature, humidity, and carbon monoxide).
- Get the Channel API Key: After setting up the channel, ThingSpeak will provide an API key. This key will be used to send data from the Raspberry Pi Pico to ThingSpeak.
Programming the Raspberry Pi Pico
1. Write the Python code
2. Upload the code: Save and upload the Python code to the Raspberry Pi Pico.
Deploying the System
- Testing: First, connect the system to a laptop and test the data collection every minute. Ensure the data is being sent correctly to ThingSpeak.
- Switch to power bank: Once testing is successful, disconnect the laptop and switch to using a power bank for deployment.
- Install the system: Place the system in the outdoor location, making sure it is securely fixed and oriented properly with "N, S, E, W" marked on the box to ensure accurate wind direction measurements.
Data Collection and Dashboard Setup
- Data collection: The Raspberry Pi Pico will now begin collecting data from the sensors, including wind direction, temperature, humidity, and carbon monoxide levels.
- Create the dashboard: Build a live dashboard on ThingSpeak to visualize the data. Use line charts for trends, gauges for live values, and indicators for system status.