Etsi

Janic YHC

How about a less bloated life that works

kategoria

Arduino

single-board microcontroller to make using electronics in multidisciplinary projects more accessible.

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.

Finger rock! The miniproject of arduino

Prototyypin rakentaminen-course Has given us many thoughts and ideas about what we could create.

Well we were given this task to built our own mini project. But alone we didnt have that much sensors and servos so we decided to do it as a teamwork. As a team there was me,Miika and Teemu. We tried to use our sensors ultrasonic hc-sr04 ,ultrasonic hc-sr05 ,laser?,and a servo to create a something nasty.

We tried to built a machine that would point into 3 different directions. Depending on how close someone tries to come near the object. Well we didnt have anything fancy but the laser but it should have being cool enough.

If trying to make something useful with this idea I think a video camera that would stare at anything that goes near should be cool enough.

So we started connecting those sensors by using breadboard to connect all and in the same time we wrote the details to word document so it wouldnt be hard to get on track by looking on that complicated looking connection.And after all the connections were done and the codes too.Image

Well it didnt work as we thought.

On the left ultrasonic voice sensor had reaction and by trying to see details from (serial monitor in the arduino program) It seemed that everything was working too slowly. And also we thought there was a problem with having only 5v electricity so we used two arduino. But it didnt work. And we had no clue why it didnt work. we checked the code many times and the connections. But then we quit.

We then tried to use only two ultrasonic voice sensors which was a fail too. Then switched into one.

So nothing really worked until we only used one ultrasonic voice sensor and the servo.

And we built this FINGER ROCK  device. It rocks cos it points to different directions.

 

And the code is here.

#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 > 10 && distance < 150) {
myServo.write(distance);
}

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

Läksy 3: syvemmälle sensoreihin

Aluksi piti tehdä ryhmätyönä näitä hommia, mutta onneksi Tero(opettaja) sai lisää arduinoja ja pääsin itsekin testailee näitä.Arduinon boardin nimi oli Leonardo ja tä

Liittäminen oli suht helppoa, koska sensorissa luki suht selkeesti asiat.
Mutta tuli pieniä ongelmia johon en osannut selittää, kuten miksi alussa laite ei vastannut vaan piti säätää yms. Lopulta se lähti käyntiin samoilla asetuksilla. Ylipäätään oli mukavaa että arduinot ei toiminut kotona olevilla koneilla. Onneksi koulussa asennettuani Xubuntun peli alkoi vähitellen skulaamaan.

#define trigPin 12
#define echoPin 13

void setup() {
Serial.begin (9600);
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 >= 200 || distance <= 0){
Serial.println(”Oot liian kaukana”);
}
else {
Serial.print(distance);
Serial.println(” sentteinä”);
}
delay(500);
}

http://trollmaker.com/article3/arduino-and-hc-sr04-ultrasonic-sensor Koodit ja esimerkit sain tuolta sivulta

Image

Laite suostui toimii, pitkän kokeilun jälkeen. alkoi laskee etäisyyksiä, esim kuinka kaukana jokin objekti oli siitä ultraäänietäisyys sensorista. Tykkään tästä sensorista aika paljon.

Toinen sensori oli sit semmoinen, etten tiedä yhtään mikä se on. (waiting for update)

Checking out this awesome sensor

IMG_1512

So I was thinking about exploading everything by pushing this button.

Saatiin lainaksi koululta näitä nättejä vehjeitä, joilla saatiin kokeilla miten sensorit toimii. Saatiin pieni sensori, jota kutsuisin mieluummin nappulaksi. Koska en nähnyt siinä mitenkään erityistä toimintoa. Oli aluksi vaikeeta ylipäätään saada selville mikä tuo nappi edes on. Mutta arduino button googlettamalla niin DATAM voila kaikki tarvittavat tiedot löytyi vähitellen.

Kokeiltiin aluksi niitä liitäntöjä ja aluksi painamalla nappia, niin led valo syttyi, mutta haluttiin ehkä jotain hiukan järeempää ja jokin joka tarvitsee koodin toimiakseen.

const int buttonPin = 12;
const int ledPin = 13;
int buttonState = 0;

void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}void loop(){

buttonState = digitalRead(buttonPin);

if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
}

Linkki siihen mikä auttoi koodin saamisessa.

http://arduino.cc/en/tutorial/button

Koodin saatua toimimaan ja liitäntöjen ollessa kunnossa. Laite toimi niin että painamalla nappia, led valo syttyi hetkeksi palamaan noin muutaman sekunnin.

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