Light Following DrawBot

My inspirations:

The Czech writer Karel Capek used the term « robot » for the first time in the context of a play called « Rossum’s Universal Robots » (or « R.U.U ») in 1921. The play staged a man who created a robot that would kill him later on. The irony is fascinating, wit robotics we are creating our best ennemis. In order to prevent such a situation, twenty years later (in 1942), the science fiction writer Isaac Asimov wrote in his short story « Runaround »  the « Three Laws of Robotics » which are:

1 A robot may not injure a human being or, through inaction, allow a human being to come to harm.

2 A robot must obey the orders given it by human beings, except where such orders would conflict with the First Law.

3 A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws.

In later books, Asimov added a zeroth law:

0 A robot may not harm humanity, or, by inaction, allow humanity to come to harm.

These rules avoid a situation where robots could take the control of our humanity and become stronger and more powerful than us.

For this project, I tried to consider both digital and physical worlds to create my Light Following Drawbot. I wanted to establish a connection and interaction between the created robot and us, as humans. With this project I want the robot and the human to be reconciled and I want them to collaborate in the artistic world to bring some novelty in the tracing of a drawing.

My final project:

I decided to create my own drawing robot that users could control using the flashlight of their smartphones. This interactive robot would follow the light and draw on his way.

PLEASE HAVE A LOOK AT THE FINAL VIDEO HERE

Instructable:

You can find out how I made it through this intructables page I created here

Or you can read the steps bellow:

To make it, here’s the list of materials you need:

This is a drawing of all the connections you need to make for the drawbot.

Sketch 2_bb

  1. Assemble the Robot Chassis. Use the instructions to assemble all the parts correctly. Take your time and try to avoid mistakes. You have to be patient for this project.
  2. Connect the motors to the Motor Shield, and then to the Arduino. Connect the positive side (red) of the first motor the + on the “A” section of the motor shield. The negative side (black) of this same motor to the – on the “A” section. Repeat this with the second motor on the “B” section. Then, place the motor shield on top of the Arduino. It will connect.
  3. Test the motors with a simple code to check if it works.                                                       
    1. void setup() {
      //Setup Channel A – right
      pinMode(12, OUTPUT); //Initiates Motor Channel A pin
      pinMode(9, OUTPUT); //Initiates Brake Channel A pin//Setup Channel B – left
      pinMode(13, OUTPUT); //Initiates Motor Channel B pin
      pinMode(8, OUTPUT); //Initiates Brake Channel B pin
      }void loop() {
      // go straight
      digitalWrite(12, LOW);
      digitalWrite(9, LOW);
      analogWrite(3, 200);digitalWrite(13, LOW);
      digitalWrite(8, LOW);
      analogWrite(11, 200);delay(1000);// go right
      digitalWrite(12, LOW);
      digitalWrite(9, LOW);
      analogWrite(3, 200);digitalWrite(13, LOW);
      digitalWrite(8, LOW);
      analogWrite(11, 20);
      delay(1000);// go left
      digitalWrite(12, LOW);
      digitalWrite(9, LOW);
      analogWrite(3, 20);digitalWrite(13, LOW);
      digitalWrite(8, LOW);
      analogWrite(11, 200);
      delay(1000);                                                                                                                                                               }                                                                                                                                                                                     Vidéo du 03-12-2015 à 11.28
  4. Now, connect the LDRs (with the resistors) to the Arduino. (check the image bellow) You have to connect the first LDR (that we call LDR0) to a 10k resistor. One pin goes to 5V, the other that is connected to the 10k resistor goes to an Analog pin (we choose the A2 pin) and the last one that comes from the resistor goes to the ground. Repeat this action with the second LDR (that we call LDR1) which goes to the 5V too, the pin A3, and the ground.
  5. Test the LDRs with a simple code to check if they work                                                           int LDR0 = A2; // right
    int LDR1 = A3; // leftvoid setup() {//ldr
    pinMode(LDR0, INPUT);
    pinMode(LDR1, INPUT);
    Serial.begin(9600);
    }void loop() {int valueLDR0 = analogRead(LDR0);
    int valueLDR1 = analogRead(LDR1)Serial.print(valueLDR0);
    Serial.print(“\t”);
    Serial.print(valueLDR1);
    Serial.print(“\t”);}

    • Then, make some tests by hiding one LDR and the other and check the values with the serial monitor
  6. Make a code that connects the motors to the LDRs                                                                   int LDR0 = A2; // right
    int LDR1 = A3; // left
    int threshold = 400; // you can change this value depending on the light of your environmentvoid setup() {//ldr
    pinMode(LDR0, INPUT);
    pinMode(LDR1, INPUT);
    Serial.begin(9600);//Setup Channel A – right
    pinMode(12, OUTPUT); //Initiates Motor Channel A pin
    pinMode(9, OUTPUT); //Initiates Brake Channel A pin//Setup Channel B – left
    pinMode(13, OUTPUT); //Initiates Motor Channel B pin
    pinMode(8, OUTPUT); //Initiates Brake Channel B pin
    }void loop() {int valueLDR0 = analogRead(LDR0);
    int valueLDR1 = analogRead(LDR1)if (threshold > valueLDR0 + 50 && threshold > valueLDR1 + 50) {digitalWrite(12, LOW);
    digitalWrite(9, LOW);
    analogWrite(3, 200);digitalWrite(13, LOW);
    digitalWrite(8, LOW);
    analogWrite(11, 200);delay(300);if (valueLDR0 > threshold || valueLDR1 > threshold) {
    if (valueLDR0 > valueLDR1) {
    //right
    digitalWrite(12, LOW);
    digitalWrite(9, LOW);
    analogWrite(3, 200);
    //left
    digitalWrite(13, LOW);
    digitalWrite(8, LOW);
    analogWrite(11, 20);delay(200);
    analogWrite(11, 200);
    delay(500);
    }else if (valueLDR1 > valueLDR0) {
    //right
    digitalWrite(12, LOW);
    digitalWrite(9, LOW);
    analogWrite(3, 20);
    //left
    digitalWrite(13, LOW);
    digitalWrite(8, LOW);
    analogWrite(11, 200);delay(200);
    analogWrite(3, 200);
    delay(500);}
    }
    } else {
    digitalWrite(9, HIGH); // stop right motor
    digitalWrite(8, HIGH); // stop left motor
    }

    Serial.print(valueLDR0);
    Serial.print(“\t”);
    Serial.print(valueLDR1);
    Serial.print(“\t”);

    }   wordpress

  7. Connect a potentiometer and an LED to the circuit, on the Arduino. (check the image bellow). The negative side of the LED goes to the digital pin 4. Its positive side goes to the first pin of the potentiometer which goes to the Ground. The second pin of the potentiometer goes the Analog pin A0, and the last pin goes to the 5V.
  8. Test the new connections with final the code
    int LDR0 = A2; // right
    int LDR1 = A3; // left
    int threshold;
    int led1 = 4;
    int potent = A0;void setup() {// led and potentiometer
    pinMode (led1, OUTPUT);
    pinMode(potent, INPUT);//Setup Channel A – right
    pinMode(12, OUTPUT); //Initiates Motor Channel A pin
    pinMode(9, OUTPUT); //Initiates Brake Channel A pin//Setup Channel B – left
    pinMode(13, OUTPUT); //Initiates Motor Channel B pin
    pinMode(8, OUTPUT); //Initiates Brake Channel B pin//ldr
    pinMode(LDR0, INPUT);
    pinMode(LDR1, INPUT);
    Serial.begin(9600);
    }void loop() {threshold = analogRead(potent);
    int valueLDR0 = analogRead(LDR0);
    int valueLDR1 = analogRead(LDR1) + 200;if (threshold > valueLDR0 + 50 && threshold > valueLDR1 + 50) {
    digitalWrite(4, HIGH); // turn on leddigitalWrite(12, LOW);
    digitalWrite(9, LOW);
    analogWrite(3, 200);digitalWrite(13, LOW);
    digitalWrite(8, LOW);
    analogWrite(11, 200);delay(300);if (valueLDR0 > threshold || valueLDR1 > threshold) {
    if (valueLDR0 > valueLDR1) {
    //right
    digitalWrite(12, LOW);
    digitalWrite(9, LOW);
    analogWrite(3, 200);
    //left
    digitalWrite(13, LOW);
    digitalWrite(8, LOW);
    analogWrite(11, 20);delay(200);
    analogWrite(11, 200);
    delay(500);
    }else if (valueLDR1 > valueLDR0) {
    //right
    digitalWrite(12, LOW);
    digitalWrite(9, LOW);
    analogWrite(3, 20);
    //left
    digitalWrite(13, LOW);
    digitalWrite(8, LOW);
    analogWrite(11, 200);delay(200);
    analogWrite(3, 200);
    delay(500);

    }
    }
    } else {
    digitalWrite(9, HIGH); // stop right motor
    digitalWrite(8, HIGH); // stop left motor
    digitalWrite(4, LOW); // turn off led
    }
    //read values
    Serial.print(valueLDR0);
    Serial.print(“\t”);
    Serial.print(valueLDR1);
    Serial.print(“\t”);
    Serial.println(threshold);
    }

  9. Use hard glue to keep the connections together. Be careful to keep your connections, they might not connect anymore if the hard glue disconnect the wires.
  10. Attach a pen to the robot !!
  11. Make the robot looks good, the way you want. I decided to use the same red plexiglass as the chassis to keep a cohesion. I lasercut it, and engraved the name of this project “Drawbot” and my name (tartourette). I also cut small rectangle to fix the top at a certain height (8cm in my case). Using hard glue I fixed them in a balanced way.

ENJOY YOUR LIGHT FOLLOWING DRAWING ROBOT !!!!!! AND MAKE GREAT ART

You can have a look at some pictures of the drawbot:

IMG_7024IMG_7015IMG_6958 IMG_6961

This is the first drawing I made with a black sharpie:

IMG_6880 IMG_6887

 

11 Thoughts on “Light Following DrawBot

  1. Rather! This was a really wonderful post. Thank you for your provided advice

  2. New to your blog. Stumbled upon it browsing the web. Keep up the great work. I am hoping you update it regularly.

  3. I am definitely bookmarking this website and sharing it with my acquaintances. You will be getting plenty of visitors to your website from me!

  4. This is a excellent blog, would you be involved in doing an interview about just how you designed it? If so e-mail me!

  5. I really like your article. It’s evident that you have a lot knowledge on this topic. Your points are well made and relatable. Thanks for writing engaging and interesting material.

  6. When visiting blogs, i usually discover a very good content like yours

  7. New to your blog. Stumbled upon it browsing the web. Keep up the great work. I am hoping you update it regularly.

  8. When visiting blogs, i usually discover a very good content like yours

  9. You are a very persuasive writer. I can see this in your article. You have a way of writing compelling information that sparks much interest.

  10. I cannot thank you enough for the post.Really looking forward to reading more. Want more.

  11. Good job on this article! I really like how you presented your facts and how you made it interesting and easy to understand. Thank you.

Leave a Reply to Leatrice Castle Cancel reply

Your email address will not be published. Required fields are marked *

Post Navigation