Controlling motors with a wiinunchuck (Bear on a tricycle)

Written by: admin@makezilla

WP_20160113_15_52_37_Pro.jpg

One of my first arduino project and a schoolproject for the HKU games & Interaction.

Want to build this project in smaller steps? Check out these tutorials I based this Instructable on!

  1. http://makezine.com/projects/wii-nunchuk-mouse-2/
  2. http://www.instructables.com/id/Control-your-motor...

Step 1: What you need:

Picture of What you need:

For the technical part:

  • Two stepper motors (2 phase, make sure that the motors are strong enough to carry all the equipment. I used mercury motor sm-42byg011-25)
  • DC adaptor 12V &1500 mA (depends on which motor you are using)
  • Two L293D chips
  • WiiNunchuck Arduino YÚN (I think you also can use the UNO but you have to see yourself)
  • barrel jack DC supply socket (optional) pens row header & breadboard (depends on when you want to make it on a breadboard or not)
  • soldering iron and tin

For the bear part:

  • Wood and a laser cut machine(optional)
  • Cardboard
  • Paint in which color you prefer
  • old paper(newspapers for example)
  • Wallpaper glue or some other glue you can use for paper mache

Step 2: Software

- download the arduino software: http://arduino.cc/en/Main/Software.

- Download the Arduino Nunchuk library zipfile at:https://github.com/Gabrielhttp://www.instructables.com/editInstructable/edit/EGPYBE7IJBPLT29/step/2#Bianconi/ArduinoNunchuk

- Add the file to your arduino software library

Step 3: Connect all the things!!

Picture of Connect all the things!!5696285150e1b654d2000383.jpeg

Yeah have a good look at diagram; it's a lot of wires. And if your a not a big cable manger you don't want to realize you made one mistake, so take your time to make it right.

Some notes:

  • look at the data sheet of your motors which threads are positive and which are negative and which threads belong together. It doesn't mater which couple you put on which side of the L293D chip it only change which way they will rotate.
  • The motor are connect identical except the pins in the arduino
  • Make sure you how you put the L293D chips in your breadboard; make sure they are both facing the same side.
  • the 12 volt battery you see in the image is the adaptor 12V

 

  • Make sure you first connect the micro usb adaptor (probably 5 volt) to the arduino first and after that the 12 volt adaptor. Otherwise it could damage your chips!

Step 4: Code

Download the code to make your motors turn on your command. This code makes the bear only go forward and backward, so no left and right!

  • Connect your Arduino to your computer via USB.
  • Open the Arduino Software.
  • You have to identify your arduino in the software; do this under Tools - Serial Ports to specify the port in which your Arduino is inserted.
  • Select your Arduino model under Tools - Board.
  • Upload the code to your Arduino and if everthing is correct your motors are now controlled by your wiiNunchuck!

http://www.instructables.com/files/orig/FV6/L664/IJBPM9ZG/FV6L664IJBPM9ZG.ino

Step 5: Build a bear

Picture of Build a bear569626f745bcebdbfc0012b0.jpeg569627844936d435b8000b2c.jpeg569627bb67400c120b000d4f.jpeg

As you may have noticed my arduino project is shaped as a bear on a tricycle (that secretly has four wheels for balance). I made this casing with laser cutting, cardboard and paper mache.

You can download my illustrator documents if you want to lasercut this case to just a couple of notes:

  • the meaning of the engraving in the arduino casing was that you could slide the back these engraved slothes. This failed for me, so you decide if you want to improve them or just throw the back of the case away.
  • The holes are made for my motor and round bar I used for the front wheels, so make them fit for your parts

For the case around the other case(the bear), I put a box over the other case and glued cardboard and paper until it looked like a bear. It's handy to make your base of the bear case while it's on your arduino case because I had the problem that my first case was to fat so i could not attach the tricycle part any more.

http://www.instructables.com/files/orig/FTX/PL32/IJBPMEIS/FTXPL32IJBPMEIS.ai

http://www.instructables.com/files/orig/F9C/NTFE/IJBPMEJ2/F9CNTFEIJBPMEJ2.ai

 

Step 6: Extra things

You don't find my project exciting enough for you?

Well some extra challenges you can add on this project:

  1. Make it wireless. That means 12v power supply on the inside and making the WiiNunchuck wireless (maybe use a wireless WiiNunchuck?)
  2. Make the bear poop candy, this was part of my original idea but I couldn't make it for my deadline for school.
  3. Making the bear turn. Alter the code for when X value on the WiiNunchuck is used the bear turns left/right.

Goodluck with making this project!

Leave a Reply