Nodecopter event – London

Screen Shot 2013-03-18 at 11.42.29

On Saturday I attended my first Nodecopter event in London. It was ace! Nice people, great ideas, good fun. At the end of the day we had a few really cool projects, such as:

  • a keyboard controlled copter
  • a copter reading QR codes
  • a copter controlled by leapmotion
  • ps3 remote control
  • arduino and conductive paint control

The last one is the one I worked on, teamed up with Shane and Andy. A bit more on how we did it later, but first a quick introduction on Nodecopter.

What is Nodecopter ?

ardrone2-404

It is a quadcopter controlled with NodeJS. The copter itself is the A.R. Drone 2.0 by Parrot. Features include: WiFi, HD Camera (photo, video recording, real time video feedback), stabilisation system.

All you need to do to take control of it is install NodeJs and the ar-drone module. More details on nodecopter.com. Then just write a javascript file and run it from your command line. Simples!

Amongst the simple commands you can parse to your drone : take off, land, rotate, flip, dance, move forward/back/left/right.

Our Arduino controlled drone

With a bit of conductive paint from Bare Conductive and an Arduino, it is quite easy to turn a drawing into a button. So why not make a dashboard drawn in conductive paint to control our drone?

Unfortunately, we didn’t have much time to think about the designs of the buttons, so they remained at ‘wireframe’ stage, but the result was pretty sweet anyway.

button Here’s a button : connect on leg to your digital pin, the other one to the ground and join the round bits using your finger. When the circuit is closed with you finger, the equivalent of a button press is recorded.

Make sure you use at least a 1MOhm resistance. If it’s too low, your press won’t be recorded. I’m not too sure why, I am not an expert in electronics yet, but I will investigate. I found out that I had a problem with my resistance when connecting the two parts with my finger didn’t work, but it was perfectly fine when I used a jumper wire. Anyway, I fixed that quickly and moved on to the next step.

Now, to be able to use Arduino with Node, I installed duino, a framework designed for that. Fairly simple to code with when you want to use components as basic as a push button. Although, having played with BreakoutJS these days, I wasn’t really comfortable with duino because it is very close to Processing, too close for my liking (I’m not too familiar with it yet and javascript sounds a lot easier).

So, for a simple button, here’s what the code looks like:

var arduino = require('duino'),
    board = new arduino.Board();

var button = new arduino.Button({
  board: board,
  pin: 4
});

button.on('down', function(){
  console.log('down');
});

button.on('up', function(){
  console.log('up');
});

To link the above to the nodecopter, there are only a few things to do : declare your drone, require an action on button down. So making the drone take off would look like that:

var arduino = require('duino'),
    board = new arduino.Board();

var arDrone = require('ar-drone');

var client = arDrone.createClient();

var button = new arduino.Button({
  board: board,
  pin: 4
});

button.on('down', function(){
  fly();
});

function fly() {
	client.takeoff();
}

Connect to your drone’s WiFi, run your javascript file from the command line using Node, and you’ve got a flying quadcopter!

photo

Create new functionalities for each button and you can control your drone. Now, if you want to take a closer look at the code, the project is on gitHub.

BIG Thanks
I know it just sounds like we’re a bunch of geeks playing with toys – and it’s exactly what we are, but it is so much fun!
I just wanted to say a massive thanks to Andrew, who organised the event, and also to my partners in crime for the day, Shane and Andy.

And thanks to all the sponsors:

487708_409521219143128_967952087_n

I hope that a Nodecopter event will be back soon in London 🙂

Advertisements

One thought on “Nodecopter event – London

  1. Pingback: Andy LawAndy Law - Creative Developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s