The PICAXE Birthday Box Project



If you enjoy building PICAXE systems and want to spread the word about these amazing devices, then why not introduce your friends to the world of PICAXE development by way of a Birthday or Christmas present ?



The PICAXE Birthday Box is a small hand-held unit that can be used as a standalone PICAXE demonstrator to encourage PICAXE development by those who are unfamiliar with the PICAXE device or embedded programming in general.

The PICAXE Birthday Box has been provided to a number of friends as birthday presents, which is why it is so named.

Despite its 'quaint naming', the PICAXE Birthday Box is a practical means of introducing people to the PICAXE and it also makes for a valuable development platform in general. It has been designed to allow new PICAXE users to get a feel for a number of real world interfacing problems and provides a good platform for the introduction of a variety of programming techniques.

The actual document describing the internals of the PICAXE Birthday Box and explaining how it works is provided as a separate page so that it can be printed out for those to whom the PICAXE Birthday Box is to be presented without all the hypertext index links that are associated with this site. To access that page, click on the link below ...

  The PICAXE Birthday Box

Complete circuit diagrams are also included at the end of this document.


Overview

The unit supports the PICAXE-08, PICAXE-08M and any future 8-pin, pinout compatible, PICAXE's developed by Revolution Education. It can also be used with a whole range of Microchip PICmicro devices.

The unit can be entirely self-contained using an internal battery, powered from a PC's serial port or an external supply, and is fitted with a power switch. Programming is performed using a 9-Way Female D socket allowing connection to a PC with a commonly available 9-way cable.

Interfaces include tri-colour LED and Piezo Sounder, both under program control, a momentary push button for digital input signalling and a temperature sensing thermistor for analogue input reading. The programming socket allows serial data to be sent to the PC under program control and can, with the aid of a simple interface, be used as a bi-directional serial peripheral.

Although the capabilities of the unit appear limited, the most fundamental interfaces are provided; digital input and output, analogue input and serial data output. A single button, a tri-colour LED and a Piezo Sounder may not appear to be a lot but they are often all that are needed for someone who has no knowledge of electronics or programming before.

The design of the unit was specifically for this target audience and the choice of interfaces was made to allow them to get to grips with how things work, before moving onto more advanced projects.

By setting advanced control projects, even with such a limited set of interfaces, it is possible to introduce advanced topics such as Pulse Width Moulation (PWM) by way of LED dimming, timing and even data logging. For an expert, flashing a LED on and off is no big thing, but for a beginner it is a massive achievment. The interfaces have been chosen, not just to be used, but to allow the newcomer to have fun; I'm sure everyone remembers the first time they got a PICAXE to play a tune.

As someone who enjoys tinkering with PICAXE software, trying various tricks and algorithms, the unit I have of my own has proven invaluable. With its well defined and well documented architecture, I am no longer having to waste time knocking-up yet another breadboard circuit ( which then has to be carefully checked ), to try something out; it's just a case of pick-up the unit, plug it in and go. Additionally it's a lot more robust than a breadboard when it gets accidentally knocked off the desk and onto the floor.


Cost

Each PICAXE Birthday Box could cost around 20 GBP, and almost three quarters of that is in purchasing the case, switches, cable and providing a battery and software on CD-ROM. I continue to be surprised at just how much a single capacitor costs and the price for piezo sounders, and Maplin's cost for a single 0.1" Molex link is simply unbelievable.

Prices can be reduced by shopping around, and the prices given are for illustration only. Although some parts are a necessity, alternatives can be found from a variety of manufacturers and other sources. I already had 9-Way Female D sockets bought from eBay and a suitable serial cable was obtained for just 0.20 GBP from a car boot sale. Molex links came from an old PC ISA card, where they weren't used anyway.

There is of course postage and packing to be added on as well if you are buying over the internet or by mail order.

The cost of the units I built, using the components described, but making the recipient download the software for themselves, came to about 12 GBP each.

An approximate breakdown of estimated cost ( in GBP, including VAT ) is shown below ...

Maplin Electronics Parts

Case                    2.99         ZB17T - HH1 Case
Red Button              1.49         N98AQ - Latching SPST button
Green Button            1.49         N02AR - Momentary SPST button
Tilt Switch             1.30         DP50E - Non-Mercury
Tri-Colour Led          0.70         YH75S - 5mm
9-Way Female D          0.80         RK61R - Solder bucket
M3 x 12mm Bolts x 2     0.04         US11M
M3 Nuts x 2             0.04         LL17T
2-Pin 0.1" Molex Pins   0.04         JW59P - 36-Pin
3-Pin 0.1" Molex Pins   0.06         JW59P - 36-Pin
0.1" Molex Links x 2    0.40         UL70M

Revolution Education Limited Parts

PICAXE-08               1.35         AXE007
Battery Clip            0.09         BAT016
Piezo Sounder           0.61         SPE002
8-Pin DIL Socket        0.04         ICH008
78L05 Regulator         0.18         REG001
1N4148 diodes x 5       0.05         RES040
1K8 Resistor x 3        0.03         RES1K8
10K Resistors x 2       0.02         RES10K
12K Resistor            0.01         RES12K
22K Resistor            0.01         RES10K
NTC Thermistor          0.19         SEN005
100uF 16V Capacitor     0.06         CAP006
100nF Capacitor         0.09         CAP001
9V PP3 Battery          1.32         BAT003
Serial Cable            3.53         CAB010
Programming CD-ROM      3.53         BAS805

                       =====
Total                  20.47         E&OE

In addition, you will need a small piece of veroboard ( stripboard ) upon which to assemble the circuit, wires and wire links.

It is not absolutely necessary to use the exact same parts as I have, and considerable cost could be saved by using a cheaper case and lower cost switches, and by not including the battery. As the finished units were to be birthday presents, cost was considered to be secondary to build quality and something which gave a more professional presentation.

Consider also that if you do encourage someone to use the PICAXE then they may one day end up here and work out how much a PICAXE Birthday Box would cost to make, and you don't want to look like a cheapskate when they do !


Construction

I built the entire electronics on a small piece of veroboard ( stripboard ), and the space inside the chosen case is quite limited as it includes a 9V PP3 battery compartment and the two switches need a fair bit of space as well.

A veroboard layout and track cutting diagram is included later in this document.

The most difficult job in the project I felt was cutting the holes, for the switches and LED, and in particular for mounting the 9-Way Female D connector needed for programming. To make the unit look as good as possible, I mounted the connector on the inside of the case, which required an awful lot of careful filing to get the hole to the right size and a few tweaks to get the case lid to fit on afterwards. I also found it to be incredibly hard to get the LED mounted exactly halfway between the two buttons, but that could just be my own inelegance and lack of patience when it comes to construction. It is recommended to drill and fit the two switches before determining the precise positioning for the led. It is fair to say that in general it's better to take time over the positioning, marking, cutting and drilling than to rush the job.

The old carpenter's adage, "Measure twice, cut once", applies to most construction projects and this is no exception. The case is one of the most expensive parts of the project and it is a shame to destroy it through a lack of care or attention.

The best way to position components and mark their location is to place strips of masking tape over the area to be used, and use a pencil, biro or felt tip pen to mark component placements and drilling points.

The large holes for the switches were created by drilling small pilot holes to give a good centre point used to locate the drill bit used to cut the holes to the right size. Drilling plastic with a big bit is a challenge, and the most important things to remember are to drill slowly, be accurate and have the case mounted securely while drilling. I used a portable 'work bench' with a piece of wood pushed inside the case to stop it flexing and breaking as the bench jaws were tightened, but a vice would be equally suitable. It's a good idea to use some cloth or other protection to stop the face of the case being damaged by the jaws.

Big drill bits want to dig and rip into plastic, and it is best to apply just slight pressure so the drill bit slowly shaves away the plastic. You may not have a large enough drill bit to hand or feel uncomfortable using such are large bit on plastic; in which case drill a small you are comfortable with and enlarge the hole using any square or rectangular object that has a sharp edge to it, and turn that around in the hole. If you take care you will find that the hole is slowly shaved wider, but be careful not to allow the hole to extend in any one direction as this will destroy the aesthetics of the unit when the switches are fitted.

The hole for the LED was created in the same way; a pilot hole first, then drilled out to a size slightly smaller than the LED. A round file was then used to increase the hole until the LED was a tight push-fit. To help keep it in place a blob of hot glue was applied to its rear.

The cut-out for the 9-way Female D is the most complex. I used masking tape to work out where the positioning needed to be and used an old PC ISA Card backplate with a 9-way socket cut-out as a template for the peculiar shape needed. Having then got a rough outline, I used a small drill bit to perforate just inside the outline, some wire cutters to cut between the perforations and detach the centre. It was then a laborious task of filing the hole square so the connector was a tight fit, drilling the holes for mounting it, and then back to filing to make the hole slightly large so the cable plug would go through the casing and mate securely with the socket.

And just when you think you've finished filing, you'll probably find you need to file down some of the case's internal struts so the connector securing nuts can be tightened up against the case properly. You may also find that you need to reduce the length of the bolts used to secure the 9-way socket by sawing a bit off, but this will depend on exactly where your switches end up.

In many ways, preparing the case was a painful, frustrating and laborious job, but it gets easier the more you build. That's probably little comfort though as you read this thinking about building your first. You are however, if you take my advice, going to building at least two PICAXE Birthday Boxes; one for yourself and one to give away, so while the one you end up with may not be perfect, you will be better prepared to build the second.

The effort put in is well rewarded when you have the finished article in front of you, and your intended recipient doesn't ask what the badly made pile of c--p is that you've just handed over.

The veroboard circuit is mounted in the case by securing it to the back of the box with a blob of hot glue having connected flying leads to the switches, LED's and Piezo. Gluing it in place is probably the last thing you should do, as getting it out again, while not impossible, would be very annoying. The Piezo is likewise glued to the front of the case; ensure that the rear of the unit is glued.

Make sure that the link to enable powering through the serial port is removed, and that the link for connecting the Thermistor is in the right location.

The final touch is to place a small bit of foam into the base of the battery compartment to stop the battery rattling about when fitted.

And that's it, bar programming the PICAXE, putting the complete unit in a 'jiffy bag', and wrapping it up in your favourite birthday or Christmas paper.


Software

Although you can hand out as many PICAXE Birthday Boxes as you want, you aren't quite so free to do that with the software needed to program them.

You can pre-program your gift with some apt program, a "Happy Birthday" tune or a morse code message on the LED if you are so inclined, but you can't give a copy of your PICAXE programming software with your gift.

The PICAXE Development Software ( BAS805.EXE ), commonly known under the umbrella designation of the PICAXE Programming Editor, is licensed software and its use is restricted to those who are entitled to use it, and generally the individual who obtained it. Passing copies of that software on is not permitted by the licence agreement. You can transfer the entire software to one lucky recipient but you have to delete your own copy of it, and that is unlikely to be a feature of your planned intentions.

The only way you can provide a recipient with legitimate PICAXE Development Software is to provide it on a CD purchased from your PICAXE supplier, or to get them to register with Revolution Education Limited and download it for themselves.

Yes, I'm well aware of the argument that it's almost impossible to track boot-legged software and prevent it from being passed on, and mere words or legally binding licence agreements aren't going to stop someone who chooses to do as they please, but look at it this way; what would you think of someone who gave you stolen goods as a birthday present ?


Tutorials

It's no good giving someone who has no knowledge of electronics or programming a nice looking box, a wadge of papers telling them what it is, then walking away to leave them to it. At best it will sit proudly on a mantlepiece gathering dust until it ultimately finds its way into a junk box.

Many recipients of the PICAXE Birthday Box will need to be encouraged to try things out on it, enticed to do things with it, and helped along the way.

The best way to get people to do something with the PICAXE Birthday Box is to provide them with a tutorial which they can follow, introducing various concepts along the way, explaining how things work, and why, and inviting them to try things out for themselves. It's the old, "look; this is how it works - now you have a go" training method.

The first thing a PICAXE Birthday Box recipient will say after, "What is it ?", is most likely to be, "So what can I do with it ?", and that's not an easy one to answer unless you're prepared. So to provide a, "This !", answer, I've also created a PICAXE Birthday Box Tutorial.

As with the document for the recipient which describes what the PICAXE Birthday Box is and how it works, I have also provded this as a separate page without hypert text links that can be printed out and handed to your recipient. To access that page, click on the link below ...

  The PICAXE Birthday Box Tutorial

The tutorial is designed to engender interest in the PICAXE and its use, and is oriented to making someone who is unfamiliar with a PICAXE feel like they have achieved something, to think, "That's amazing", and, "I'm great". As we all know, going nowhere fast is the easiest way to quell someone's enthusiam.

The tutorial therefore introduces 'fun projects' first, such as playing a tune on the Piezo, and then leading on to flashing the LED. The tutorial is a step-by-step approach, introducing more complex ideas along the way, but designed to get people into using the PICAXE, and achieveing results, from the start. If they can whizz through the first few tasks, they will be far more inclined to stick with it as the going gets tougher, and their confidence will grow rather than be shattered.

Having a defined tutorial also means that it's possible to monitor your friend's progress through it, see where they are having problems, and step in to lend a welcome hand when need be. By setting 'goals' to complete various tutorials you can also coerce them into keeping going, and getting back on track.

The tutorial is a work in progress, a growing and evolving document, and will be updated to reflect feedback from the people I've given PICAXE Birthday Boxes to. It is unlikely to ever be perfect, and I'm not a teacher or an educator by profession, but as it's being used on real people who are being introduced to electronics and pogramming for the first time, it should hopefully have some worth at the end of the day.


Circuit Diagrams

Power Supply

                                                  | /|
                              .-------------------|< |--------------------------< RTS
                              |                   | \|
                              |                                      From Serial Port
                              |                   | /|
                              }-------------------|< |--------------------------< DTR
                              |                   | \|
                             .|.
                             |O| Molex
                             |O| Link
                             `|'                     78L05
                     |\ |     |      /             .-------.
         .----o )----| >|-----^----o/  o----.------| I   O |------.--------.----> +5V
         |           |/ |                   |      |   G   |      |       .|.
         |                                  |      `---.---'      |       | | 1K8
 9V   ___|___ +                     100uF __|__ +      |        __|__     |_|
PP3    --.--                         16V  =====        |        --.--      |
         |                                  |          |    100nF |       _|_ Power
         |                                  |          |          |      _\ /_ LED
         |                                  |          |          |        |
         `----( o---------------------------^----------^----------^--------^----> 0V

Electronics

                                                              ___          | /|
            .------------------------------------------------|___|---.-----|< |------< RX
            |                                                 22K    |     | \|
+5V ---.----|---.----------------------------------------.           |
       |    |   |                                       .|.          |
      .|.   |   |    PICAXE-08M                         | | 12K      |
  10K | |   |   |   .----..----.                        |_|          |
      |_|   |   `---| +V    0V |-------.                 |           |
       |    `-------| SI    O0 |---.---|-----------------|-----------|---------------> TX
       |        .---| D4    D1 |---|---|--------.  .-.   |           |
       }--------|---| I3    D2 |---|---|----.   |  |o|---{           |
       |        |   `----------'   |   |    |   `--|o|   |           |
       |        `----.       .-----'   |    |      |o|---|-----------|-----------.
       |             |       |         |    |      `-'   |           |           |
       |             |       |         |    |            |           |   |\ |    |
       |             }-------|---------|----|------------|-----------|---| >|----^---> RI
       |             |       |         |    |            |           |   |/ |
       O |_         .|.     .|.        |    |            |           |
         |_|    1K8 | |     | | 1K8    |    |            |           `-----------.
       O |          |_|     |_|        |   .|.|          }-----------.           |
       |             |       |         |   | || Piezo    |           |          .|.
       |            _|_     _|_        |   | ||         .|./         |          | | 10K
       |         G _\./_   _\./_ R     |   `|'|         | |  NTC     o / Tilt   |_|
       |             |       |         |    |          /|_| Therm    o/  Switch  |
       |             `---.---'         |    |         |  |  istor    |           |
       |                 |             |    |            |           |           |
0V ----^-----------------^-------------^----^------------^-----------^-----------^---> 0V

Serial Interface

                              To Power  RTS <-----------.
                               Supply   DTR <-------.   |
                                                    |   |   .---.
                                        RX  <---.   |   |   |    \
                                                |   }---|---|-O   \   1      DCD to PC
                                                |   }---|---|---O |      6   DSR to PC
                                        TX  >---|---|---|---|-O   |   2      TX  to PC
                                                |   |   }---|---O |      7   RTS from PC
                                                `---|---|---|-O   |   3      RX  from PC
                                                    |   `---|---O |      8   CTS to PC
                                                    `-------|-O   |   4      DTR from PC
                                        RI  >---------------|---O |      9   RI  to PC
                                                   .--------|-O   /   5      GND
                                                   |        |    /
                                                   |        `---'
                                        0V  >------'    9-Way Female D

Bi-Directional Communications Interface

                      ___        | /|
                 .---|___|---.---|< |-----o\             Comms On
                 |    22K    |   | \|      :\o-------.
                 |          .|.       .---o:         |   Program Download
                 |          | | 10K   |    :         |
                 |          |_|       |    :         |
                 |           |        |    :         |
                 `-----------|--------|----:-----.   |
                             |        |    :     |   |
                             |        |    :/o---'   |
                 .-----------|--------|---o/         |
       .---.     |           |        |      o---.   |   .---.
       |    \    |           |        |          |   |   |    \
1      | O---\---|-----------|--------|----------|---|---|-O   \   1      DCD to PC
   6   |   O-|---|-----------|--------|----------|---|---|---O |      6   DSR to PC
2      | O---|---|-----------|--------|----------|---|---|-O   |   2      TX  to PC
   7   |   O-|---|-----------|--------|----------|---|---|---O |      7   RTS from PC
3      | O---|---|-----------|--------'          |   `---|-O   |   3      RX  from PC
   8   |   O-|---|-----------|-------------------|-------|---O |      8   CTS to PC
4      | O---|---|-----------|-------------------|-------|-O   |   4      DTR from PC
   9   |   O-|---'           |                   `-------|---O |      9   RI  to PC
5      | O---/---------------^---------------------------|-O   /   5      GND
       |    /                                            |    /
       `---'                                             `---'
    9-Way Male D                                     9-Way Female D

External Power Supply Interface

                 .----------------------------------< AC/DC   External
                 |   .------------------------------< 0V     Power Input
                 |   |
       .---.     |   |                      .---.
       |    \    |   |                      |    \
1      | O   \   |   |              .-------|-O   \   1      DCD to PC
   6   |   O |   |   |              }-------|---O |      6   DSR to PC
2      | O---|---|---|--------------|-------|-O   |   2      TX  to PC
   7   |   O-|---{   |              |   .---|---O |      7   RTS from PC
3      | O---|---|---|--------------|---|---|-O   |   3      RX  from PC
   8   |   O |   |   |              |   `---|---O |      8   CTS to PC
4      | O---|---'   |              `-------|-O   |   4      DTR from PC
   9   |   O-|-------|----------------------|---O |      9   RI  to PC
5      | O---/-------^----------------------|-O   /   5      GND
       |    /                               |    /
       `---'                                `---'
    9 Way Male D                        9 Way Female D


Veroboard Layout and Track Cutting Diagram

The Veroboard ( Stripboard ) layout I used is shown below. It may not be the best layout possible, but comes quite close. The board is quite densely packed and was entirely laid out by hand. There are no 'dubious connections' and it is quite straight forward to assemble, requiring a minimum number of track cuts.

The veroboard has its tracks running horizontally, has 21 tracks, and 15 columns; 2.1" x 1.5".


PICAXE is a trademark of Revolution Education Ltd. PICmicro is a registered trademark of Microchip Inc. The PICAXE Birthday Box is not a product of Revolution Education Limited and is not approved, recommended nor supported by them.





Associated Articles

  The PICAXE Processors
  PICAXE News
  PICAXE Questions & Answers
  PICAXE Comparisons
  PICAXE Pinouts
  PICAXE Serial Interfacing
  PICAXE Infra-Red Interfacing
  PICAXE Wireless Interfacing
  PICAXE LCD Interfacing
  PICAXE LCD Interfacing
  A Real-Time Clock for the PICAXE-18X
  PICAXE Optimisations
  PICAXE Telephone Exchange Simulator
  The Brainf**ked PICAXE
  The PICAXE Extended Programming Interpreter
  Build Your Own Basic Stamp
  Tech Toys
  The PICAXE Birthday Box

  PICAXE Birthday Box Tutorial



Sites to Visit

  PICAXE Home Page
  Revolution Education Ltd

  Tech-Supplies Ltd



Site Navigation

  Home Page
  What's New
  Search
  Add Bookmark
  Have Your Say
  Guestbook




First published on Thursday the 1st of July, 2004 at 04:25:00
Last upload was on Monday the 23rd of August, 2004 at 00:37:27