Arduino

Arduino Cookbook on its way!

Posted by arkadian on January 16, 2011
Arduino, Processing, Reviews / Comments Off

A Safari Online subscription was one of the best things I took on in 2010. As part of the service, subscribers can access early drafts of Oreilly books. Yesterday, I had a quick look at the upcoming “Arduino Cookbook” and I here is my review.

I really like the Oreilly “Cookbook” series. With most programming books, it seems that the authors assume zero knowledge from their audience and start with variables, for loops, functions and classes etc etc… With the “Cookbook” series, the editors assume a more advanced audience and give solutions to real-life problems. For me, this is great for two reasons: first of all, due to my busy schedule and short attention span, I like being able to read 5-10 pages and feeling I’ve actually learnt something. The second reason is that these books, by giving us “recipes”, i.e. solutions to real-life problems, effectively teach us how to solve problems.

Now, the questions are “how the new Arduino Cookbook compares to other arduino books” and “is it a worthy member of the Cookbook series”?


Overall, I have to say, I was very impressed. The authors opted to start with simple recipies on problems most rookies stumble upon, but at around page 100 things start getting interesting, with recipies that interface Arduino and Processing, a very good section on lcds, plus everything you may decide to connect an arduino to, from various sensors to servos, gps receivers etc.

The book is true to its Cookbook roots and gives practical advice on problems that arduino users will have at some point to deal with. I found numerous recipies on problems I had come across in the past and had spent hours on forums trying to figure out solutions.

Another good point about this book is that it’s using the new Arduino Uno.

Is this the best Arduino book to date? Yes. It’s better than “Practical Arduino” when it comes to quantity and quality of examples and more useful in the long term than Masimo Banzi’s “Getting Started with Arduino” which is a very basic intro to the subject. Should it be the first book on Arduino one should buy? No. This is a “cookbook” and expects some understanding of the subject. I still thing Tom Igoe’s book “Making Things Talk: Practical Methods for Connecting Physical Objects” is the best and most inspiring intro to the subject, but the Arduino Cookbook goes further when it comes to practical advice and knowledge that can be transfered to many different projects. It does stick to its “Cookbook” roots!

With the arrival of the iPad, I have stopped buying real books, as the ebooks are cheaper and the Safari Online subscription service is great. The Arduino Cookbook will be one of the few real books I will personally buy this year as I think it’s a book worth having on my library.

Tags: , ,

Italian workshop on Arduino/Ikea Lamps!

Posted by admin on April 25, 2010
Arduino, Exhibition / Comments Off

It came to my attention today that a workshop took place in Italy a while ago on Arduino/Ikea lamps. This was an Arduino Workshop, part of the Torino Design Week.

Event Description:
http://arduino-tdw-2009.eventbrite.com/

Video on Vimeo:
http://www.vimeo.com/8559277

Arduino Code:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263217950/

Blog post:
http://www.alluvionemediatica.it/Blog/tabid/59/entryid/25/Default.aspx

My original Arduino/Ikea lamp post was used quite a bit. One of my photos was used on the event description
and a few code posts referenced my site. I was surprised to see that I even got a credit on the video posted at Vimeo! Thanks guys!

Tags: , , ,

WiShield from async_labs

Posted by arkadian on March 14, 2010
Arduino, Components & Materials / Comments Off

This past week, I got my hands on a WiShield 2.0 from Async Labs (http://www.asynclabs.com/).

This is a very exiting addition to my collection of shields as it adds wifi capabilities to my projects!

There is a nice wiki page on the async_labs site (http://asynclabs.com/wiki/index.php?title=AsyncLabsWiki) and relevant code (libraries & examples) is hosted at the GitHub (http://github.com/asynclabs/WiShield).

I have a few ideas about this shield – stay tuned! :)

Tags: , , ,

DECODE – Exhibition at the V&A Museum…

Posted by arkadian on March 14, 2010
Arduino, Exhibition, Processing / Comments Off

Yesterday, I visited the Decode exhibition at the V&A museum http://www.vam.ac.uk/microsites/decode/

This exhibition is about creating interactive pieces using modern technology. It’s a rather small exhibition, probably due to the fact that few artists have embraced the new technologies currently being developed.

Many of the exhibits I saw, I was already familiar with:

Flight Patterns (one of my favourites) – http://www.aaronkoblin.com/work/flightpatterns/index.html

We Feel Fine – http://www.wefeelfine.org/

Weave Mirror,  similar to the wooden mirrors from the same artist – http://smoothware.com/danny/woodenmirror.html

Flow 5.0 – http://www.studioroosegaarde.net/work_html.php?id=21&picture_id=1399

Many of the exhibits are using Processing, open Frameworks,  Arduinos (or other similar devices).

I loved this exhibition; my only issue was that it wasn’t big enough…

Tags: , , ,

Custom PCB for analog input

Posted by admin on February 22, 2010
Arduino / Comments Off

I have been toying with the idea of designing my own circuit boards and this post is about my very first board.

Back in December,  I decided to give it a go and design something very simple. It was meant to be more like a training exercise, rather than a board I desperately needed.  The board was going to have 3 small potentiometers; by attaching it on an arduino I should be able to get the readings on the serial port.

After looking at all the different software packages, I ended up using FreePCB to design a very simple circuit board.  I found that FreePCB was very easy to learn and use.  I used BatchPCB (a SparkFun service) to get the card printed:

http://www.batchpcb.com/index.php/Products/26633

The guys at BatchPCB were kind enough to send me two boards (I only ordered one). The order took approx 4 weeks, which is not bad, if you are after the cheapest possible way of getting a board printed. I paid $14, including delivery to London.

Front side, with the potentiometers. By the way, when I got the board back, I realised that I got the numbering wrong: instead of A5, A4, A3, it should read A0, A1, A2…

DSCF1190_w500

Back

DSCF1180.RAF_w500

pins and pots soldered in position (I know, I need to work on my soldering skills…)

DSCF1192.RAF_w500

The mini board on a freeduino board

DSCF1194.RAF_w500

The following Arduino code works nicely for this example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
int sensorPin1 = 1;
int sensorValue1 = 1;
 
int sensorPin2 = 2;
int sensorValue2 = 2;
 
int sensorPin0 = 0;
int sensorValue0 = 0;
 
void setup() {
  Serial.begin(9600);
}
 
void loop() {
 // read the value from the sensor:
 sensorValue0 = analogRead(sensorPin0);
 sensorValue1 = analogRead(sensorPin1);
 sensorValue2 = analogRead(sensorPin2);    
 
 //print the value on the terminal
 Serial.print(sensorValue0);
 Serial.print(" \t ");
 Serial.print(sensorValue1);
 Serial.print(" \t ");
 Serial.print(sensorValue2);
 Serial.println("");
 
 delay(100);
}

As I said before, this was just a test. Hopefully my next board will be part of a more exciting project!

Tags: , ,

PIR sensor + Arduino + Processing + Skype…

Posted by admin on November 23, 2009
Arduino, Processing, examples / Comments Off

This post is about a simple and interesting combination of software and hardware.

Last week, I picked up a couple of PIR sensors from Ebay.

pir2_w500

PIR sensors are (usually) easy to interface with an arduino board.
Red: 5V, Black: Ground, Yellow: Analog In. Could it be easier than this?

PIR_w500

After a bit of experimentation, I found that the board sends a pulse as soon as it detects some sort of movement. Also, it sends a pulse at the very beginning, when it sort of “boots”.

My ultimate aim was to start Skype as soon as movement was detected.

I loaded the standard firmata sketch on my arduino, see: http://arduino.cc/en/Reference/Firmata. Basically, the arduino simply sends all the analog port readings to Processing.

The following Processing code is simply a proof of concept. The sketch starts, looks for an arduino at the second serial port of my PC, waits for 5 secs for the PIR to send its first pulse and then, if movement is detected calls a number, using Skype.

At any moment, in the middle of the screen, you see the value of the PIR sensor.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import cc.arduino.*;
import java.io.*;
import processing.serial.*;
 
int analogPin = 5;
int myV; // PIR sensor value
 
PFont font;
Arduino arduino;
 
//////////////////////////////////////////////////////////////////////////////
void setup(){
  size(400, 300);
  font = createFont("ArialUnicodeMS-12.vlw",22, false); 
 
  //my board is the 2nd serial device, hence Arduino.list()[1]
  println(arduino.list());
  arduino = new Arduino(this, Arduino.list()[1], 57600);
}
 
//////////////////////////////////////////////////////////////////////////////
void draw(){
    background(0);
    fill(255);
 
  // the PIR sensor is sending out HIGH signal in the first 5 secs
  // so we will ignore all the early signals
  if(millis() < 5000){
 
  }
 
  else{
    // myV is the scaled value of the PIR sensor
    myV = arduino.analogRead(analogPin);
 
    textFont(font, 22); 
    textAlign(CENTER,CENTER);
    text("PIR sensor value: " + myV,width/2,height/2);
    text("Active for " + round(millis()/1000) + " seconds",width/2,height*3/4);
 
    callme();
  }
}
 
//////////////////////////////////////////////////////////////////////////////
void callme(){
 
  // you should be logged in on Skype and have some credit
  // if your are dialling an external line
  String mySkype = "C:\\Program Files\\Skype\\Phone\\skype.exe /nosplash /callto:+44798000000";
 
  if(myV>100){
 
    print(" MyV: " + myV + " ");
 
    try {
      String line;
      Process p = Runtime.getRuntime().exec(mySkype);
      p.waitFor();
      System.out.println("EXIT: " + p.exitValue());
    }
 
    catch (Exception err) {
      err.printStackTrace();
    }
 
      delay(3000); 
  }
 
 
 
}
//////////////////////////////////////////////////////////////////////////////

Here is a very short video of this test in action:

PIR Sensor – Test from Arkadian.Eu on Vimeo.

Tags: , , , ,