Let’s make Robots




 Sudar Muthu (@sudarmuthu)
 Research Engineer, Yahoo! Labs
 http://hardwarefun.com
 http://github.com/sudar
Why hardware for a software hacker?




                          Fun!

  #asimijs @hardwarefun
Let me show you how fun it is..




                         Demo
                   http://hardwarefun.com/projects/asimijs




 #asimijs @hardwarefun
Participate in the demo 




                          Visit
                    http://hardwarefun.com:3000




#asimijs @hardwarefun
Control the bot at stage




                    http://hardwarefun.com/projects/asimijs
#asimijs @hardwarefun
Isn’t that fun?


    Now let’s see how you can
            build one




#asimijs @hardwarefun
Anatomy of a Robot




Sensors                                Motors


                           Processor
   #asimijs @hardwarefun
Sensors (Input)




#asimijs @hardwarefun
Motors (Output)




#asimijs @hardwarefun
Processor (Brain)




#asimijs @hardwarefun
Arduino
   Visual Basic for hardware
   Treat it like a computer
   Sensors are inputs
   Motors are output




       #asimijs @hardwarefun   Photo credit Arduino team
Demo




     Let there be LIGHT


#asimijs @hardwarefun
Code

void setup()
{
  pinMode(13, output);
}

void loop()
{
  digitalWrite(13,HIGH);
  delay(1000);
  digitalWrite(13,LOW);
  delay(1000);
}




     #asimijs @hardwarefun
Hardware setup




#asimijs @hardwarefun
Demo 2 - Reading sensor data

                        What you need?



            A Light sensor and a LED



#asimijs @hardwarefun
Reading sensor data
void setup()
{
  pinMode(13, OUTPUT);
}

void loop()
{
  int val = analogRead(A0);
  if (val > 50) {
      digitalWrite(13, HIGH);
  } else {
      digitalWrite(13, LOW);
  }
}
      #asimijs @hardwarefun
Exotic uses of Arduino
 Making YQL (REST) calls
 Parsing JSON
 Interacting with USB devices
 Interacting with Android phones
 … and lot’s more




     #asimijs @hardwarefun
Simple Moving Robot
 2 DC Motors and H-Bridge
 2 wheels and a body frame
 Battery




     #asimijs @hardwarefun
Teaching robot to crawl
Move Forward
    Both motors rotate in the forward direction

Move Backward
    Both motors rotate in the reverse direction

Turn left
      Left motor stops. Only right motor rotates forward

Turn Right
     Left motor moves forward. Right motor stops

      #asimijs @hardwarefun
Teaching robot to avoid strangers
   Two IR LED’s. One receiver, one transmitter
   Both face the same direction
   Keep transmitting IR waves
   If receiver receives waves, then there is a obstacle
   Otherwise keep moving




… same logic applies for Ultra sound as well.


       #asimijs @hardwarefun
Putting everything together


You have your first fully autonomous
           robot ready.

          Now take her for a walk 



 #asimijs @hardwarefun
What’s Next?


                     Do join us upstairs.

We are going to implement Machine
    Learning Alogo to Asimi 



 #asimijs @hardwarefun
BTW, this is how the demo worked

                           Node.js Server




                                            Node Client



 Admin page


                             User page
                              User page
                                User page




   #asimijs @hardwarefun
Links
 Arduino – http://arduino.cc
 AsimiJS – The demo that I showed initially
  http://hardwarefun.com/projects/asimijs
 Asimi – A simple bot using Arduino
  http://hardwarefun.com/project/asimi
 Getting started with hardware programming
  http://hardwarefun.com/tutorials/getting-started-with-
  hardware-programming
 Getting started with Arduino
  http://hardwarefun.com/tutorials/getting-started-with-arduino-
  and-avr




      #asimijs @hardwarefun
Questions

                        Thank You

                        Sudar Muthu (@sudarmuthu)
                          http://hardwarefun.com
                          http://gitbub.com/sudar




#asimijs @hardwarefun

Lets make robots

  • 1.
    Let’s make Robots Sudar Muthu (@sudarmuthu) Research Engineer, Yahoo! Labs http://hardwarefun.com http://github.com/sudar
  • 2.
    Why hardware fora software hacker? Fun! #asimijs @hardwarefun
  • 3.
    Let me showyou how fun it is.. Demo http://hardwarefun.com/projects/asimijs #asimijs @hardwarefun
  • 4.
    Participate in thedemo  Visit http://hardwarefun.com:3000 #asimijs @hardwarefun
  • 5.
    Control the botat stage http://hardwarefun.com/projects/asimijs #asimijs @hardwarefun
  • 6.
    Isn’t that fun? Now let’s see how you can build one #asimijs @hardwarefun
  • 7.
    Anatomy of aRobot Sensors Motors Processor #asimijs @hardwarefun
  • 8.
  • 9.
  • 10.
  • 11.
    Arduino  Visual Basic for hardware  Treat it like a computer  Sensors are inputs  Motors are output #asimijs @hardwarefun Photo credit Arduino team
  • 12.
    Demo Let there be LIGHT #asimijs @hardwarefun
  • 13.
    Code void setup() { pinMode(13, output); } void loop() { digitalWrite(13,HIGH); delay(1000); digitalWrite(13,LOW); delay(1000); } #asimijs @hardwarefun
  • 14.
  • 15.
    Demo 2 -Reading sensor data What you need? A Light sensor and a LED #asimijs @hardwarefun
  • 16.
    Reading sensor data voidsetup() { pinMode(13, OUTPUT); } void loop() { int val = analogRead(A0); if (val > 50) { digitalWrite(13, HIGH); } else { digitalWrite(13, LOW); } } #asimijs @hardwarefun
  • 17.
    Exotic uses ofArduino  Making YQL (REST) calls  Parsing JSON  Interacting with USB devices  Interacting with Android phones  … and lot’s more #asimijs @hardwarefun
  • 18.
    Simple Moving Robot 2 DC Motors and H-Bridge  2 wheels and a body frame  Battery #asimijs @hardwarefun
  • 19.
    Teaching robot tocrawl Move Forward Both motors rotate in the forward direction Move Backward Both motors rotate in the reverse direction Turn left Left motor stops. Only right motor rotates forward Turn Right Left motor moves forward. Right motor stops #asimijs @hardwarefun
  • 20.
    Teaching robot toavoid strangers  Two IR LED’s. One receiver, one transmitter  Both face the same direction  Keep transmitting IR waves  If receiver receives waves, then there is a obstacle  Otherwise keep moving … same logic applies for Ultra sound as well. #asimijs @hardwarefun
  • 21.
    Putting everything together Youhave your first fully autonomous robot ready. Now take her for a walk  #asimijs @hardwarefun
  • 22.
    What’s Next? Do join us upstairs. We are going to implement Machine Learning Alogo to Asimi  #asimijs @hardwarefun
  • 23.
    BTW, this ishow the demo worked Node.js Server Node Client Admin page User page User page User page #asimijs @hardwarefun
  • 24.
    Links  Arduino –http://arduino.cc  AsimiJS – The demo that I showed initially http://hardwarefun.com/projects/asimijs  Asimi – A simple bot using Arduino http://hardwarefun.com/project/asimi  Getting started with hardware programming http://hardwarefun.com/tutorials/getting-started-with- hardware-programming  Getting started with Arduino http://hardwarefun.com/tutorials/getting-started-with-arduino- and-avr #asimijs @hardwarefun
  • 25.
    Questions Thank You Sudar Muthu (@sudarmuthu) http://hardwarefun.com http://gitbub.com/sudar #asimijs @hardwarefun