Automatic Retracts For Your Drone

Introduction

Do you own a drone with a camera?  Have you ever taken footage with your camera that would look perfect, if only your landing gear were not in the frame.
Sample of landing gear in camera view

The solution; add retractable landing gear.  In this blog post I am going to show you how to set up a set of retractable landing gear.  Not only that, we are going to automate it's operation.

The Retracts

There are many different types of servoless retracts that you can buy.  You can buy the bare retract modules, the type with wheels for an RC plane or the type that I used with carbon fiber legs like this.
Drone retractable landing gearI bought this set off of ebay for the reasonable price of $32.29 US dollars.  The kit did come in pieces, so I did have to put them together once I got them, but it was pretty straight forward and easy.  once I got them assembled I had to find a way to attach them to my drone.  The drone I am attaching them to is a hexacopter with a 27.5 inch (707.39 mm) arm span from tip to tip of one of the long arms.  
Drone without retractsPart of my issue was that the side arms of the copter were swept slightly forward.  If I was just to mount the retracts perpendicular to the side arms, the gear, when in the downward position would be pigeon toed in toward the front.  Because of this, I wanted a mount that would keep the legs parallel when in the down position.  For this I used some creative 3D modeling and created this.
Retract mount CAD viewThis allowed me to keep the 15 or so degree sweep and have the legs parallel to each other.  Plus it fit around the square tubing used for the arm giving it a solid surface to mount to.  If there is interest in this retract mount I will post it on thingiverse.  Just send me an email and I will post it.  Here is a pic of the drone with the retracts mounted.
Drone with retracts mounted
You will notice that the base of the legs have foam on them.  I just used standard 1/2 inch pipe insulating foam that you can buy at your local hardware store.

The Automation

So now I have this set of retractable landing gear set up on the drone, how am I going to make them work?  I could do the old practice of setting them up to be controlled by a switch on my remote, but where is the fun in that.  Then I'd have to remember to flip the switch when I got in the air and flip it back when I wanted to land.  I found a video on youtube of a guy that built a cheap retract control using an arduino nano.  I thought that I would give it a go.  The only problem was that I didn't have a nano in my stockpile of parts, and the firmware that he had for it was specific to the nano and he didn't release the source code for me to compile it for a different module.  I had a couple pro micro boards in my parts bin, so I worked with that. 

The board is built using a BMP180 barometric pressure sensor which is used for measuring altitude.  Retract control board The board is then configured to retract the landing gear automatically when the drone reaches a set altitude, and then extends automatically when it is below that set altitude.  Being that the guy in the youtube video had not released the firmware source code for his unit, I took to the keyboard and wrote my own.  I have the source code posed on github for anyone interested.  The firmware can be configured with any terminal windo that can connect to a serial device such as the terminal in Mission Planner.  With the firmware loaded and in a terminal window just type "menu" to see a list of the options available.  When settings are changed, they are automatically saved and will be loaded on future restarts of the drone. 

The drone should be sitting on the ground or surface that you are going to launch from when powered on.  Once powered on, the firmware reads the current altitude and sets that as it's baseline measurement for determining when to retract and extend.  The default height for the firmware is 72 inches, or 6 feet.  Once the drone reaches the set height, the legs should automatically retract.  When the drone goes below the set height, the legs should extend down in preparation for landing.  The height that you set should take into account the normal rate of descent and the amount of time that it takes for your landing gear to fully extend.  A slower descent will allow you to set the retraction height lower.  One way to help prevent a hard landing when the legs aren't fully extended is to add a downward facing sonar module set up to slow the descent when close to the ground.

Conclusion

I hope you found this post interesting.  If you have any questions or comments, post them here or send me an email.  Happy flying.

Related Images:

Temperature-humidity sensor

Temperature & Humidity

Description

This post will outline how I built some temperature-humidity sensors for my home automation setup to use in a couple rooms in my house.  I'll explain some of the options I tried before coming to my final design.  I will also give you links to where you can purchase the parts and to download the 3D printer files for the enclosure.

Introduction

This originally started from an idea I had for my home automation setup to put a temperature and humidity sensor in my main bathroom.  The main reason for this was to help a small problem with occasional small mold spots on my ceiling.  This was most likely due to humidity in the bathroom.  When someone would take a shower, they would turn on the vent fan before showering, and then off shortly after.  The problem is that when the vent fan is shut off, there still may be excess humidity in the room that could eventually cause the mold.

The idea was that I could have a controller on the vent fan for the bathroom that would turn on when the humidity reached a certain level, and then would also turn off when below another level.  The two levels would factor in some hysteresis to the equation to prevent the fan from continually starting and stopping when the humidity is near a certain level.   By doing this, the humidity in the room would be dropped to a safe level before shutting off, thus preventing the mold problem.

The temperature-humidity sensor design ideas

So I needed to figure out everything I would need for the project.  My primary home automation setup revolves around MySensors nodes.  Those nodes talk to my Vera Plus automation controller.  I decided to make the temperature and humidity sensor a MySensors node.  The exhaust fan control, which I have yet to do, will be controlled by a converted Sonoff module.  For this article i'll focus on the Temperature and humidity sensor. 

Below is a list of the things I needed to create the sensor.  The basic list was simple

  • A circuit board for the project.  
  • A micro-controller to control the sensor.
  • A temperature and humidity sensor.
  • Some kind of power source.
  • An enclosure to mount the sensor to the wall.

On to building the prototype

Easy/Newbie PCBFor the circuit board, I had a number of the MySensors Easy/Newbie circuit boards, so I thought that would be a good choice.  For that board I needed an Arduino Pro Mini, and an nRf24L01+ radio.  

Now I needed to choose a temperature-humidity sensor.  I had both some DHT11 and some DHT22 sensors.  The DHT22 is a higher resolution sensor, so I originally decided to try that one.  Through some testing with the DHT22 sensor I found that the power consumption was too high.  HDC1080 thumbnailI did some looking and found the HDC1080 sensor.  This sensor connects to the I2C bus and uses very low power.  It's low power consumption made it ideal for use on a battery operated node.   By removing the regulator and power LED from the Pro Mini I was able to run this sensor for a week with no significant power drain on a set of 2 - AA batteries.

The last piece of the puzzle was an enclosure.  The enclosure had to be vented since I was measuring temperature and humidity.  It also needed to be able to hold a battery  or set of batteries.  I figured that I should find the battery box first, and then design the sensor enclosure around that and the PCB.  I settled on this one.

The enclosure design

I have dealt with temperature sensor enclosures before, so I had some ideas on what the enclosure should look like.  temperature-humidity wall boxI turned to OpenSCAD and came up with a basic design.  The box was vented, it had mounting tabs for the PCB and a place to hold the battery box.  temperature-humidity wall plateI decided to make it easy to remove from the wall if needed and made the wall plate with two tabs that the cover could lock on to. 

Since the creation of the first prototype wall box, I have done a couple revisions to the design.  This is what the final design looks like.temperature-humidity wall box V3
Version 3 of the wall box is highly configurable and can be adapted to other configurations if needed.  All versions of the wall box can be found on my thingiverse page https://www.thingiverse.com/thing:2186286

Related Images:

My personal weather station

Description

For a while now I have wanted to add a personal weather station to my home automation system. The idea was to use the data collected for things like controlling when my lawn sprinklers run.  I also plan on using temperature and humididty data to determine things like heating and cooling (HVAC) operations. In this post I will log the ongoing details of my modular personal weather station project. With the help of my new Anet A8 3D printer that I purchased earlier this year, I was able to use it to build all of the parts needed for the project. The project was started a while ago, but I didn't have a place at the time to post my progress, so here it is.

Details

So far I am working on 4 parts to the weather station. Wind speed anemometer, wind direction vane, rainfall gauge and a temperature and humidity sensor. All sensors need to communicate to my home automation system over my MySensors network. I am hoping that I can control all data collection with a single arduino pro mini built on a MySensors Easy/Newbie PCB created by Sundberg84 from the MySensors forum. In this post I will outline each modular section of the project. All of the 3D printed parts for this have been designed in OpenSCAD and will eventually be posted on my thingiverse page.  This post is a work in progress.  Check back to see more information.

 The anemometer and wind direction vane

 The first part of the project that I started with was a combination of two sensors.  An anemometer for measuring wind speed and a wind vane for determining wind direction.weather station wind sensor This is the first prototype design of the 3D printed parts.  Some minor changes have been made since this design.  The first was to invert the center mount sections so the screws screwed in from the bottom.  This put the wind direction vane on the  piece with the square mounting peg and the anemometer was moved to the other piece.  The reason for this was to keep rain from collecting in the small screw recesses and potentially getting inside the case.  The next change which I am in the process of printing as I write this, is a new piece with a round mounting peg instead of a square one.  This was done because of a later decision to mount everything using schedule 40 PVC electrical conduit.weather station wind speed sensor rotor

The anemometer is mounted with a ball bearing that is press fit into the cap.  The shaft, a 1/4 x 20 bolt with a small rotor that has a magnet mounted in one end and that will pass by a magnetic reed switch.  The arduino will use the counted pulses from the reed switch to determine the wind speed. The anemometer cup design was borrowed from a project on thingiverse, but I can't seem to find the original that I used.  The cups, arms and main shaft attachment are all separate printed parts that I have glued together.  This made for an easier build on my 3D printer.

Related Images: