Introduction: Attiny Canbot
This short Instructable will show you how to create a remote-controlled robot using 3D-printed parts and an Attiny85.
Step 1: Aquire Components
Parts list:
1x Atmel Attiny85
2x HXT900 from Hobbyking or any same sized micro servo
1x 3,7V LiPo battery (e.g. http://www.dx.com/de/p/tigers-3-7v-600mah-15c-lith...)
1x HC-SR04 Ultrasonic range sensor
1x 38kHz Infrared receiver (e.g. https://www.conrad.de/de/ir-empfaenger-sonderform-...)
1x 9 x 4mm switch (or use a jumper)
3D printed parts: http://www.thingiverse.com/thing:965449
1x bottom.stl
1x top.stl
2x wheel.stl
Print the top and bottom parts with the flat side down and supports enabled.
Depending on your printer and servos you will have to sand those parts down a bit.
Step 2: Electronics
Modify the servos for continuous rotation. You can find a nice tutorial here:
https://learn.adafruit.com/modifying-servos-for-co...
Connect the components as shown in the circuit diagram.
It may help to use a small prototyping pcb and thin wires.
Step 3: Programming
You can program the Attiny85 using Arduino code and an Arduino as a programmer:
http://highlowtech.org/?p=1695
The full source code can be downloaded from this Instructable (or the Thingiverse page).
The infrared receiver works best with Sony remotes.
You will have to flash the code to an Arduino and output the data via Serial.print().
This way you can find out which button corresponds to which code.
Attachments
Step 4: Assembly
Place the components inside the robot using hot glue.
The two halves of the 3D-printed shell can be assembled using the screws that come with the servos.

Participated in the
3D Printing Contest 2016

Participated in the
Robotics Contest 2016
23 Comments
8 months ago
大家好,我來自台灣,也準備做此項目,遙控器也買好了,我在用遙控器按下按鈕(前/後/左/右/自動模式)觀看發射編碼,已出現了,編碼保存下來,在從代碼的初使化遙控器動作指令也修改好了,其它全都備好材料(付圖),今天會開始組裝,不用多久,我會在一次發表評論喔!
Hello everyone, I'm from Taiwan, and I'm going to do this project. I also bought the remote control. I'm using the remote control to press buttons (front/rear/left/right/auto mode) to watch the transmit code, it has appeared, the code is saved Down, after the initial activation of the code, the remote control action command has also been modified, and all the other materials are prepared (attached picture), and the assembly will start today, and it will not be long before I will post a comment!
6 years ago
SNAKES TELL ME WHAT CONTROLLER I SHOULD BUY
Reply 6 years ago
What's up with snakes?
What remote you need depends on how experienced you are with Arduino and electronics. If you needs something for beginners you could look for a complete kit like this: https://www.sparkfun.com/products/13235
You can also take the remote from your TV and figure out the code somehow. But that is more difficult.
6 years ago
what remote should I buy?
7 years ago
Sorry to bother you again but, do you have to sync the remote to make it work or does the sensor just take in the info? Thanks again!
7 years ago
Does this ronot move atonomously without the remote or do you have to reprogram the chip? I really like your design!
Reply 7 years ago
The easiest way would be to delete the IR function and place just this in the main loop:
if(getDistance() < 10){ // check if you are in front of an obstacle
moveMotors(94, 20); // drive backward in a curve
delay(400); // give the robot time to balance out
}
else{
moveMotors(120, 120); //drive straight forward
}
But you have to experiment a bit until it will work.
Reply 7 years ago
Thanks!
Right now you need to press a button on the remote to enter the autonomous mode.
But if you are capable of programming the Attiny with an Arduino, changing a few lines in the code should not be a problem for you.
Reply 7 years ago
Thanks!
Reply 7 years ago
i tried to modify the code , but no results.. can anyone help please :( ?
Reply 7 years ago
What did you try?
Reply 7 years ago
I tried to make the code work without the ir reciver, but robot keeps walking , i'm not good to programmming, can you do tjee code for me please? I only need to delete the infrared part
7 years ago
you think laser cutting would work?
7 years ago
Nice project , to bad for me i cant get 3d printer...
Reply 7 years ago
I can print and ship it for you. Email me at 3dprintstore5 at gmail.com
Reply 7 years ago
I don't know where you are, but some libraries are getting 3D printers.
7 years ago
did you put the ultrasonic sensor for balancing? thx
Reply 7 years ago
The sensor is for only autonomous navigation. The robot balances by itself because there is more weight at the bottom than at the top.
Reply 7 years ago
yes, but how can you control the pitch? can you share a video about it? with it controller? thanks I'm very interested :)
Reply 7 years ago
There is a video on top of this page. The robot is can be controlled pretty good, but it is not as smooth as e.g. Sphero which has better motor control and a gyro to stabilize it.