Sunday, January 9, 2011

RadarArduino

Just to give a comparison, I decided to repeat the experiments that I did with the SunSPOT also with the Arduino. So today I present the RadarArduino. The circuit setup stayed the same as in the SunSPOT post. You only have to connect the 5V port, the GND port and the A0 port of the Arduino respectively.

This is the simplified schematic of the connections which have to be made:



The source code is really easy and quite short:
/*
  Radar Arduino.
  Analog input is read continously and the onboard LED reacts
  if a certain threshold is passed.
*/

int a0 = 0;
int currentReading;

void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  currentReading = analogRead(a0);
  if(currentReading > 250) {
    digitalWrite(13, HIGH); 
    delay(100);            
    digitalWrite(13, LOW);
  }
  delay(100);
}
Here is the short clip of the experiment:

video