In an era of increasing environmental consciousness, what if you could elevate your commitment to the planet by building a drone that monitors air quality and weather conditions around you remotely? In this comprehensive guide, I'll walk you through the step-by-step process of constructing your drone using cutting-edge hardware components and powerful software tools.
Building Instructions:Roll your sleeves and get ready for building your drone.
Step 1:Assemble Frame
Assemble the base layer of your drone frame. Attach the brushless DC motors to each arm of the carbon fibre drone frame. Solder ESCs to the Power distribution board along with an additional cable for connecting the battery. Connect the ESCs to the motors and make sure that motor 1 & 3 rotate clockwise and 2 & 4 rotate anti clockwise.
As very high amounts of current will be flowing through the distribution board, it’ll be a good idea to insulate it properly to be safe.
Step 2: Mountingthe Controllers
Now, let’s start putting together all the components and sensors. Follow this to connect the devices and sensors to the respective pins.
Attach Blues Swan 3.0 and Blues Notecard to the Notecarrier F and place on the top of the drone, secure it with screws or cable ties to the drone frame. Attach the LTE and GPS antenna to the Notecard.
Step 3:Configure Transmitter / Receiver RC
Bind the FlySky i6X or any other 2.4 Ghz Radio Controller to your receiver and set it up to send data in PPM mode. Connect the receiver to D13.
Step 4:Connect IMU
Mount the MPU6050 as close to the centre as possible in a perfect horizontal position. Placement of MPU6050 is critical for the drone as it is the main sensor that drone uses to balance itself in the air. Connect it to the I2C interface of the Swan.
Step 5:Connect Air Quality Sensor
Connect MQ135 air quality sensor’s analog pin to A5 pin of the Swan. This sensor should be placed at the top of the drone to get better reading and avoid interference from motor thrust.
Step 6:Connect Motors
Time to connect all the motors. Do NOT connect the propellers yet!
Considering the configuration is
Start with the bottom right as Motor 1 and move clockwise Motor 2, Motor 3 and Motor 4 and connect signal pins of them to D5, D11, D9 and D12 respectively.
Step 7:Power Connections
We connected all signal pins of all the components but not the power pins. All the devices and sensors work on 5V. The best place to get regulated 5V is from one of the ESCs input connectors. You can use the RC receiver as a distribution board. Connect VCC and GND pins on the input connector of one of the ESCs to the VCC and GND pins of the RC receiver. You can use all remaining parallel VCC and GND pins of the RC to power the devices.
Step 8:Wrap it Tight
Use cable ties to secure all the wires and devices properly so nothing comes near propellers. When the drone is in action, there’ll be a lot of vibration and powerful movements. Make sure everything mounted is tight enough.
Step 9:Coding and Uploading
Coding and Uploading is fun!
Now that we have all the hardware in place and mounted everything on the drone frame, it is time to upload the code to Swan. Open the provided code in Arduino IDE.
Add Blues board configuration to the Arduino IDE.
Goto Settings > Preferences
Paste this link to
Additional Boards Manager URLs:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
Now, go to Tools > Board > Boards Manager
Search for “STM32”
Install STM32 MCU based boards
Now select Board:
Tools > Board > STM32 boards group > Blues Wireless boards
Select board part number:
Tools > Board part number > Swan R5
Select Upload method:
Tools > Upload method > STM32CubeProgrammer (DFU)
Install STM32Cube as Arduino uses some drivers to upload the code that comes with this software
https://www.st.com/en/development-tools/stm32cubemx.html
Step 10:Connectivity
Change the Product id in the code with your notecard’s id. For initial testing you can use WiFi, add your SSID and Password and change WIFI_ENABLE to 1. By default notecard will connect to notehub via LTE. Press and hold the boot button when connecting usb.
Upload this code to the Swan.
Step 11: Power On
Connect your battery. Pull both the sticks of the Transmitter to the lowest values (Left bottom). This will enable the drone and start your control loop.
Give a little throttle and check the drone’s response by moving it in different directions. The drone should produce an equal and opposite response of the motors in the direction the drone is being moved. If not, you might want to check the motor connections again.
Step 12:Test with Propellers
Be extremely careful in this step as it is time to attach Propellers!
Connect CW and CCW propellers to the motors.
Start the drone and give very little throttle till the motor starts. Move the drone like you did in the previous step and check if you feel that the drone is trying to compensate for the movement by increasing the thrust in the right directions.
You might need to adjust the PID parameters as they are sensitive to different configurations, overall weight and other factors. You need to use trial and error methods to get a perfect combination of parameters. Start with adjusting P, then I and at the end D to get smooth flight. Make sure you take extreme caution when testing your drone, as even little extra throttle can lead to serious injuries.
Step 13:Ready to Fly!
All looks good, let’s take the drone for a spin. Go out to an open space away from people, buildings, windows, kids and anything that can break or cry!
If you followed everything correctly you should get events on the notehub.io
There's well written documentation around how to forward the incoming message from notehub to other cloud platforms.
Follow the instructions for Datacake integration to visualize your drone data.
https://docs.datacake.de/integrations/blues-wireless-notecard
Congratulations! you've successfully built a drone capable of monitoring air quality and weather conditions. As your drone takes flight, contributing valuable data to your notehub.io account and Datacake dashboard, you'll have an active role in environmental monitoring.
May your drone soar high, contributing to a cleaner and healthier world! Happy flying!
Comments