Raspberry Internet Rover Dipto Pratyaksa www.linuxcircle.com
Why did I create this? Physical computing http://www.linuxcircle.com/ Why did I create this? Physical computing I wondered how codes can be translated into movements and vice-versa Sense the world via webcam and sensors
Why the Rover? Cat patrol http://www.linuxcircle.com/ Why the Rover? Cat patrol I want to stare at my cat at home while I'm at work
Why the Rover? Cat patrol http://www.linuxcircle.com/ Why the Rover? Cat patrol Watch her! Poke her! Run into her!
Plan it! Features: Move 8 directions + stop Light on / off Camera tilt React to obstacles Feed camera remotely Access: Controlled remotely via web browser
Key Ingredient 1: 4WD Chasis http://www.linuxcircle.com/ Key Ingredient 1: 4WD Chasis $45 4 motors Battery Pack 2 layers of platform 3 stands / holders
Key Ingredient 2: DFRobot Romeo Controller http://www.linuxcircle.com/ Key Ingredient 2: DFRobot Romeo Controller $30 2 DC motor ports 5 Test buttons Several IO ports Power Supply input Micro USB port
Key Ingredient 3: Raspberry Pi http://www.linuxcircle.com/ Key Ingredient 3: Raspberry Pi
Key Ingredient 4: Power Supply http://www.linuxcircle.com/ Key Ingredient 4: Power Supply 5 V 2 Amps Micro USB port Anything large enough to run for 3 hours Be Eco-friendly: Solar Rechargeable
Key Ingredient 5: USB & other devices http://www.linuxcircle.com/ Key Ingredient 5: USB & other devices USB Hub 4-7 ports Wipi = Wifi dongle USB cables Web cam Led Ultrasonic distance sensor
http://www.linuxcircle.com/ Let's Cook!
Assemble this!
The Recipe Assemble the 4WD Chassis kit http://www.linuxcircle.com/ The Recipe Assemble the 4WD Chassis kit Connect motors to Romeo via 4 motor ports Connect Romeo to Raspberry Pi via USB port Prep your USB devices Prep your codes
Architecture The Controller: Arduino Script http://www.linuxcircle.com/ Architecture The Controller: Arduino Script The Pi WebServer: NodeJS and PySerial The Client: HTML with CoffeScript
Arduino Script http://www.linuxcircle.com/ void advance(char a,char b) //Move forward { analogWrite (E1,a); //PWM Speed Control digitalWrite(M1,HIGH); analogWrite (E2,b); digitalWrite(M2,HIGH); direction = "forward"; } void turn_L (char a,char b) //Turn Left { analogWrite (E1,a); digitalWrite(M1,LOW); analogWrite (E2,b); digitalWrite(M2,HIGH); }
http://www.linuxcircle.com/ if(Serial.available()){ char val = Serial.read(); if(val != -1) { switch(val) case 'w'://Move Forward advance (200,200); //move forward in half (max speed 255) Serial.println("Forward"); break; case 'x'://Move Backward back_off (175,175); //move back in slow spee Serial.println("Reverse"); case 'a'://Turn Left turn_L (255,255); Serial.println("Left"); case 'd'://Turn Right turn_R (255,255); Serial.println("Right");
Datagram Server: Python Codes http://www.linuxcircle.com/ Datagram Server: Python Codes Open Serial Ports Open Socket Connection on port: 9001 Listen for datagram commands from NodeJS Send command to Arduino via Serial Ports
WebServer NodeJS Codes Host Client HTML code Listen for Socket connections on port 1338 Send instructions to Datagram Server on port 9001
http://www.linuxcircle.com/ The Client
Implement Additional Features http://www.linuxcircle.com/ Implement Additional Features Webcam Blinking light Collision Detector Beeper
Other Applications House Surveillance Hobby Toy Field Surveyor Spying Driver-less transportation Teach kids programming and robotics
Demo Log into the webserver 10.1.1.71:1338 via your smart phone! http://www.linuxcircle.com/ Demo Log into the webserver 10.1.1.71:1338 via your smart phone! http://10.1.1.71:1338
Questions Codes are available on: www.linuxcircle.com http://www.linuxcircle.com/ Questions Codes are available on: www.linuxcircle.com