Hi-fi robot
Thanx for coming here
You might get disappointed with the robot
Introducing the hi-fi robot
Requirements :
- cardboard sheet
- Arduino
- Jumper wires
- Ultrasonic sensor
- Paper tape
- Scissor
- Servo motor
Inscape file for laser cutting :
Process:
- First load the file in inscape convert the file from SVG to DXF file in inscape
- Then load the DXF file into the RDWorks software
- Cut the given file in laser cutter
- Then add the ultrasonic sensor it the holes provided
- Then do the Arduino connections as shown in the diagram
- /////// photo of the ultrasonic =sensor
- The vcc and gnd pins provide power to the ultrasonic sensor
- The trigger and the echo pins provide the input and output data respectively
- The yellow wire of the servo is the signal pin getting the signal data
- //// photo of the servo
- Do the connections as shown in the picture
- Connect the Arduino with the Arduino cable to the computer
- Code:
- Upload he code
- Now when you take your hand in the proximity to the ultrasonic sensor the had would come up to give you the hi-fi
Servo myservo;
intpos = 0;
inttrigPin = 11;
intechoPin = 12;
long duration, cm ;
void setup() {
//Serial Port begin
myservo.attach(9);
Serial.begin (9600);
//Define inputs and outputs
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop()
{
for (pos = 0; pos<= 180; pos += 4) {
myservo.write(pos);
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
cm = (duration/2) / 29.1;
Serial.println(pos);
Serial.println(cm);
delay(400);
}
}