Up until now I have procured and tested all my sensors (see blog #2), so the next step is to put it all together! The last thing I wanted was to wire all my sensors together then have a bunch of problems I would have to troubleshoot at the same time. So, being the good little engineer in training that I am, I added each sensor one at a time and ran the test program for the sensor to make sure that everything was where it needed to be.
Transmitting device (drone-mounted):
Here is a sketch of the wiring for the transmitting device that will be mounted on the drone:
One challenge in creating a power supply for my circuit was that the particulate matter (PM) sensor required 4.5-5.5V power input (but could still operate with 3.3V control) while the rest of the sensors worked with 3.3V power input. For the power supply, I obviously couldn’t use my laptop like I had been doing for the tests because it would be flying on the drone. The MKR 1300 board could operate off of a 3V battery input through the screw connector as long as the 5V pin didn’t need to be used. I used the battery assembly from a flashlight that uses 3 AAA batteries (1.5V each) in series as my power supply. For the 3V power supply to the board, I connected the positive wire after the second battery giving the required 3V. I connected the power supply of the PM sensor after the third battery giving the required 4.5V. I also added 0.1μF capacitors to the 3V and 4.5V power supplies from the batteries to filter out noise and protect the circuit and power supply.
PM and GPS sensors with I2C connections
The GPS and PM sensors communicate with the MKR 1300 board with I2C communication. This allows multiple devices to communicate through the same two pins (SCL and SDA). Each sensor also needed a power supply and ground connection. The PM sensor had a fifth connection, which when grounded indicated that the I2C operating mode was selected. To use I2C, pull-up resistors are required between the power (3.3 V) and the two communication lines (SCL and SDA). The GPS sensor had integral 2.2 kΩ pull-up resistors so no external pull-up resistors were required for the I2C connections.
Waterproof temperature sensor with 1-Wire connection
The waterproof temperature sensor communicated with the board with 1-Wire protocol which also allows multiple devices to communicate through the same port but uses only one digital pin for communication, in my case pin 5. A 4.7 kΩ pull-up resistor from the power (3.3V) to the communication line, as well as power and ground connections were also required.
The TMP sensor was connected to analogue pin A6 and required power and ground connections.
An LED was connected to digital pin 3 with a 220 Ω resistor to act as an indicator light.
The antenna was connected to the board with a micro UFL connection.
Receiving device (ground device)
Because of a limited testing window, I didn’t end up including the LCD screen or indicator LEDs on the receiving board. Therefore, the wiring for the receiving device was simple. It was literally just the antenna with the micro UFL connection and the USB C cable that connected it to the laptop.
For the assembly, I had to install three cable glands in the Hammond enclosure: one for the antenna, one for the temperature sensor, and one for the particulate matter sensor, as these components were going to be mounted external to the enclosure. It was my first-time installing cable glands, but it was easy. I just drilled some holes and screwed the glands on. The next image shows what size hole I drilled for each gland.
I threaded the wires through the cable glands which I tightened for a watertight fit around the wires. The breadboard had a sticker bottom, so I stuck it directly on the bottom of the enclosure. The antenna also had a sticker back which I used to stick it to one side of the enclosure on the outside. For everything else, I used tape to make sure the components didn’t move around.
After everything was assembled, I strapped it to the drone, and I was ready to go! Well not quite ready yet, I still have to talk about my code, but I’ll save that for the next blog post!