Arduino Quadcopter – Part 2

The Frame

There are three options for a quadcopter frame you can purchase a fully built frame, a kit which requires some assembly or you can build a frame from scratch. There are many types of materials that can be used to build a frame including wood, plastic, fiberglass, carbon fiber and aluminum.

I decided to build my frame from scratch and will be using 20mm x 20mm square aluminum tubing for the arms and clear 5mm acrylic for the center piece.

First off I had to work out how long the arms needed to be. The props measure 250mm since the motors will be mounted on the ends of the arms only half the length of the props will pass on the inside of the quad. Then I worked out how much space would be needed in the center for the wiring and circuit board.

The arms will be 240mm long which will leave enough room between the props and have space in the middle to mount all the other components. I cut the arms to the required length using a hacksaw then lined them all up to make sure all four are equal lengths.

Next I mounted the motors on the end of each arm, I marked the center of the aluminum square tubing placed the motor on the center line then marked the mounting hours and drilled them out. I fixed the motors in place using self tapping screws.

For the center place I cut a 140mm x 140mm square out of  the 5mm acrylic then cut off the corners 10mm in. The next challenge is to mount the arms to the center plate and make it all square and balanced otherwise the quad will be off balance and hard to fly. I marked the center of the square then marked halfway down all four sides. Using a ruler I drew a line from the outer markings to the center of the square and this gave me the center like to mount the arms.

IMAG0156

Next was to measure out the wholes to screw the arms to the center plate, I measured equal distances on the center plate and arms. Then drilled the holes and check if they lined up then screwed in place using self tapping screws. Once I had attached all four arms I measured the distance between the motors and the edge of the center plate to make sure they were equal distances apart.

IMAG0157

Arduino Quadcopter – Part 1

Quadcopters seem to becoming very popular, one of the most popular being the Parrot AR Drone. I found out that there are Arduino based quadcopter projects that you can build your self so I decided to give it a go.

A Quadcopter or Quad rotor helicopter is a multicopter which is lifted and propelled using four rotors .Most recently this design this design has become popular with unmanned Arial vehicles because of the designs small size and agile maneuverability.  There are 2 Quadcopter configurations the X configuration and the + configuration. Both of these setups have 2 rotors spinning clockwise and 2 spinning counter clockwise. This cancels out the torque created by the motors and stops the Quadcopter spinning out of control.

Quadconfig

 

After doing some research I found the aeroquad open source project and decided to use that for my flight software (www.areoquad.com) . I am going to build my quadcopter in the x configuration here is a list of the main components for the build,

  • Arduino Mega 2560
  • 9 Degrees of Freedom Sensor Stick
  • Barometric pressure sensor
  • 4 x Turngy Brushless motors
  • 4x Turngy Electronic speed controllers
  • 2 x Counter Rotating Prop pairs
  • 1x Turngy lithium- polymer battery pack
  • 1x Transceiver nRF24L01 Module

When building the frame I am going to use aluminium square tubing for the arms and Perspex for the center mounting plate. If you wanted to the frame and AreoQuad shield can be purchased pre built from www.areoquad.com but i think it is much more fun building it from scratch.

I have ordered all the main parts needed to build my quad, while I am waiting for them to arrive I will start on the Frame.

Arduino WebServer controlled LED

I wanted to investigate controlling the digital outputs on a Arduino from a webpage so I decided to build a simple setup to Turn a LED on and off from a webpage. For this project I used the Arduino Uno R3 and Arduino Ethernet Shield.

First off we need to configure the web server  this is done by calling the Ethernet libraries, setting the Mac Address, IP Address and Server Port. then in the Void Setup you start the server and define the pin you want to plug the LED into.

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1, 177);

EthernetServer server(80);

void setup()
{
Serial.begin(9600);
pinMode(8, OUTPUT);
Ethernet.begin(mac, ip);
server.begin();
}

In the Void Loop we define client then check that the web server is connected and available the get it to display some HTML. The first lot checks the status of pin 8 and prints HTML to tell us if the LED is currently turned on or off. Then we use a HTML form to make some radio buttons and a submit button to select the status on or off.

if (digitalRead(8)){
client.print(” LED is <font color=’green’>ON</font>”);
}else{
client.print(” LED is <font color=’red’>OFF</font>”);
}
client.println(“<br />”);

client.print(“<FORM action=\”http://192.168.1.177/\” >”);
client.print(“<P> <INPUT type=\”radio\” name=\”status\” value=\”1\”>ON”);
client.print(“<P> <INPUT type=\”radio\” name=\”status\” value=\”0\”>OFF”);
client.print(“<P> <INPUT type=\”submit\” value=\”Submit\”> </FORM>”);

break;
}

The Webpage being served by the Arduino should look something like this:

Now all that is left is to read the input from the HTML Form and turn the led on or off. When you select one of the radio buttons and click submit the form adds a status=1 or status=0 to the end of the URL. We can now use the GET function to read the value and run through am IF statement to set the digital write on pin 8 to either High or Low (On or Off).

if (c == ‘\n’) {

currentLineIsBlank = true;
buffer=”";
} else if (c == ‘\r’) {
if(buffer.indexOf(“GET /?status=1″)>=0)
digitalWrite(8,HIGH);

if(buffer.indexOf(“GET /?status=0″)>=0)
digitalWrite(8,LOW);
}
else {

This was great to get working because i would like to control some of my upcoming projects using a HTML Form. You can download the full sketch file here.

Arduino OBD2 – Part 1

I have always been interested in cars and electronics so I decided to Build a Arduino device that can read Data from the ODB2 port on my car and display it real time on a tft screen. OBD2 or On-Board Diagnostic is a vehicle’s self diagnostic and reporting system. This can access data of the various sub-systems and show information such as Vehicle speed, Engine RPM, Throttle position, Engine coolant temperature, Intake temperature, Intake pressure, MAF flow pressure Fuel pressure and much more depending on the vehicle.

After looking around online I found a OBD2 Arduino kit here. I also decided to use a 3.2″ TFT LCD Touch Shield Mega for Arduino and a Arduino MEGA 2560 Board

I have started off by building the home screen to display the data from the engine management system, this includes RPM, Speed, Coolant / Intake Temperature and Fuel / Intake pressure. I have filled in some static values so I could get the placement and spacing correct. The next tasks will be to build a 12v car power adapter for the Arduino MEGA 2560 Board and OBD Shield, Then work on the code to get some live data displayed on the screen.

 

Arduino Temperature Sensor

When I started playing around with my first Arduino I had a Arduino Uno R3 and a Arduino Ethernet Shield R3. I connected the two and download the sample WebServer code and browsed to its ip address. Wow it was that easy I had a working WebServer ! I then thought it would be cool to get this WebServer to display some useful data so I bought a temperature / humidity sensor and started working on getting the Arduino to display the temperature and humidity on a webpage.

First off I needed to solder the hookup wire onto the Humidity & Temperature Sensor Module, I used white for the DATA, Red for the 5v input and black for the Ground. I used single core hookup wire which means I can strip the other ends and plug them straight into the Ethernet Shield. Then I plugged the Ethernet Shield onto the Arduino Uno and I had the basic hardware built it was that simple.

ow that the Hardware is put together it is time to start building the code. First off the temperature / humidity sensor needs a few files downloaded to make it work, they can be found Here. Now all i did was modify the webserver sample code to read data from the temperature / humidity sensor and output it in HTML.

You can see the finished project here.

The code and library files for this project can be downloaded here.