Table of Contents

Table of Contents. 1

Introduction. 1

Project Operation. 2

NES Controller 2

Tiny26L Microcontroller 3

Motor Controller 3

Physical Chassis. 4

Appendix A - Parts List 7

Appendix B - Silk Screens. 10

Tiny26 Microcontroller Board. 10

Motor Controller Board. 10

Charger Board. 10

Appendix C - Schematics. 11

Tiny26 Board. 11

Motor Controller Board. 11

Charger Board. 12

Appendix D - Tiny26 Code. 13

Introduction

Da Vinci Days1 is an annual celebration of innovation in which the innovators in Oregon meet together and celebrate creativity and unique engineering. Leonardo Da Vinci is still one of the greatest inventors and idea fountain to have ever lived.

 

The quote from IEEE (Institute of Electrical and Electronics Engineering) shows how important Leo is to engineering. "Leonardo developed a unique new attitude about machines. He reasoned that by understanding how each separate machine part worked, he could modify them and combine them in different ways to improve existing machines or create inventions no one had ever seen before."2

 

This modular engineering is what TekBots emphasizes. Freshman engineering students are given small modular pieces of electronics in their lab. Using ingenuity and perseverance, brand new inventions can be created using these smaller well understood pieces.

 

TekBots has typically run an art robots booth every year during this fair. This portion of the fair generates some good publicity, because everyone loves to control a robot to draw a picture on a large sheet of butcher paper.


This report focuses on the next generation of art robots. The questions of how they are created, how they work, and what parts are used to build them are all answered within. Students or hobbyists should be able to build a robot for $10 using this report as a useful reference source.

Project Operation

Figure 1 is the high level diagram. The user pushes buttons, the buttons are read and processed, and then the art robot moves.

Figure 1: High level functional diagram

Figure 2 shows the flow of information processing in the next generation of art robots. The user will push buttons and use the direction pad on the Nintendo Entertainment System controller. That data is sent through a serial line to the Tiny26. The Tiny26 interprets the serial line and sends the latch and clock signal to the NES controller. Four motor control lines are used to specify on/off and forward/backwards in the motor controller. A motor controller is necessary because the motors require more electrical current than the Tiny26 can provide.

 

Figure 2: Diagram of the overall operation

NES Controller

Figure 3: Picture of an NES controller

The Nintendo Entertainment System raised many children of Generation X. Most everyone has a nostalgic connection to this square piece of plastic. This controller has instant appeal to people from the age of 15 to 30. It is also durable enough to withstand the innocent fury of toddlers.

 

This website3 provided the information to reverse engineer the NES controller. It is just an eight bit serial shift register. Figure 4 shows the timing diagram used to read the buttons. The latch and clock signal are sent in from the Tiny26 while the serial data line is read.

 

Figure 4: Timing diagram used to read the buttons

Tiny26L Microcontroller

Figure 5: Photo of the Tiny26

The Tiny26L board is used in ECE 111. This board is fairly cheap at just five dollars, but the capability of it is amazing. It can use an 8 MHz clock, and was programmed in C to act as the brain of the art robot. The code is commented and explained in appendix D.

Motor Controller

Figure 6: Motor Controller Board

The motor controller is used in ECE 112. The board costs 12 dollars and could be replaced by a single integrated circuit. This would allow for a tinier art robot, and would reduce the cost per robot.

Physical Chassis

Figure 7: Side view of the chassis

The prototyping robotic chassis is designed to be compact, maneuverable, easy to work on, and cheap. It is not the final chassis for the art robot. It lacks durability and cute factor. Figure 8 shows the toy that fixes both of those problems. It was just $3 from Goodwill and it is perfect for the design. The primary colors appeal to children, and the toy is designed to be durable enough for toddlers as well. It's also durable enough to drive off of a 3 foot table and not break (actually tested).

Figure 8: Toy from Goodwill for $2.99.

Integrating the electronics into a different frame takes time and planning. The first thing to look for in a toy is interior space and wheel size. This toy has plenty of space to mount motors and electronics into. Figure 9 shows the mounting scheme that is used in the new art robot.

Figure 9: Complex electronics integrated in a child toy

The final product looks professional, and uses the NES controller. Some additions are beepers, lights, and mechanical arms to control the pens. The NES controller is a good addition to the art robot. The entire project costs $20. The cost could be reduced to just $10 if the charger board isn't included.

Figure 10: Finished project

 


Works Cited:

 

  1. Da Vinci Days [homepage on the Internet]. Corvallis, OR [cited 2006 Mar 14]. Available from: http://www.davinci-days.org/contact.php

 

  1. Leonardo Da Vinci [Internet]. IEEE [homepage on the Internet]. [cited 2006 Mar 14]. [about 5 screens]. Available from: http://www.ewh.ieee.org/r10/bombay/news5/LeonardoDaVinci.htm

 

  1. NES Controller Schematic [homepage on the Internet]. [cited 2006 Mar 14]. Available from : http://seb.riot.org/nescontr/

 

  1. Motor Controller Hardware Page [Internet]. TekBots [homepage on the Internet]. [cited 2006 Mar 14]. [about 1 screen]. Available from: http://eecs.oregonstate.edu/tekbots/mtr_ctlr.1/

 

 

  1. Charger Board Hardware Page [Internet]. TekBots [homepage on the Internet]. [cited 2006 Mar 14]. [about 1 screen]. Available from: http://eecs.oregonstate.edu/tekbots/chrg.1/

 

  1. Tiny26 Microcontroller Hardware Page [Internet]. TekBots [homepage on the Internet]. [cited 2006 Mar 14]. [about 1 screen]. Available from: http://eecs.oregonstate.edu/tekbots/tiny26.0/

 

 

 


Appendix A - Parts List4-6


 

 



Appendix B - Silk Screens4-6

Tiny26 Microcontroller Board

Motor Controller Board

Charger Board

 

Appendix C - Schematics4-6

Tiny26 Board

Motor Controller Board

Charger Board

Appendix D - Tiny26 Code


/******************************************************************************

* ArtBot

*****************************************************************************/

 

#define F_CPU 1000000UL

 

#include <avr/io.h>

#include <avr/delay.h>

#include <avr/signal.h>

#include <avr/interrupt.h>

#include <avr/sleep.h>

 

unsigned char ReadSignal = 0; //Holds the NES controller byte

 

void Read_NES (void) {//This function reads which buttons are pressed on the controller

 

//strobe the latch signal

PORTB |= 0x20;

_delay_us(100); //delay 100 microseconds

PORTB &= 0xDF;

_delay_us(100);

 

//read the A button

ReadSignal |= !(PINB&0x10);

 

//toggle the clock

PORTB |= 0x40;

_delay_us(100);

PORTB &= 0xBF;

_delay_us(100);

 

//read the B button

ReadSignal |= !(PINB&0x10) << 1;

 

//toggle the clock

PORTB |= 0x40;

_delay_us(100);

PORTB &= 0xBF;

_delay_us(100);

 

//read the Select button

ReadSignal |= !(PINB&0x10) << 2;

 

//toggle the clock

PORTB |= 0x40;

_delay_us(100);

PORTB &= 0xBF;

_delay_us(100);

 

//read the Start button

ReadSignal |= !(PINB&0x10) << 3;

 

//toggle the clock

PORTB |= 0x40;

_delay_us(100);

PORTB &= 0xBF;

_delay_us(100);

 

//read the Up button

ReadSignal |= !(PINB&0x10) << 4;

 

//toggle the clock

PORTB |= 0x40;

_delay_us(100);

PORTB &= 0xBF;

_delay_us(100);

 

//read the Down button

ReadSignal |= !(PINB&0x10) << 5;

 

//do the clock

PORTB |= 0x40;

_delay_us(100);

PORTB &= 0xBF;

_delay_us(100);

 

//read the Left button

ReadSignal |= !(PINB&0x10) << 6;

 

//toggle the clock

PORTB |= 0x40;

_delay_us(100);

PORTB &= 0xBF;

_delay_us(100);

 

//read the Right button

ReadSignal |= !(PINB&0x10) << 7;

_delay_us(100);

}//end of Read_NES

 

void Move_Motors(void) { //This function decides which direction to move the motors

//**************Generate Motor Control Signals*******//

//Turn all motor signals to 1

PORTB |= 0x0F;

 

//Zero the Start, Select, A, and B bits in register

ReadSignal &= 0xF0;

 

//Zero the proper motor control signals

if(ReadSignal == 0x10)

{ // Left Right

PORTB &= 0xF5; // /\ /\ Forward

}else if(ReadSignal == 0x90)

{

PORTB &= 0xF6; // /\ -- Swing Right

}else if(ReadSignal == 0x80)

{

PORTB &= 0xF4; // \/ /\ Spin Right

}else if(ReadSignal == 0xA0)

{

PORTB &= 0xFC; // \/ -- Rev Swing Left

}else if(ReadSignal == 0x20)

{

PORTB &= 0xF0; // \/ \/ Reverse

}else if(ReadSignal == 0x60)

{

PORTB &= 0xF3; // -- \/ Rev Swing Right

}else if(ReadSignal == 0x40)

{

PORTB &= 0xF1; // /\ \/ Spin Left

}else if(ReadSignal == 0x50)

{

PORTB &= 0xFD; // -- /\Swing Left

}

}

 

int main (void) {

 

//This following code sets up the operation for I/O.

//The actual looped program begins at while(1)

DDRA=0xFF;

PORTA=0x00;

DDRB=0x6F;

//Loop the following code as long as 1 = 1;

while(1)

{

Read_NES(); //read the controller

Move_Motors(); //move the motors

 

//Zero the register in the Tiny26 that holds button information

ReadSignal = 0;

 

//Sets the poll rate of the buttons to 200 times a second

_delay_ms(5);

}//End of While(1)

}//End of Main();