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: , , ,

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: , , , ,

Simple Analog Signal Meter

Posted by admin on October 25, 2009
Arduino, Projects, examples / Comments Off

I bought a couple of these signal meters from Maplin a few months ago and today I found some time to try them on an an arduino.

Maplin sell these for £4 each, which is probably quite expensive for what they really are, given the cheap plastic material and the overall quality: just to give you an idea: the transparent front cover is attached to the rest of the unit with a piece of tape…

Still, if you want to add a simple meter on your arduino, without messing around with lcds and their libraries, this is by far the easiest way.

In my test, I simply used a potentiometer and I attached the meter like this:

Simple Analog Signal Meter

Simple Analog Signal Meter

(btw, the battery underneath the meter has just a “supporting” role)

Here is a simplified version of Tom Igoe’s “AnalogueWriteMega.pde” example, that comes with Arduino 0017:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const int thisPin = 5;
 
void setup() {
  pinMode(thisPin, OUTPUT); 
}
 
void loop() {
  for (int x = 0; x < 255; x++) {
    analogWrite(thisPin, x);
    delay(50);
  } 
 
  for (int x = 255; x >= 0; x--) {
    analogWrite(thisPin, x);
    delay(50);
  } 
 
  delay(100);
}

… and here is a video of how it works (apologies for the poor quality):

Simple Signal Meter from Arkadian.Eu on Vimeo.

Tags: ,