Sunday, December 11, 2011

Observer Alpha

So I was finally able to build my first driving robot.  

  

It's still an Alpha version so it has no special functions but in future I would like add more sensors and maybe even a digital camera that will record what's going on around. Since this is just first release I won't put here any code or tutorial but I will be updating this post. 

Monday, November 21, 2011

Servo etcher

Since I like to fabricate my own PCB’s, it’s obvious that I etch a lot. For that purpose I’m using old CD container.


Thing that I hate is that the whole process is slow and ineffective. Thus I’ve decided to use one of the servo’s that was lying around. I’ve hot glued servo to the plastic cover of CD container. All I needed then was to program an Arduino, so it could change speed of servo with a values that comes of a potentiomer.
(Code I'm using is "Knob" from Arduino IDE Servo library) 



Sunday, October 30, 2011

Evil Pumpkin

I'm from Europe and we’re not celebrating Halloween, but I always wanted to carve a pumpkin.

So I’ve bought one and I carved it. At first I thought that a simple candle inside would be enough, but then I decided to go with arduino, LED, speaker and distance sensor. I’ve used my Nano, and for sensor I used my IR sensor. Here’s the video and code.


code:
int IRSense = A0;
int IRTrans = 2;
int Flick = 10;
int valueAmbient = 0;

void setup() {
 pinMode(IRSense, INPUT);
 pinMode(IRTrans, OUTPUT);
 digitalWrite(IRTrans,LOW);
}

void ambient()
{
 digitalWrite(IRTrans,HIGH);
 delay(20); 
 valueAmbient = analogRead(IRSense);
 delay(20);
}

void loop() 
{
 ambient();
 digitalWrite(IRTrans,LOW);
 delay(20);
 int value = analogRead(IRSense);
 int value2 = round(value - valueAmbient);
 int dist = (((value2+15.0)/(value2*(value2+100.0)))*2000.0);
 if(dist<20) 
  {
   analogWrite(Flick,random(0,256));
   tone(8, 38);
  }
 else
  {
   analogWrite(Flick,0);
   noTone(8);
  } 

Sunday, October 16, 2011

Arduino wireless sketch uploading via Bluetooth

Few months ago I’ve showed you my Bluetooth Xbee module. Back then I was able to send some commands through it to Arduino. But I wasn’t able to upload code wirelessly. 


I’ve been trying to solve this problem and I was successful. I found out that the issue is resetting the board. Since with this setup I’m not using USB connection I can’t use DTR pin on FTDI chip. So the trick to hold a reset button press upload and when information about size pops up just wait second or two and release the reset button. Right now I’m working on some sort of method (software or hardware) to make it automatic. I also found out that the baud rate of Bluetooth module and com port on your PC must be same as the uploading speed of the board you are using. For instance I’ve been using Arduino Duemilanove for this demonstration. Its upload speed is 57600. So I had to change baud rates of Bluetooth module and com port to 57600 as well. If you’re using laptop with a Bluetooth or pc with some USB Bluetooth module you need to buy only one module for your Arduino. You don’t even need to buy Xbee shield, because this particular one works if you connect just TX,RX,3v3 and GND pins. I was trying to use it with standalone Atmega8 but for some reason it didn’t worked so I’m also working on that. If you’re trying to achieve same thing and you’re having some issues with setup or whatever just contact me. And don’t forget to watch the video.

Thursday, September 29, 2011

LM335 + Arduino temperature sensor

Few weeks ago I’ve bought a LCD 16x2 display. I wanted to create a room temperature sensor. 


I’ve been using pocket arduino and there’s been some issues with resetting. I had to burn bootloader once again, so it took me longer to make this post. Also I’ve picked LM35 for this project (cool but expensive), but I’ve burned it. So I was forced to go with LM335 (not that cool but cheap). You can download code and watch video below. 

Code : 

#include <LiquidCrystal.h>
float raw;
float temperature;
LiquidCrystal lcd(3, 4, 5, 6, 7, 8);
byte degree[8] = 
{
B01100,
B10010,
B10010,
B01100,
B00000,
B00000,
B00000,
B00000
};

void setup()
{
  lcd.begin(16, 2);
  lcd.print("Temperature :");
  lcd.createChar(0, degree); 
  lcd.setCursor(7,1);
  lcd.write(0);
  lcd.setCursor(8,1);
  lcd.print("C"); 
}

void loop()
{
 raw = analogRead(0);
 temperature = ((raw*480.0/1024.0)-273); 
 lcd.setCursor(1,1);
 lcd.print(temperature);
 delay(500);
}



Sunday, September 18, 2011

Sound/noise sensor for Arduino

For quite some time I’ve been looking for some sort of sound or noise sensor. I had some electrolytic microphones lying around, so the only problem was amplifier. 



Well you can choose either some IC or some simple transistor ones. At first I’ve tried LM386, but I found out that it’s not very good. The reason is that this IC is not meant to be used as a pre-amp. I’ve decided to use this single transistor setup with 2N3904. I’ve also bought big white board and drawn the circuit. It’s really cheap sound/noise detecting sensor and it work’s good.

Arduino code :

void setup()
{
 Serial.begin(9600); 
}

void loop()
{
 int minimum = 1024;
 int maximum = 0;
 for(int i=0;i<1000;i++)
 {
  int value = analogRead(A0); 
  minimum = min(minimum, value);
  maximum = max(maximum, value);
 }
 Serial.print("noise=");
 Serial.print(maximum-minimum);
 Serial.println(); 
}



Saturday, September 10, 2011

Pocket Arduino

Well, I have to admit that I’m little bit obsessed with Arduino clones. I always wanted to create my own pocket portable Arduino. 


I thought that Altiods tin would be perfect housing for such a project. I also had one ATmega328 laying around. There were few abilities I wanted my pocket Arduino to have. Since I wanted my Arduino to be pocket or let say portable there should be some sort of power source inside. I quickly chose 9V battery for that purpose, because arduino itself doesn’t have that big power consumption and there are still pins that I can use for other voltage input. Then I needed somehow to upload code to Arduino, so I needed some way to communicate between Arduino and PC. I chose one of that small USB to TTL converters. Keeping in mind that this Arduino has to be portable I’ve desoldered female USB type D connector that was there and replaced it with male USB connector. With this option I don’t need any USB cable, (maybe USB extender if you don’t have laptop) I can just plug the whole Altoids tin inside my PC. Another thing I wanted was small breadboard, because that’s the thing that makes Arduino portable. There were more things I wanted to have there, but even with these, it was really hard to close the tin after I've placed everything inside. But after all I’m really satisfied with the success. Arduino is fully operational, portable and still looks like mints case.