ArduIMU quadcopter part III

Hi all, I have a new drone in the family...

This tiny drone is able to do completely automatic flights, it can perform altitude hold (based on sonar sensor) and obstacle avoiding based on IR distance sensors (you could see the "black stange eyes" on the photo). It´s your personal droid...

Look at the video (the "tennis game" part it´s funny. Thanks to Ramon for the idea!!)

There are some new features in this thrid part... This is the list:

For outdoor configuration:

- GPS library support (actually UBLOX or NMEA)

- Position hold based on GPS

For indoor configuration:

- 4x IR distance sensors to detect obstacles (1.5m range)

- Obstacle avoiding (using distance sensors)


- Altitude hold based on Sonar (LV-EZ0)

- Automatic flight pattern (experimental).

--- Automatic takeoff

--- Position hold [outdoor] or obstacle avoiding [indoor] during a predefined time

--- Automatic descend

--- Automatic landing

- Added XBee for telemetry (and debug)

And some improvements in the code:

- New "radio test mode" to test radio equipment

- Revised control routines


For the GPS position hold I had to implement the navigation algorithms for the quadcopter because it´s really different that the one used for planes...For this navigation it´s necesary to have the magnetometer to cancel the yaw drift in hover conditions. One thing I have observed is that you can only fly this tiny drone on very calm days because it´s too light for the wind... so it´s better suitted as an indoor drone. Then I started to think how to make a cheap way to navigate on indoor enviroments... I have one sharp IR disntace sensor so I start making some tests mounting the sensor in a servo to make a 180º scan. The idea was to mount 2 (or 4) of this sensors in the moving head.
On the tests I found that in this little machine the moving head caused some inestability, so I decided to mount 4 sensors in a fixed way. OK, this the cheap DIY version of an EXPENSIVE laser range finder, but it works...
there are many thing to improve and test, but it´s a promising start...


Sonar module is an LV-EZ0. Because we don´t have any analog input available I use the PWM interface in a Port Change pin (PCINT20) to use an interrupt to read the sensor. (It´s recommended some solder skills to make this modification).

For the IR range finder (Sharp GP2Y0A02) I needed to use a separate Arduino Pro mini (again we don´t have any analog input free). This module connects to the ArduIMU via Serial port so we need to choose between GPS of range finder (outdoor-indoor decision).

On this III part, the hardware (ArduIMU) really show it´s limits... it´s not a problem of CPU power, it´s a problem of the limited I/O as I said before, so it´s time to move to the big brother, the new ArduPilot Mega Hardware... this new platform will be fantastic for this projects...

Behind the scenes

During the test of position hold I have some crashes (nothing important, only some broken propellers...) and there was a moment in that the quad performs not so good, so I start searching the reason. Again I suspect that it could be a vibrations problem so I decided to make a modified code to test the vibration on each motor.

As you can see I have problems on left motor, so I change this prop, also add a new layer of doubled sided foam tape to the ArduIMU and problem gone.

The code is here: (If you want to use it read the instrucctions)

Respect to the IR distance sensor, the first version was a moving head with a servo but this had some problems with vibrations that affect stability and also has a poor scanning rate, here is a photo of this prototype. Finally I decided to use 4 fixed sensors.


Some parts of this codes are still experimental but you can get it here:

Outdoor code (GPS): . GPS libraries :

Indoor code (IR sensors): External Arduino pro mini code:

Old posts of this project:


E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Moderator

    Robert look at the date of the first post this is a very old thread and things have moved on. Have a poke about for low cost solutions.

  • Good Day, I am looking for a project like this for my kids at schools. Could you give me a rough idea of the cost of this?


  • How soon before there is a ready to install package with full horizontal, and vertical sensor protection? Price?

  • plz i want to ask if i can use this code with Arduimu V3 ?

  • why my rx value from 8ch ppm encoder not Correct. I use receiver futaba r617fs .I connect receiver to 8 ch ppm encoder v.2 and board arduimu v2 follow instructions. I Measure the signal output of the 8 ch ppm encoder is shown picture


    the signal output of the 8 ch ppm encoder



    please help me

  • I was curious to know how it is you are securing your IMU to the quad...I am currently debating several different options for mounting the IMU.

    Thanks in advance for any imput

    btw, the Quad looks great!!

  • Do you have any code that can read sonar sensor value from IMU?
  • Hi, I am a new learner.Sorry, I have one question, since you say

    [ Details

    Sonar module is an LV-EZ0. Because we don´t have any analog input available I use the PWM interface in a Port Change pin (PCINT20) to use an interrupt to read the sensor. (It´s recommended some solder skills to make this modification). ]


    So if I have analog input available , what kind of pin I should use on ArduIMU since I dont use ArduIMU to generate PWM.


  • Developer
    This is the natural evolution of this project (based on Arducopter)
  • Developer

    We are not working anymore actively with this quad. All work has moved to ArduCopter platform. But in generally you can connect your Xbee on FTDI pins. You need to have normal xbee adapter from DIY, SFE or ADA and then you just connect it to FTDI TX/RX pins.

    Because there is also another board using serial ports and IMU board only have one, you might need to daisy chain those TX pins if you plan to use multiple boards.

    But as said, our new platform ArduCopter has it all and also multiple serials to play with.

    Quadcopter telemetry is not supported by ArduStation but I cannot see any reasons why it could not be modified for it. You just need to modify it's output stream.
This reply was deleted.