Etsi

Janic YHC

How about a less bloated life that works

Kuukausi

maaliskuu 2013

Arduino final project DONE!. Hygienic waving turn-on! aka. Hywa

Finally it worked!

It is called as Hygienic waving turn-on! aka. Hywa

With Hywa you will never need to touch your own dirty computer which has a lot of bacteria on it. Just a wave in front of it… Everything will turn on smoothly. Hywa you can actually get everything to work as well as a magic trick. It sure feels good to do things like those wizards in those movies. With Hywa you can open anything u want easily. After you have installed it properly.

Now you have your chance to try it.

Pictures and videos will be updated here soon. I managed to turn on my computer just by waving my hand.. I already have the video materials of it.

The code itself is here. I just changed little bit of it compared to the finger rock.

#include <Servo.h>

const int echoPin = 12;
const int trigPin = 13;

Servo myServo;

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

myServo.attach(2);

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);

}

void loop()
{
int duration, distance;
digitalWrite(trigPin, HIGH);
delayMicroseconds(1000);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;

if(distance > 5 && distance < 50)
{
myServo.write(90);
}
else
myServo.write(0);

Serial.println(distance);
delay(1000);
}

Arduino final project

Before this course I had no idea what this was all about. I was very confused of all the possibilities and things people has done with Arduino. My teacher Tero has already written a book about this subject and from his teaching I quickly understood how this system works.

For me I have a very huge amount of ideas on my head. I have thought a lot of different things what I could have done. But the main problem is how should I achieve them?

I had few ideas which I might later on try to make real. Then I was stuck that I didn’t have that much spare time nor materials. So I had to choose between few not so complicated things.

 

I earlier bought few things which I could use in my project. I chose to use HCSR04 ultrasonic sensor which is something that uses voice to determine what objects lie ahead. The way it works is sending ultrasonic voice and receiving it back so it can calculate how far it has gone. And my another cool thing is that I used servo. What is servo? This was something I thought when I first heard about it. Servo is like a motor. But it is something that can be more controllable. We can change its speed and the way it moves.

 

So in my this project I was trying to make it to open my computer. If my hand waves within the range that is in the hr-sr04 then the servo will push the on/off button of my computer and then it would be opened.

 

At first I was trying to use my windows 7 and that arduino programme to work but I gained this error

 avrdude: stk500_getsync(): not in sync: resp=0x00

So after few tries and then I was like okay time to switch into linux. So I dualbooted my computer and installed linux mint 14 to this computer and then I made the settings and tried to make this arduino real. Well Then using this arduino programm. And everything seemed to work fine.

Image

So I put all the strings into their places and I was like voïla.

At first the sensor and the servo worked separetly but then after I connected them together something went wrong. I first saw that serial monitor had reading like 230,240 then 0,0,0.. so it seems like the sensor is malfunctioning.. I tried many different codes that I found on the net.. and my ultrasonic voice didnt really make any response.

I took out the strings and tried to connect them into different pins but didnt have any responce either…after few hours of struggling I start to believe that this sensor might be broken.

Image

What is the main reason why I feel arduino’s are very awesome? Well I would say that these things are like creating a working puzzle by the components of own choice. Its like lego for adults. thought it seems I havent succes this time and the timelimit to make this project is quite near so I think I cant really do anything for this.

#include <Servo.h>

const int echoPin = 3;
const int trigPin = 2;

Servo myServo;

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

myServo.attach(4);
myServo.write(90);

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);

}

void loop()
{
int duration, distance;
digitalWrite(trigPin, HIGH);
delayMicroseconds(100);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;

if(distance > 5 && distance < 50) {
myServo.write(distance);
}

Serial.println(distance);
delay(100);
}

 

 

I will still try if this works.. or something else.

Pidä blogia WordPress.comissa.

Ylös ↑

Mine mood goes up and down

The smooth way I flow and knowing where to go.

Janic YHC

How about a less bloated life that works