2014-06-26

Sogut - Marmaris

Arduino - RFID

/**
 * Read a card using a mfrc522 reader on your SPI interface
 * Pin layout should be as follows (on Arduino Uno):
 * SDA: Pin 10
 * SCK: Pin 13 / ISCP-3
 * MOSI: Pin 11 / ICSP-4
 * MISO: Pin 12 / ICSP-1
 * IRQ: Not used
 * GND: GND
 * RST: Pin 9
 * 3.3v: 3.3v
 */

// The code will light up a LED and change position of a servo with "any" RFID card approaching. 

#include <Servo.h> // Already included with Arduino software
#include <SPI.h>  // Already included with Arduino software
#include <RFID.h>  // Download RFID library from here:  http://www.electrodragon.com/w/images/4/4e/Rfid-master.zip

RFID rfid(10,5); 
String ReadTxt;

int led = 7; //LED pin

Servo myservo;  // create servo object to control a servo 
// a maximum of eight servo objects can be created 
int pos = 0;    // variable to store the servo position 

void setup()
{ 
  Serial.begin(9600);
  SPI.begin(); 
  rfid.init();
  pinMode(led, OUTPUT); 
  myservo.attach(5);  // attaches the servo on pin 9 to the servo object   
}

void loop()
{
  if (rfid.isCard()) {
    Serial.println("We have a card: ");

    if (rfid.readCardSerial()) {
      //    Serial.println(" ");
      Serial.println("Card number : ");
      Serial.print(rfid.serNum[0],DEC);
      Serial.print(" , ");
      Serial.print(rfid.serNum[1],DEC);
      Serial.print(" , ");
      Serial.print(rfid.serNum[2],DEC);
      Serial.print(" , ");
      Serial.print(rfid.serNum[3],DEC);
      Serial.print(" , ");
      Serial.print(rfid.serNum[4],DEC);
      Serial.println(" ");

      ReadTxt =  String(rfid.serNum[0],HEX)+String(rfid.serNum[1],HEX)+String(rfid.serNum[2],HEX)+String(rfid.serNum[3],HEX)+String(rfid.serNum[4],HEX);
      Serial.println (ReadTxt);
      Serial.println (" "); 

      digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
      myservo.write(175);  // tell servo to go to position 175 degrees 
      
      delay(5000);               // wait for a second

      digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
      myservo.write(5);  // tell servo to go to position 5 degrees 
    }
  }
  rfid.halt();
}



2014-06-23

1 Hour Road / 1 Saat Yol



1 hour of Road and music
1 saat Yol ve Müzik

Music: Bogdan Live Rokolectiv Festival 2009
Photography: Nevit Dilmen
Location: Çine, Aydın / Turkey
2014

2014-06-22

Anguilla anguilla



Location:Mavi pide Marmaris,Hisarönü Köyü, Saklı Çay. Muğla
https://en.wikipedia.org/wiki/European_eel Anguilla anguilla
Music: "NirvanaVEVO" (by Chris Zabriskie)

2014-06-13

GoPro, MYRMICA 360 Timelapse



Timelapse, interior
Music: Lee Rosevere Illuminations radio edit
Gadget: GoPro, MYRMICA 360 degree Time Lapse Pan and Tilt Head for GOPRO

2014-06-12

Arduino + MPU-6050 (Gyroscope + Acelerometer) - GY-521 + 2 Servo motors (Simple Code)

As a novice I am trying to put thing together. I am happy that I just made it work.

Arduino Uno as processor
GY-521 / MPU-6050 as accelerometer and Gyroscope.
Breadboard
2 9G Servos Bracket Sensor Mount Pan / Tilt Kit for Gyro - Translucent Blue http://www.dx.com/p/214081

http://playground.arduino.cc/Main/MPU-6050 has starting info on MPU-6050

I used two libraries from I2CDevLib: I2Cdev.h and MPU6050.h
https://github.com/jrowberg/i2cdevlib/

Wire and Servo libraries are already included with Arduino

http://playground.arduino.cc/Learning/I2C
http://www.arduino.cc/en/Reference/Wire
http://www.arduino.cc/en/Reference/Servo

MPU-6050 chip communicates with Arduino using I2C or (read as I square C) communication protocol. I2C bus one of the most common method of communication between varies microcontrollers, sensors etc. All I2C communication is handled by Arduino wire library.

Servo library is needed to control the servo motors.



The code below only uses values from accelerometer. The axis paralel to gravity will have additional 1g force. But shakings from hand will also effect accelerometer. You can see the effect as a shaky servo. I will try to correct it in next version. I am trying to be patient when looking for ways to fix it.
//MPU 6050 2 axis Servo kontrol 

#include <Servo.h>
#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>

MPU6050 mpu;

int16_t ax, ay, az;
int16_t gx, gy, gz;

Servo myservoY;
Servo myservoX;

int valY;
int prevValY;

int valX;
int prevValX;

void setup() 
{
  Wire.begin();
  Serial.begin(38400);
  Serial.println("Initialize MPU");
  mpu.initialize();
  Serial.println(mpu.testConnection() ? "Connected" : "Connection failed");
  myservoY.attach(9);
  myservoX.attach(10);
}
void loop() 
{
  mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
  valY = map(ay, -17000, 17000, 0, 179);
  valX = map(ax, -17000, 17000, 0, 179);
  if (valY != prevValY)
  {
    myservoY.write(valY);
    prevValY = valY;
  }

  if (valX != prevValX)
  {
    myservoX.write(valX);
    prevValX = valX;
  }
  delay(50);
}


The connection scheme is
  • Arduino’s +5V to Vcc of MPU6050
  • Arduino’s GND to GND of MPU6050
  • Arduino’s SCL (AN5 in UNO board) to SCL of MPU6050
  • Arduino’s SDA (AN4 in UNO board) to SCK of MPU6050
  • Arduino’s digital pin 2 (INT0) to INT of MPU6050
I improved the design a month later:
Improvements: 
  • Faster time response
  • Fewer unwanted vibrations.
  • No change needed in cable connetctions


2014-06-06

Küçük dostlarımız köpekler...

Küçük dostlarımız köpekler...

 

Küçük dostlarımız uyuyorlar, koşuyorlar, oynuyorlar.... kimisi uyuşuk, kimisi yaşam dolu...


Photography: Nevit + Leyla Dilmen
Music: "Tripped & Fell In Love (instrumental)" (by YACHT)

2014-06-01

MPU 6050 ve Arduino ile Güreşme

Hiç bir şey bilmeyen biri olarak, internet'in dünya kadar bilgisi içinden işe yararları çıkarmaya çalışıyorum. MPU-6050 3 eksen akselerometre ve jiroskop ile yararlı ve ucuz bir parça. Çin'den aldığım GY-521 ile arduio'yu bağlamaya çalışıyorum. http://playground.arduino.cc/Main/MPU-6050 buradan çalışmaya başladım. Bahsedilen kütüphaneyi indirmek için https://github.com/jrowberg/i2cdevlib/ bu adresi kullandım. İçlerinden iki tanesi mutlak gerekli görünüyor. Başka gerekli olanlar da olabilir. MPU - 6050'yi bağlamadan debug çalışması I2Cdev ve MPU6050 kütüphanesini indirip kopyaladım. Aşağıda minimum olan kod hata vermeden derlendi.

#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly: 
  
}


Amacım öncelikle şöyle basit bir şey yapmak.