Tom's Main Menu

Physical Computing Home

Intro to Physical Computing Syllabus

Networked Objects

Sustainable Practices

blog

Resources

code, circuits, & construction

my del.icio.us links

 

The BASIC Stamp

 

The BASIC Stamp is a micro controller, a small and very simple computer. Like any computer, it needs input devices and output devices, and power. The various pins on the BASIC stamp chip are where we attach these.

These notes assume the user is using the BASIC Stamp 2, which has 16 input/output pins. Below is the diagram for the Stamp 2:

(The bottom of the stamp is the part with the big chip with many legs)

PWR - Input power, 5-12V DC
GND - Ground
RES - Reset. restarts whatever program the stamp is running. The line above RES means this is an "active-low" pin. In other words, to activate it, attach it to ground.
+5V - 5V DC output power, for devices attached to the stamp. Digital and analog inputs and outputs attach to these pins.
P0-P15 - input/output pins, how the stamp communicates with the rest of the world
TX - transfer; used to send programming data out of the stamp to the computer used to program the stamp
RX - receive; used to send programming data into the stamp
ATN - Attention, a pin used to confirm communication between stamp and programming computer

Electronic chips, or integrated circuits (IC's) like the stamp generally have their pins numbered in a U-shape, starting at the top left, moving down, and ending at the top right. So in the above diagram, the TX pin is pin 1, and the PWR pin is pin 24. This gets confusing when you start talking about the I/O pins (e.g. I/O pin 0 is actually physical pin 5). So make sure you are clear on which pin is which before you start wiring.

Each of the input/output pins (P0 through P15) can be used as either an input or an output. As an input, a pin waits for voltage from an outside source. As an output, a pin generates voltage. As with any computer, input and output is binary, a series of 1's and 0's. Think of each as a switch: if an output is ON, it's sending a 1. if it's OFF, it's sending a 0. Likewise, if an input is getting voltage, it's ON, or receiving a 1, and when it's not getting voltage, it's OFF, or receiving a 0.

The stamp operates on 5 volts direct current power (5V DC). So 5V of input is a 1, and less than that is 0. On the output side, a 1 is 5 volts, and a 0 is 0 volts.

Using the stamp is very simple. First, you wire a power supply to it . Then, you attach input devices and output devices. Then you program it.

Powering the stamp

The stamp requires between 5 and 12 volts DC, wired to the power (PWR) and ground (GND) pins (physical pins 24 and 23; see diagram above). When properly powered, the stamp contains a power regulator that will produce 5V from the +5V pin (physical pin 21; see diagram). You can use this 5V as a source for various devices that you wire to the stamp. It doesn't produce a lot of current, however, so some devices may need to be powered separately. Generally, switches, LED's, transistors, and relays can be powered from this source without any problem; other devices, like motors, need a separate power source.