EXTREME Snap Circuits Programmable Robot!

17K343

Intro: EXTREME Snap Circuits Programmable Robot!

In this Instructable you will learn how to build an EXTREME Snap Circuits Programmable Robot. First, you will learn how to install the PICAXE Programming Editor (the PICAXE is the microcontroller, or computer brain for your programmable Snap Circuits robot). Next, you will learn what a simple PICAXE program looks like and what it does. Then you will learn about the various parts and electronic components used to build robot. You will then assemble robot. Finally you will learn how to program and test the robot.

Vote for my Instructable in the Extreme Challenge. Click On the "Vote" button next to the Extreme Challenge banner above or you can vote for it here: https://www.instructables.com/contest/extreme/?show=ENTRIES (you may have to scroll through a few pages to find it).

Snap Circuits is an educational toy that teaches electronics with solderless snap-together electronic components. Each component has the schematic symbol and a label printed on its plastic case that is color coded for easy identification. They snap together with ordinary clothing snaps. The components also snap onto a 10 X 7 plastic base grid analogous to a solderless breadboard. There are several Snap Circuits kits that range from a few simple circuits to the largest kit that includes 750 electronic projects.

All the kits include manuals printed in color with easy to follow diagrams to assemble the projects. The illustrations for each project look almost exactly like what the components will look on the base grid when finished. Because the electronic symbol is printed on each electronic component, once the project is completed, it will look almost exactly like a printed electronic schematic.

To build the programmable Snap Circuits robot, I used parts from three different sets, the Snap Circuits Motion Detector, Snap Circuits Rover, and Snap Circuits Micro. Elenco does not currently have a Snap Circuits programmable robot product. I find this surprising since Elenco has developed the Snap Circuits Rover, which is a remote controlled rover and the Snap Circuits Micro that teaches you how program the PICAXE microcontroller and how to build circuits for the PICAXE, but Elenco has yet to develop a product that combines the PICAXE with the Snap Circuits Rover.

I designed the robot to be easy to build completely out of Snap Circuits parts and easy to program to inspire folks from 8 to 80 to get interested in robotics.

The following are the Snap Circuits parts you will need to build the robot (Snap Circuits parts or whole sets can be ordered from  C & S sales http://cs-sales.net/snapcircuits.html):

Software CD from the Snap Circuits XP or Snap-Micro I kit (if you do not have either of these kits you can download the PICAXE Programming Editor from http://www.picaxe.com/Software/PICAXE/PICAXE-Programming-Editor/)

1 10 X 7 Plastic Base Grid
1 Snap Circuits Rover
1 9 volt Battery Block B5
1 Motor Control IC U8
1 8 Pin Socket U14 With PICAXE 08m Installed
4 1KOhm Resistors R2
1 Slide Switch S1
1 USB Programming Cable
3 Single Snaps
9 Two Snap Conductors
1 Three Snap Conductor
2 Four Snap Conductors
1 Seven Snap Conductor
1 Orange Jumper Wire
1 Yellow Jumper Wire
1 Green Jumper Wire
1 Purple Jumper Wire
1 Gray Jumper Wire
1 White Jumper Wire

STEP 1: Installing the PICAXE Programming Editor

The PICAXE Programming Editor is the software you will use to program the PICAXE micro-controller installed on the Snap Circuits 8 Pin Socket U14 block (the PICAXE chip carrier). The software contains the flowcharting software, the editor that you can use to write BASIC programs and the compiler for the micro-controller.

BASIC is an acronym that stands for Beginners All-purpose Symbolic Instruction Code. It was created way back in the 1960s as an easy to understand programming language to introduce students to computer programming.

What's a compiler? Have you seen those geeky T-shirts that say "there are only 10 types of people in the world: those who understand binary, and those who don't?" If you find yourself scratching your head instead of laughing hysterically, then you don't understand binary. Computers, on the other hand, understand only binary. 1s and 0s. On and off.

I have heard of some people who can do binary code, or machine language in their heads, but the rest of us normal people would have a difficult time writing a computer program out of nothing but 1s and 0s. Instead we use a higher level language like BASIC to write software.

Have you ever been to a foreign country and didn't know the language? You can hire a translator to translate what you say into the language that the locals can understand. That's what a compiler does. Computers can't understand BASIC so a compiler translates the software you write in BASIC into machine code, or the 1s and 0s that computers can understand.

Part needed for this step:

Software CD from the Snap Circuits XP or Snap-Micro I kit (if you do not have either of these kits you can order the CD from Elenco or download the PICAXE Programming Editor from http://www.picaxe.com/Software/PICAXE/PICAXE-Programming-Editor/)

Install the PICAXE Programming Editor from the Snap Circuits XP or Snap-Micro I software CD (Windows XP/Vista/7). The setup program will auto run when you put the CD in the drive. Click the large button that says “Install the PICAXE Programming Editor software."

STEP 2: Installing the PICAXE Programming Editor (continued)

Insert the Snap Circuits USB Programming Cable into an empty USB port on your computer. Click on the PICAXE Programming Editor icon on your desktop to open the editor.

STEP 3: Installing the PICAXE Programming Editor (continued)

The Options dialog will automatically open (if the “Show options on startup” check box is checked). If it does not, go to View > Options. On the Mode tab, select 08M--this is your PICAXE microcontroller.

STEP 4:

Click on the Serial Port tab and select the COM port where your USB Programming Cable is connected. Click the Ok button to go to the programming editor. In the Programming editor click File and then click New Flowchart to start entering your flowchart.

STEP 5: A Sample Program for the PICAXE

This is what a PICAXE Programming Editor flowchart looks like. The flowchart in this example is very simple--can you guess what it does? It will turn a motor that is connected to pin 4 on the PICAXE for 10 seconds. We can take a look at how each step is processed.

The "start" terminator is ignored by the compiler, but is useful to you to easily locate the start of your program.

The "pause" process tells the PICAXE to wait 1000 miliseconds, or 1 second before proceeding to the next step in the program. When you tell the PICAXE to execute the program, you will notice a 1 second pause before anything happens.

The parallelogram flowchart symbol represents data, or input/output. It contains the command "high 4" and this command will set pin 4 high, which means the microcontroller will send voltage to that pin, or output current to that pin. If you have a motor connected to pin 4 then current from this pin will pass through the motor and the motor will begin to spin.

This "pause" process tells the PICAXE to wait 10000 miliseconds, or ten seconds. This means pin 4 will remain high for 10 seconds thus continuing to send current to the motor for ten seconds (the motor will spin for ten seconds).

This data flowchart symbol contains the command "low 4." It tells the PICAXE to turn the pin off, or to output 0 volts. This will cut power to the pin and the motor connected to it will stop spinning.

If you want to see what the BASIC code looks like, you can click Flowchart and then click Convert Flowchart to BASIC. The code will look like the the following:

‘BASIC converted from flowchart:
‘C:\DOCUMENTS AND SETTINGS\DESKTOP\SNAPROVERBOT.CAD
‘Converted on 10/30/2011 at 20:53:11
main:
pause 1000     'Tells the PICAXE to wait 1000 miliseconds (1 second)
high 4                'Sets pin 4 high, which sends current to pin 4 (if there is a motor connected it will spin)
pause 10000   'Tells the PICAXE to wait 10000 miliseconds (10 seconds--motor will spin for 10 seconds)
low 4                  'Sets pin 4 low, or ouputs 0 volts. This cuts the power to the pin and the motor stops spinning

STEP 6: The PICAXE Microcontroller

What’s this PICAXE thingy? The PICAXE is a micro-controller, or a computer on a microchip. It is the computer brain of your robot. It’s not as powerful as the computer in your video game console, or your laptop computer, but it does have circuits for processing, memory, logic, input and output. You can find micro-controllers in many toys, your DVD player, your TV, your microwave oven, and nowadays even in your washing machine and dryer. In your microwave, for example, the micro-controller processes what you punch in on the keypad, outputs information on the display screen, controls the cooking time, the turntable, and the bell when your dinner has finished cooking.

The Snap Circuits block (U14) that serves as the PICAXE carrier is specially labeled to more easily identify the pins on the PICAXE microcontroller chip. Think of the chip as a square bug with eight legs. There is a notch in the top to help you orient the chip and a little dot marks leg 1. Legs and pins can sometimes get confusing, but on the U14 block the legs (and the corresponding snaps the legs are connected to) are labeled in red 1-8 going in the counterclockwise direction. The functions of each leg are labeled in blue.

Leg 1 (snap 1): This is the postive (+) voltage input. It can take from 3 volts to 5 volts. You will want to avoid putting more than 5 volts through the PICAXE since this might damage it.

Leg 2 (snap 2): S-In. Serial In pin--it is used to download your program to the PICAXE.

Leg 3 (snap 3): This pin 4! Luckily the snaps are labeled or the pin numbers could get confusing. Pin 4 can be used as an Input pin or an output pin. In the previous step this is the pin the program set to high to send current to the motor for ten seconds. then the program set the pin low to cut the power to stop the motor from spinning.

Leg 4 (snap 4): This is pin 3. It is an Input only pin

Leg 5 (snap 5): This is pin 2. It can be used as an Input pin or an output pin

Leg 6 (snap 6): This is pin 1. It can be used as an Input pin or an output pin

Leg 7 (snap 7): This is pin 0. It is an Ouptut only pin. It is also the Serial Out pin. This pin will also be used when downloading your program to the PICAXE.

Leg 8 (snap 8): This is GND or Negative (-) for the PICAXE

STEP 7: Snap Circuits Rover

Now that you have installed the PICAXE Programming Editor and learned how to write a simple program, its time to starte building your robot. There are three basic parts that you need to build a robot: a power source, a brain (the PICAXE of course) and a means of locomotion.

The Snap Circuits Rover is one example of locomotion. It has advantages and disadvantages.

Advantages:

It is a ready-made vehicle. In other words, you don't have to build a vehilce--it is already built for you.

It has two motors, one on the right side and one on the left side. Each motor is connected to the front and rear wheels by a series of geers (the geering was added in to slow the Rover down rather than a need for extra torque) so that the right motor turns the right front and rear wheels, and the left motor turns the the left front and rear wheels. In the first picture You can see the front of the rover as well as the gears that connect the left side wheels to the left side motor.

It is designed to have the Snap Circuits base plate connected directly to it. It is also designed so that power and motor control are easily connected with Snap Circuits jumper wires. In the second picture you can see the base plate attached. You can also see the snaps on the rear of the rover. The third picture explains the function of each snap.

It has a battery compartment for six AA batteries to power the motors with 9 volts.

Disanvantages:

It is not designed to have attachments such a robotic grabber arm attached to it.

You must be careful to design your circuit so that you do not accidently pass the 9 volts from the rover's battery pack through the PICAXE microcontroller since this will most likely damage the PICAXE.

STEP 8: The Voltage Regulator

The simplest way to power the rover and power the PICAXE is to use two different power supplies that share a common ground. To power the PICAXE, you can use the Snap Circuits B5 block. The advantage to using this block is you can connect a standard 9 volt battery to the block and it will deliver a reliable 5 volts to the PICAXE through L7805 voltage regulator circuit (see circuit schematic). The B5 also has two 5 volt outputs--one to power the PICAXE and one that you can use to power another device.

Now you have a convenient way of powering your PICAXE with a reliable 5 volts from the B5 block. As a safety feature for the PICAXE, it would also be a good idea to keep the 9 volts from the rover separate from the PICAXE in case while you are building and testing the circuit something gets connected the wrong way. Thus for this build you will use an H-bridge. It has special circuitry inside it that will prevent the 9 volts from the rover's battery pack from accidently passing through the PICAXE.

STEP 9: The H-bridge

The first picture is a simplified H-bridge. The motor in the center is connected to 9 volts of power and ground by four switches (S1, S2, S3, and S4). With all four switches off, the motor will not get any power and the motor will not turn. The switches can be turned on in pairs: S1 and S4 or S3 and S2 to allow current to pass from the 9 volt batteries through the motor to negative or ground.

Now take a look at the second picture.

If you close switches S1 and S4, current will flow through the motor and it will turn in one direction.

If you close switches S3 and S2, current will flow through the motor and it will turn in the opposite direction.

The H-bridge is a very simple circuit. Unfortunately it would be impractical to use manual switches to drive a motor. Several companies make H-bridge integrated circuits (ICs) that are easy to use by simply applying power to a particular pin also called "setting the pin high" to drive the motor in one direction. Cutting the power to that pin and applying power to another pin will drive the motor in the opposite direction. The circuitry inside the H-bridge ICs is somewhat complicated, so most folks will choose to use an H-bridge IC rather than building the circuit themselves.

The third picture is the Snap Circuits Motor Control IC, or H-bridge. At the top of the figure you can see the electronic schematic of the Motor Control block. On the lower left you can see a picture of the block. The lower center shows the function of each snap for the block and on the lower right is a description of what each snap does.

STEP 10: Build the Robot Circuit

Build the circuit as shown in the diagram. You can also look at the pictures for a step by step build.  Here are the Snap Circuits parts I used:

1 10 X 7 Plastic Base Grid
1 Snap Circuits Rover
1 9 volt Battery Block B5
1 Motor Control IC U8
1 8 Pin Socket U14 With PICAXE 08m Installed
4 1KOhm Resistors R2
1 Slide Switch S1
1 USB Programming Cable
3 Single Snaps
9 Two Snap Conductors
1 Three Snap Conductor
2 Four Snap Conductors
1 Seven Snap Conductor
1 Orange Jumper Wire
1 Yellow Jumper Wire
1 Green Jumper Wire
1 Purple Jumper Wire
1 Gray Jumper Wire
1 White Jumper Wire

STEP 11: Program the Robot

To create a new flowchart, click File and then click New Flowchart. Use my example flowchart to make your own flowchart.

I’ve divided up each function into columns to make the flowchart easier to read. In the first column under “start” are the commands to test the robot’s left forward motor. This will cause the robot to turn right. Under the label “Test left backward” are the commands to turn the robot’s left motor backwards. This will cause the robot to turn left. The next four columns are the commands to test the right motor turning forward and backward, then turn both left and right motors forward (robot rolls forward), and finally turns both motors backwards (robot rolls backwards).

You can also convert the flowchart into BASIC program code. Click Flowchart and then click Convert Flowchart to BASIC. The following is what the code will look like in BASIC (I added the comments in the code to describe what the code does):

‘BASIC converted from flowchart:
‘C:\DOCUMENTS AND SETTINGS\DESKTOP\SNAPROVERBOT.CAD
‘Converted on 10/30/2011 at 20:53:11
main:
‘Snap Rover programmable robot

‘Test left forward
  pause 1000              'Wait one second before proceeding
  high 0                         'switch left forward motor on
  pause 2000              'left forward motor rotates for 2 seconds
  low 0                           ''switch left forward motor off
‘Test left backward
  pause 1000              'Wait one second before proceeding
  high 1                         'switch left backward motor on
  pause 2000              'left backward motor rotates for 2 seconds
  low 1                          'switch left backward motor off
‘Test right forward
  pause 1000             'Wait one second before proceeding
  high 2                        'switch right forward motor on
  pause 2000             'right forward motor rotates for 2 seconds
  low 2                         'switch right forward motor off
‘Test right backward
  pause 1000              'Wait one second before proceeding
  high 4                        'switch right backward motor on
  pause 2000              'right backward motor rotates for 2 seconds
  low 4                          'switch right backward motor off
‘Test forward
  pause 1000             'Wait one second before proceeding
  high 0                        'switch left forward motor on                    
  high 2                        'switch right forward motor on
  pause 2000             'motors rotate for two seconds
  low 0                         'switch left forward motor off
  low 2                         'switch right forward motor off
‘Test backward
  pause 1000             'Wait one second before proceeding
  high 1                        'switch left backward motor on
  high 4                        'switch right backward motor on
  pause 2000             'motors rotate for two seconds
  low 1                         'switch left backward motor off
  low 4                         'switch right backward motor off
‘End program
  stop

The code is very simple but should demonstrate how easy it is to program the Snap Circuits Robot.

STEP 12: Test the Robot Program

To run the program, make sure the Snap Circuits Slide Switch S1 is switched off else the program will execute while the program is still downloading to the PICAXE and may accidentally disconnect the programming cable as the robot runs through the motor tests. Next, make sure that the Snap Circuits 9 volt Battery Block B5 is switched on or the program will not download to the PICAXE. Connect the Snap Circuits USB Programming Cable to your computer.

1.  Connect the orange snap to the S-In snap on the 8 Pin Socket U14 block (the PICAXE chip carrier).

2.  Connect the yellow snap to the S-Out snap on the 8 Pin Socket U14 block (the PICAXE chip carrier).

3.  Connect the black snap to the GND, or negative (-) snap on the 8 Pin Socket U14 block (the PICAXE chip carrier).

In the Programming Editor click PICAXE and then click Run. A status bar will display to show the progress of the download of the program to the PICAXE.

Wait a minute or so after the program finished downloading, disconnect the programming cable, then place the robot on the floor a safe distance from any obstacles. Then switch the Snap Circuits Slide Switch S1 to on. When you are ready to watch the motor tests, switch on the Snap Circuits 9 volt Battery Block B5 and watch the robot perform the motor tests.

Congratulations! In this Instructable you learned how to build an EXTREME Snap Circuits Programmable Robot. You learned how to install the PICAXE Programming Editor. You learned what a simple PICAXE program looks like and what it does. Then you learned about the various parts and electronic components used to build the robot. You then assembled robot. Finally you learned how to program and test the robot. Happy hacking!

3 Comments

how to connect picaxe with computer without cable???

I am a blind user of snap circuits. I am wondering if you can write instructions for your kit as I ahve done below for one of the 8 segment display circuitts. I am not able to follow graphic instructions. It only takes about 10 minutes to write instructions just put your robot together and take it appart in reverse order. As you take it appart write the instructions. When you are done takign it appart the last piece you take off should be instruction1. I have about 12 of the rover kits, 15 of the extreem kits and 15 of the light kits wrote out and I am wroking on making accessible kits for the blind. I would love to build your robot but can't unless you help. Thanks. You can email me at kperry@blinksoft.com

Project: 8 segment display c to C
8 segment display description. And input
The display is upright when the side with three snaps is at the top.


1. Place Digital Display B6 B8 with A and B on A6 A8 side covers to E6 E8
2. Place Q2 long side E2 E4 Emitter on E2
3. Place U2 covers A1 A3 to B1 B3 three snaps on A1 A3 side
4. Place standoff E2
5. Place 7 Connector G1 G7
6. Place standoff D6
7. Place 2 Connector B6 C6
8. Place R5 A4 C4
9. Place standoff C4
10. Place 3 Connector B3 D3
11. Place 2 Connector C3 C4
12. Place 6 Connector B1 G1
13. Place C3 capacitor D1 D3 braille on D3
14. Place 2 connector E1 E2
15. Place 2 Connector A3 A4
16. Place 2 Connector A1 A2
17. Place 2 Connector A2 A3
18. Place D3 Diode B9 D9 positive side D9
19. Place Battery Pack A7 A9 positive side A7
20. Place 2 Connector A7 B7
21. Place 4 Connector A4 A7
22. Place 2 connector A9 B9
23. Place battery pack E9 G9 positive side on E9
24. Place 2 Connector D9 E9
25. Place Red wire B6 D3
26. Place black wire C8 E4
27. Place L2 lamp E6 G6
28. Place 2 Connector D6 E6
29. Place S1 switch G7 G9