Introduction: Raspberry Pi CD Box Robot

About: Artista brasileiro interessado em gambiarras no geral!

English:

This project is a work that is taking on many weekends. My son, Gabriel, watched the movie "Wall-E" and proposed that we built a similar robot. I see this model in Dx.com and get inspired by it.

We use some scraps we find here at home, especially some old CDs and an empty tube of CDs.

The list of materials is as follows:

HARDWARE

  • A Raspberry Pi Model B, with 512Mb
  • An SD Card with Occidentalis.
  • Two sets of engine and Two Tires (I got the motors and tires from this item

http://www.dx.com/pt/p/four-wheel-drive-smart-robot-car-chassis-for-4wd-yellow-black-2-x-18650-178466)

SOFTWARE

Adafruit Occidentalis 0.2

TOOLS

  • Soldering iron
  • Pliers
  • Dremel
  • Multimeter

Portuguese:

Esse projeto é um trabalho que está nos tomando muitos finais de semana. Meu filho, Gabriel, assistiu ao filme "Wall-E" e propôs que nós construíssemos um robô parecido. Eu vi este modelo no Dx.com e quis fazer um negócio inspirado nele.

Nós utlizamos algumas sucatas que encontramos aqui em casa, principalmente alguns CDs velhos e um tubo vazio de CDs.

A lista de materiais é a seguinte:

HARDWARE

  • Um Raspberry Pi Model B, com 512Mb
  • Um SD Card com Occidentalis.
  • Dois conjuntos de motor e Dois Pneus (eu peguei os motores e pneus disso aqui:

http://www.dx.com/pt/p/four-wheel-drive-smart-robot-car-chassis-for-4wd-yellow-black-2-x-18650-178466)

  • Um controlador de motores Pololu
  • Um servo motor modelo HD1800A
  • Um sensor ultrassônico HC-SR04
  • Um monte de Fios
  • Placa universal
  • Um resistor de 1k
  • Um resistor de 2k
  • Conectores diversos
  • Pilhas e suporte
  • Pack com bateria e carregador solar

SOFTWARE

Adafruit Occidentallis 0.2

FERRAMENTAS

  • Ferro de soldar
  • Alicates
  • Dremel
  • Multímetro

Step 1: Mounting the Robot Plate

English:

The robot base was taken with the tube CD.
I have positioned the two motor holders at an angle of 60 ° to the front wheel. The distance is enough that the wheels are not rubbing with the base. I cut the center pin of the tube using a Dremel and a cutting disc for plastic. At the top of the tube, fixed the battery holder and the pololu motor driver too.

Portuguese:

A base do robô foi feita com o tubo de CD.
Eu posicionei os dois suportes de motor num ângulo de 60º em relação à roda dianteira. A distância é suficiente para que as rodas não fiquem atritando com a base. Cortei o pino central do tubo usando a Dremel e um disco de corte para plástico. Na parte de cima do tubo, fixei o suporte para pilhas e deixei o driver para motores também.

Step 2: Creating the Head

English:

The head was made with an empty roll of adhesive tape. I made a small board with the voltage divider for the ultrasonic sensor (which works at 5V while the Raspberry works with 3.3V). I followed this excellent tutorial ModMyPi.

The plate is affixed to the roll of tape and the sensor is connected to it. Then I set the roll of tape in my Servo motor.

Then set my servo motor to CD using a bottle cap, properly cut with the Dremel to fit the servo motor.

Portuguese:

A cabeça foi feita com um rolo vazio de esparadrapo. Fiz uma pequena placa com o divisor de tensão para o sensor ultrassônico (que trabalha a 5V enquanto o Raspberry funciona com 3,3V). Eu segui esse tutorial excelente do ModMyPi.

A placa fica colada no rolo de esparadrapo e o sensor fica conectado a ela. Depois, eu fixei o rolo de esparadrapo no meu Servo motor.

Então fixei meu servo motor ao CD usando uma tampa de garrafa, devidamente cortada com a Dremel para encaixar no servo motor.

Step 3: Wire Everything!

ENGLISH ONLY

From Raspberry Pi to Pololu Motor Driver

  • Raspberry Pi Pin 26 -----> Pololu PWMA
  • Raspberry Pi Pin 24 -----> Pololu AIN2
  • Raspberry PI Pin 22 -----> Pololu AIN1
  • Raspberry PI Pin 23 -----> Pololu BIN1
  • Raspberry PI Pin 21 -----> Pololu BIN2
  • Raspberry PI Pin 19 -----> Pololu PWMB
  • Raspberry PI Pin 06 -----> Pololu GND
  • Raspberry Pi Pin 04 -----> Pololu VCC and STBY (if Grounded, Motors don't work)

From Raspberry Pi to Servo Motor (The Servo Motor VCC and GND MUST BE connected to 6V Battery)

  • Raspberry Pi Pin 12 -----> Signal wire of servo motor (sometimes orange wire)

From Raspberry Pi to HC-SR04

  • Raspberry Pi Pin 20 ------> HC-SR04 Echo Pin
  • Raspberry Pi Pin 18 ------> To 1KΩ Resistor of Voltage divider. From there to HC-SR04 Trigger pin
  • Raspberry Pi Pin 02 ------> HC-SR04 VCC
  • Raspberry Pi Pin 09 ------> HC-SR04 GND

From Pololu TB6612FNG to motors and batteries

  • Pololu VMOT ------> +6V battery
  • Pololu AO1 ---------> Positive Lead Of MOTOR A
  • Pololu AO2 ---------> Negative Lead Of MOTOR A
  • Pololu BO2 ---------> Negative Lead Of MOTOR B
  • Pololu BO1 ---------> Positive Lead Of MOTOR B

Step 4: Now Get This Thing to Work!

ENGLISH

Now comes the most challenging part for me: programming.

We've done the first tests with engines, using this tutorial, making the necessary adjustments concerning the pinout of my engines.

The idea we have is the following:

  1. The robot moves forward until it encounters an obstacle at 30 cm it (using the ultrasonic sensor).
  2. It reduces your speed by half and starts to look around (moves the servo motor).
  3. Search the freest way (with more distant obstacle or no obstacle), turns the robot's body and restarts the loop.

I've been studying how it would do in Scratch using GPIO following these tutorials http://cymplecy.wordpress.com/scratchgpio/scratch-raspberrypi-gpio/

After I found out the Wyliodrin and also seemed quite interesting.

Finally, there is always good old Python.

We follow ...

PORTUGUESE

Agora vem a parte mais desafiadora para mim: programação.

Nós já fizemos os primeiros testes com os motores, usando esse tutorial, fazendo as devidas adaptações referentes à pinagem dos meus motores.

A idéia que temos é a seguinte:

  1. O robô se move para frente até encontrar um obstáculo a 30 cm dele (usando o sensor ultrasonico).
  2. Ele reduz sua velocidade à metade e começa a olhar para os lados (movimentos do servo motor).
  3. Procura o caminho mais livre (com obstáculo mais distante ou nenhum obstáculo), gira o corpo do robô e reinicia o loop.

Estive estudando como seria fazer em Scratch, usando GPIO seguindo esses tutoriais http://cymplecy.wordpress.com/scratchgpio/scratch-raspberrypi-gpio/

Depois eu acabei descobrindo o Wyliodrin e também me pareceu bastante interessante.

Por fim, sempre resta o bom e velho Python.

Seguimos...

Microcontroller Contest

Participated in the
Microcontroller Contest

Teach It! Contest Sponsored by Dremel

Participated in the
Teach It! Contest Sponsored by Dremel

Tech Contest

Participated in the
Tech Contest