Skip to content


1-Hour $15 Hobby Microcontroller How-To

Picaxe10Another great article showing that microcontroller hobby projects are neither hard nor expensive. James shows us how to use a Picaxe microcontroller for easy and inexpensive hobby microcontroller projects. With one hour and $15 in parts, you are up and running with a microcontroller.

This article was submitted by James Moxham as part of the “Hobby parts for articles” program. James receives a Modern Device Company Bare Bone Arduino Kit for this great article.

Build a working microcontroller circuit on a shoestring budget. Microcontrollers have a reputation for being expensive and having complex instructions. This how-to shows that you don’t need complex pre-built demonstration boards or expensive equipment. In addition to the parts you will need a PC with access to the internet. This little circuit will turn a led on when it gets dark, which is a trivial application but the aim here is to demonstrate ease of construction and low cost.

1) Start the download of the free programming software from RevolutionEducation. Click on the Software tab. Scroll down the page a bit. You will need to register a user name. The file is 38Mb so it is worth starting this now while you get on with some soldering.

2) Time 00:05 Gather all the parts.

Parts list:
C1 33uF, C2 0.1uF, G1 AB9V 9V battery, IC1 78L05, LED1 LED5MM, R1 22k, R2 10k, R3 1k, R4 10k, R5 LDR approx 5k indoors, U1 PICAXE-08M, D25 female plug (or 9 pin depending on your PC), Small piece of proto board, Computer with serial port – any speed from 300Mhz plus (older computers are more likely to have a 25 pin connector), Optional – 25 pin male to female cable 1 meter to bring connection to front of PC (or 9 pin equivalent), Optional – USB to serial adapter if computer does not have a serial port, 8 pin socket, wire, solder.

The clever part is the Picaxe 08M – cost $3US and is available from PHAnderson (US), RevEd (UK) and Microzed (Australia). OK, you might have to wait 3 days for this to arrive – so technically this how-to is 3 days plus one hour.

3) The Schematic

DemoSchematic

(Drawn with Eagle – a free schematic and PCB design program)

4) Time 00:10 Solder in the components

Picaxe4

The 25 pin plug has had all but pins 1-7 cut off. Only pin 2, 3 and 7 are needed on the 25 pin plug (or pin 2,3 and 5 on a 9 pin plug).

Serial port connections -

25 pin Pin 2 = PC to board. Pin 3 = board back to PC. Pin 7 = ground.

9 pin Pin 3 = PC to board. Pin 2 = board back to PC. Pin 5 = ground.

Note that pin 2 and 3 are swapped on the 9 pin and 25 pin plugs.

5) Component side view

Picaxe5

6) Time 00:15 Bridge some of the pads together.

Picaxe6

Follow the schematic. If components follow the schematic it is usually possible to make more than half the connections with solder bridges.

7) T 00:30 Connect remaining wires with wire-wrap wire. This view shows the component side with a special wire wrap stripping tool. Using a wire-cutter can result in nicks to the wire and breaks later on. Of course thicker wire can be used – anything will work really.

Picaxe7

8) T 00:31 Make wire connections

Picaxe8

9) T 00:40 Connect to PC. This photo shows connection to a 25 pin to 25 pin male to female cable. This is not really needed as the board plugs straight into the back of a PC, but in my case the back of the PC is hard to get to and I had one of these cables free.

Picaxe9

10) T00:50 Start the programming editor. Select the 08M chip when it starts. Type in the code below:

DemoProgram

11) T 00:55 Click on the blue triangle at the top of the screen under ‘Help’ to download the program. Sometimes, just sometimes, this will fail and one reason is if the previous program is still running in the chip and it has long delay subroutines. To fix this, click the download triangle, then briefly disconnect and reconnect the 9V battery which will reset the chip.

12) T 00:60 Disconnect the circuit from the computer. It will now run on its own and the led will come on whenever it is dark.

Picaxe10

13) Have a read through the first two documents in the Help menu of the program (you might need to install Acrobat) The first describes the different Picaxe devices, and the second document has all the instruction codes. These little chips can do a lot more than turn on a led. There are other solutions to using a 25 or 9 pin plug – RevolutionEducation use a 3 pin stereo plug. Personally, I program my chips in a breadboard and transfer then to the working circuit. The circuit above can also double as a programming circuit and the chips can be transferred to other circuits once they are programmed.

Posted in Development Tools, Microcontroller, Projects.

6 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. ScreaminScott said

    Cool project! Which parts can you leave out if you just want to use this as programming circuit?

  2. You can certainly leave out the LDR and resistor. You can also leave out the led and its resistor. For programming you don’t need a regulated 5V supply, so it could be run off 3 AA batteries to give an unregulated 4.5V supply. Then the 78L05 isn’t needed. And if it is only being used to program then the 33uF and 0.1uF can probably go as well.

  3. Eirik Sangolt said

    Where can i buy a D25 female plug?

  4. dfowler said

    Eirik,

    Try DigiKey or maybe a RadioShack or computer supply store in your area.

  5. Most modern PCs use D9 plugs rather than D25. Perhaps check the back of the PC first – they changed over about 1998. The D25 plug on the back of a modern PC is the parallel port.

  6. jk said

    I think for many people who are starting with embedded stuff is more than price interesting ease of use. How would look like a MCU with http://www.microvga.com/ or something similar ?