Using The AXE033 Serial/I2C LCD Display With A PICAXE Microcontroller

The AXE033 is a 2×16 LCD alphanumeric display which can be interfaced to a PICAXE microcontroller either via a serial connection or via an I2C bus in the case of  PICAXE-X parts. As usual, the AXE033 can be purchased from techsupplies in the U.K. who are very reliable. The AX033 unit comes in two flavors: one without a backlight for around €14 and one with a backlight for around €17. Both of these variants can be extended with the optional clock upgrade which enables the unit to set and maintain the current date and time as well as being able to set and maintain alarms for around €3.50. The AX033 is provided in kit form, as shown in the image below, which is very easy to put together – only basic soldering skills are necessary.

 

The AXE033 (with backlight) Kit Before Assembly

 

The great thing about the AX033 is that it is extremely easy to interface to the PICAXE and very straight forward to use. To interface the AXE033 to a PICAXE using the serial interface, simply connect the in pin on the AX033 module to an output pin on the PICAXE. For example, connect output7 of a PICAXE20M to the AXE033 unit, provide both devices with suitable power, e.g. 4.5 volts from 3 AA cells, and you are in business. Programming the AXE033 is straight forward. As an example, the following line clears the screen and then displays “Luke Southall” on line 1 and “Alarm System B22” on line2.

serout 7, N2400, (254,1,”Luke Southall”,254,192,”Alarm System B22″)

A more detailed description of how to program the AXE033 can be found here. A further feature of the AXE033 is that you can store up to 7 pre-defined message into the unit. These messages are held persistently in non-volatile memory on the AXE033 unit. Below is an example piece of code which programs 5 messages into a AXE033 unit using a PICAXE microcontroller.

pause 500
serout 7, N2400, (253, 1, “Luke Southall   “)
pause 1000
serout 7, N2400, (253, 2, “Alarm System B22  “)
pause 1000
serout 7, N2400, (253, 3, “Enter Code      “)
pause 1000
serout 7, N2400, (253, 4, “Alarm Activated “)
pause 1000
serout 7, N2400, (253, 5, “Alarm At TLZ1   “)
pause 1000
serout 7, N2400, (254,1)
serout 7, N2400, (“Program Complete”)
end

Once the AXE033 has been programmed with pre-defined messages, you can use them by referring to the stored message number instead of providing a string. For example, the following line of code clears the screen and then displays “Luke Southall” on line 1 and “Alarm System B22” on line2. This is code is equivalent to the first example shown in this post.

serout 7, N2400, (254,1,1,254,192,2)

Using the AXE033 to store pre-defined messages can help to conserve memory on PICAXE microcontrollers which have a limited amount of space for programs, e.g. the PIXAXE08M or the PICAXE18M. After using the AXE033 for about 8 months, I can strongly recommend it to anyone interested in outputting data from a PICAXE microcontroller.

Interfacing The PICAXE To A 4×3 Matrix Keypad Revisited

In a previous post, I described how to interface a 4×3 keypad that I purchased from those reliable folks at Tech Supplies in the U.K. During the course of developing our alarm system we happened to purchase a second 4×3 keypad from Conrad Electronics in Germany. What we discovered is that although these keypads look similar, they have very different pin-outs. The first keypad from Tech Supplies has the pin-outs (reading left to right and looking at the keys): (1) Not Connected (2) Column 2 (3) Row 1 (4) Column 1 (5) Row 4 (6) Column 3 (7) Row 3 (8) Row 2 (9) Not Connected. The keypad from Conrad on the other hand has the pin-outs (reading left to right and looking at the keys): (1) Column 1 (2) Column 2 (3) Column 3 (4) Row 1 (5) Row 2 (6) Row 3 (7) Row 4.

Two Similar Looking But Different 4x3 Keypads

As the pin-outs are different for the two keypads one needs to connect the keypad to, for example, a PICAXE 20M differently. The schematic for the NC-C2-R1-C1-R4-C3-R3-R2-NC 4×3 keypad can be found in my previous post. The schematic for the C1-C2-C3-R1-R2-R3-R4 4×3 keypad can be seen below:

Interfacing a 4x3 Keypad to a PICAXE20M

The TinyCAD file for this schematic can be downloaded from here. The code to scan the keypad using a PICAXE 20M remains the same:

symbol row = b1
symbol key = b2
init:
pause 500
main:
key = 0
for row = 0 to 3
high row
gosub keyscan
low row
if key > 0 then gosub displayKey
next row
goto main
keyscan:
if pin0 = 1 then
key = row * 3 + 1
do loop while pin0 = 1
elseif pin1 = 1 then
key = row * 3 + 2
do loop while pin1 = 1
elseif pin2 = 1 then
key = row * 3 + 3
do loop while pin2 = 1
endif
return
displayKey:
serout 7, N2400, (254,1,#key)
return
end

TinyCAD PICAXE Library

I’ve been looking for a simple tool for drawing schematics for a while and unfortunately nothing really exists for the Apple Mac except Eagle which I find pretty complex to use. The unfortunate truth is that there is a much larger number of tools for the Windows platform and this is one of the reasons why I bought myself a cheap PC; the other reason is that I’m not too worried about it breaking if I plug in a faulty electronics project ;-). On the Windows platform there is a pretty good, free and simple to use tool for drawing schematics called TinyCAD. An overview, or short review, of the tool can be found here at Digital DIY. The screenshot below shows the schematic for one of our previous traffic light, or stop light, projects using a PICAXE microcontroller in tinyCAD.

PICAXE Traffic Light Schematic Using TinyCAD

Unfortunately, tinyCAD does not include a library for PICAXE microcontrollers which I often use in my projects. The good news, however, is that tinyCAD allows you to define your own libraries and symbols – so that is what I have done. The .TCLib library file for PICAXE microcontrollers is available for download here and it contains the symbols for the microcontrollers: PICAXE-08, PICAXE-08M, PICAXE-14M, PICAXE-18, PICAXE-18A, PICAXE-18M, PICAXE-18X, PICAXE 20M, PICAXE-20X2, PICAXE-28A, PICAXE-28X, PICAXE-28X1 and PICAXE-28X2. Please note that the packaging fields are not correct, but please feel free to correct them. To use the tinyCAD PICAXE library, just copy the file into the tinyCAD library directory, e.g. C:\Program Files\TinyCAD\library and then add the library by clicking on the libraries button and then add.

Building a Full Adder Using NPN Transistors

Building upon the last two posts where I showed how to build NAND, NOR, AND, OR, NOT and XOR gates using NPN transistors, this post will show how these gates can be used to build a full adder. A full adder is one of the circuits used in an Arithmetic and Logic Unit (ALU) which a central component in a microprocessor. The screenshot below shows the full adder circuit using combinational logic running in Circuit Simulator.

Full Adder Circuit Using Combinational Logic

The next screen shot shows the same full adder circuit built using NPN transistors.

Full Adder Circuit Using NPN Transistors

As always, the code for the circuit is listed below. Just copy and import the code into the free Java Circuit Simulator to get a feeling for the circuit.

$ 1 5.0E-6 10.20027730826997 50 5.0 50
R 256 272 224 272 0 0 40.0 5.0 0.0 0.0 0.5
R 256 320 224 320 0 0 40.0 5.0 0.0 0.0 0.5
t 384 272 416 272 0 1 -4.781800412142671 0.009973798250449528 100.0
t 384 320 416 320 0 1 -0.11579281063261414 1.24026193119846E-9 100.0
w 416 288 416 304 0
r 336 272 384 272 0 10000.0
r 336 320 384 320 0 10000.0
s 256 272 304 272 0 1 false
s 256 320 304 320 0 1 false
r 416 208 416 256 0 100.0
R 416 208 384 208 0 0 40.0 5.0 0.0 0.0 0.5
g 416 336 416 352 0
g 304 368 304 384 0
r 304 320 304 368 0 10000.0
w 416 256 448 256 0
w 592 144 624 144 0
r 512 208 512 256 0 10000.0
g 512 256 512 272 0
g 592 224 592 240 0
R 592 96 560 96 0 0 40.0 5.0 0.0 0.0 0.5
r 592 96 592 144 0 100.0
r 512 208 560 208 0 10000.0
r 512 160 560 160 0 10000.0
w 592 176 592 192 0
t 560 208 592 208 0 1 0.5715875138926915 0.5718362726080916 100.0
t 560 160 592 160 0 1 -4.833247082563076 0.12551784992248802 100.0
t 560 384 592 384 0 1 -9.524538884475575E-4 0.01709394689525201 100.0
t 560 432 592 432 0 1 -4.890473074134587 1.245130965746674E-9 100.0
w 592 400 592 416 0
r 512 384 560 384 0 10000.0
r 512 432 560 432 0 10000.0
r 592 320 592 368 0 100.0
R 592 320 560 320 0 0 40.0 5.0 0.0 0.0 0.5
g 592 448 592 464 0
g 512 480 512 496 0
r 512 432 512 480 0 10000.0
w 592 368 624 368 0
w 448 256 464 256 0
w 464 256 464 208 0
w 464 208 512 208 0
w 464 256 464 384 0
w 464 384 512 384 0
t 720 272 752 272 0 1 -0.03456302003774714 0.668725982587211 100.0
t 720 320 752 320 0 1 0.4773295909383011 0.6689865696776216 100.0
w 752 288 752 304 0
r 672 272 720 272 0 10000.0
r 672 320 720 320 0 10000.0
r 752 208 752 256 0 100.0
R 752 208 720 208 0 0 40.0 5.0 0.0 0.0 0.5
g 752 336 752 352 0
g 672 368 672 384 0
r 672 320 672 368 0 10000.0
w 624 144 624 272 0
w 624 272 672 272 0
w 624 368 624 320 0
w 624 320 672 320 0
w 752 256 800 256 0
w 336 160 336 272 0
w 336 160 512 160 0
w 304 320 336 320 0
w 304 272 336 272 0
r 592 640 592 592 0 330.0
R 592 592 544 592 0 0 40.0 5.0 0.0 0.0 0.5
r 544 656 480 656 0 10000.0
r 544 704 480 704 0 10000.0
g 592 720 592 752 0
w 592 672 592 688 0
t 544 704 592 704 0 1 0.5109696961963799 0.5112184544839934 100.0
t 544 656 592 656 0 1 -0.6684621582153638 -2.4875703761353116E-4 100.0
t 592 640 624 640 0 1 0.6565549542877389 0.6684621594653638 100.0
r 592 592 640 592 0 330.0
w 640 592 640 624 0
w 624 624 640 624 0
w 624 656 624 720 0
w 624 720 592 720 0
w 1136 880 1168 880 0
w 1168 960 1120 960 0
w 1168 912 1168 960 0
w 1136 880 1136 928 0
w 1120 880 1136 880 0
w 1120 912 1168 912 0
w 1120 928 1136 928 0
t 1072 896 1120 896 0 1 -0.6565549537934822 0.011907205671584395 100.0
t 1072 944 1120 944 0 1 -0.6565549537934475 0.011907205671619018 100.0
g 1120 960 1120 992 0
r 1072 944 1008 944 0 10000.0
r 1072 896 1008 896 0 10000.0
R 1120 832 1072 832 0 0 40.0 5.0 0.0 0.0 0.5
r 1120 880 1120 832 0 330.0
w 1200 960 1168 960 0
w 1200 896 1200 960 0
w 1200 864 1216 864 0
w 1216 832 1216 864 0
r 1168 832 1216 832 0 330.0
t 1168 880 1200 880 0 1 0.6565549542873161 0.6684621594650666 100.0
w 1120 832 1168 832 0
w 768 560 800 560 0
w 304 432 336 432 0
w 976 720 800 720 0
w 800 608 800 720 0
w 800 448 976 448 0
w 800 448 800 560 0
w 1264 624 1216 624 0
w 1216 544 1264 544 0
162 1264 544 1264 624 1 2.1024259 1.0 0.0 0.0
w 1088 608 1136 608 0
w 1088 656 1088 608 0
w 1088 560 1136 560 0
w 1088 432 1088 560 0
r 1136 608 1136 656 0 10000.0
g 1136 656 1136 672 0
g 1216 624 1216 640 0
R 1216 496 1184 496 0 0 40.0 5.0 0.0 0.0 0.5
r 1216 496 1216 544 0 100.0
r 1136 608 1184 608 0 10000.0
r 1136 560 1184 560 0 10000.0
w 1216 576 1216 592 0
t 1184 608 1216 608 0 1 0.5070029211180633 0.6676112421332964 100.0
t 1184 560 1216 560 0 1 -0.2973174114364001 0.6673215045207006 100.0
w 928 672 976 672 0
w 928 544 928 672 0
w 928 496 976 496 0
w 928 544 928 496 0
w 912 544 928 544 0
w 1056 656 1088 656 0
r 976 720 976 768 0 10000.0
g 976 768 976 784 0
g 1056 736 1056 752 0
R 1056 608 1024 608 0 0 40.0 5.0 0.0 0.0 0.5
r 1056 608 1056 656 0 100.0
r 976 720 1024 720 0 10000.0
r 976 672 1024 672 0 10000.0
w 1056 688 1056 704 0
t 1024 720 1056 720 0 1 -4.890726766016432 1.2499999990092906E-9 100.0
t 1024 672 1056 672 0 1 -5.989404006161436E-4 0.01718028489306178 100.0
t 1024 448 1056 448 0 1 -4.066306801666734 0.599647965375327 100.0
t 1024 496 1056 496 0 1 0.5698226171593009 0.606519321552093 100.0
w 1056 464 1056 480 0
r 976 448 1024 448 0 10000.0
r 976 496 1024 496 0 10000.0
r 1056 384 1056 432 0 100.0
R 1056 384 1024 384 0 0 40.0 5.0 0.0 0.0 0.5
g 1056 512 1056 528 0
g 976 544 976 560 0
r 976 496 976 544 0 10000.0
w 1056 432 1088 432 0
w 880 544 912 544 0
r 304 432 304 480 0 10000.0
g 304 480 304 496 0
g 880 624 880 640 0
R 880 496 848 496 0 0 40.0 5.0 0.0 0.0 0.5
r 880 496 880 544 0 100.0
s 256 432 304 432 0 1 false
r 800 608 848 608 0 10000.0
r 800 560 848 560 0 10000.0
w 880 576 880 592 0
t 848 608 880 608 0 1 -0.8848093520815411 1.24999999900929E-9 100.0
t 848 560 880 560 0 1 -4.012961070298115 0.010136628527786407 100.0
R 256 432 224 432 0 0 40.0 5.0 0.0 0.0 0.5
w 800 256 800 416 0
w 800 416 768 416 0
w 768 416 768 560 0
w 336 320 336 384 0
w 336 432 384 432 0
w 624 944 592 944 0
w 624 880 624 944 0
w 624 848 640 848 0
w 640 816 640 848 0
r 592 816 640 816 0 330.0
t 592 864 624 864 0 1 0.6565549542876459 0.6684621594653054 100.0
t 544 880 592 880 0 1 -0.5426955493419798 0.009973798175330992 100.0
t 544 928 592 928 0 1 -0.11579281070773267 1.24026193121309E-9 100.0
w 592 896 592 912 0
g 592 944 592 976 0
r 544 928 480 928 0 10000.0
r 544 880 480 880 0 10000.0
R 592 816 544 816 0 0 40.0 5.0 0.0 0.0 0.5
r 592 864 592 816 0 330.0
w 800 608 736 608 0
w 736 608 736 528 0
w 736 528 384 528 0
w 384 432 384 528 0
w 384 528 384 560 0
w 384 560 480 560 0
w 480 560 480 656 0
w 768 560 512 560 0
w 512 560 512 608 0
w 512 608 448 608 0
w 448 608 448 704 0
w 448 704 480 704 0
w 416 384 416 432 0
w 336 384 416 384 0
w 416 432 512 432 0
w 416 432 416 880 0
w 416 880 416 928 0
w 416 928 480 928 0
w 432 880 432 416 0
w 432 416 320 416 0
w 320 416 320 288 0
w 320 288 336 288 0
w 336 288 336 272 0
w 432 880 480 880 0
162 1264 864 1264 944 1 2.1024259 1.0 0.0 0.0
w 1216 864 1264 864 0
w 1264 944 1264 960 0
w 1264 960 1200 960 0
w 640 624 688 624 0
w 688 624 688 752 0
w 688 752 880 752 0
w 880 752 880 896 0
w 880 896 1008 896 0
w 640 848 816 848 0
w 816 848 816 944 0
w 816 944 1008 944 0
x 179 281 196 287 0 24 A
x 179 328 193 334 0 24 B
x 156 440 195 446 0 24 Cin
x 1301 594 1314 600 0 24 S
x 1299 912 1355 918 0 24 Cout
x 885 199 1274 205 0 24 Full Adder Using NPN Transistors

Building An XOR Gate Using NPN Transistors

Following on from my last post on building logic gates from NPN transistors, I’ve now designed the XOR gate needed to build our Full Adder. As can be seen in the screen shot below, the top circuit shows an XOR gate built using 4 NAND gates and the second circuit shows the same XOR circuit built using 8 NPN transistors.

XOR Gate Built Using NPN Transistors

As Always, copy and paste the following code into the free Java Circuit Simulator to get a feeling for the design.

$ 1 5.0E-6 1.500424758475255 50 5.0 50
151 432 160 544 160 0 2 5.0
151 544 112 656 112 0 2 5.0
151 544 208 656 208 0 2 0.0
w 544 160 544 192 0
w 544 160 544 128 0
151 656 160 768 160 0 2 5.0
w 656 112 656 144 0
w 656 176 656 208 0
w 432 96 432 144 0
w 432 96 544 96 0
w 432 176 432 224 0
w 432 224 544 224 0
M 768 160 816 160 0 2.5
L 432 96 384 96 0 0 false 5.0 0.0
L 432 224 384 224 0 1 false 5.0 0.0
x 302 51 840 57 0 24 XOR Using Combinational Logic (NAND Gates)
x 284 341 866 347 0 24 XOR Using Combinational Logic (NPN Transistors)
R 320 576 288 576 0 0 40.0 5.0 0.0 0.0 0.5
R 320 624 288 624 0 0 40.0 5.0 0.0 0.0 0.5
t 448 576 480 576 0 1 -4.769244679759966 0.09853954879251582 100.0
t 448 624 480 624 0 1 0.5721119236721417 0.572360682090304 100.0
w 480 592 480 608 0
r 400 576 448 576 0 10000.0
r 400 624 448 624 0 10000.0
s 320 576 368 576 0 1 false
s 320 624 368 624 0 0 false
r 480 512 480 560 0 100.0
R 480 512 448 512 0 0 40.0 5.0 0.0 0.0 0.5
g 480 640 480 656 0
g 368 672 368 688 0
r 368 624 368 672 0 10000.0
w 480 560 512 560 0
w 656 448 688 448 0
r 576 512 576 560 0 10000.0
g 576 560 576 576 0
g 656 528 656 544 0
R 656 400 624 400 0 0 40.0 5.0 0.0 0.0 0.5
r 656 400 656 448 0 100.0
r 576 512 624 512 0 10000.0
r 576 464 624 464 0 10000.0
w 656 480 656 496 0
t 624 512 656 512 0 1 0.5713598382462943 0.5716085966689409 100.0
t 624 464 656 464 0 1 -4.875710385258664 0.09853954878803152 100.0
t 624 688 656 688 0 1 -0.11894285435755281 0.6683177341910094 100.0
t 624 736 656 736 0 1 0.5011262498555432 0.6685976279719069 100.0
w 656 704 656 720 0
r 576 688 624 688 0 10000.0
r 576 736 624 736 0 10000.0
r 656 624 656 672 0 100.0
R 656 624 624 624 0 0 40.0 5.0 0.0 0.0 0.5
g 656 752 656 768 0
g 576 784 576 800 0
r 576 736 576 784 0 10000.0
w 656 672 688 672 0
w 512 560 528 560 0
w 528 560 528 512 0
w 528 512 576 512 0
w 528 560 528 688 0
w 528 688 576 688 0
t 784 576 816 576 0 1 0.554942286102126 0.6083225786232598 100.0
t 784 624 816 624 0 1 -1.2089972951264762 0.607048116653794 100.0
w 816 592 816 608 0
r 736 576 784 576 0 10000.0
r 736 624 784 624 0 10000.0
r 816 512 816 560 0 100.0
R 816 512 784 512 0 0 40.0 5.0 0.0 0.0 0.5
g 816 640 816 656 0
g 736 672 736 688 0
r 736 624 736 672 0 10000.0
w 688 448 688 576 0
w 688 576 736 576 0
w 688 672 688 624 0
w 688 624 736 624 0
162 864 560 864 640 1 2.1024259 1.0 0.0 0.0
w 816 560 864 560 0
w 864 640 816 640 0
w 400 464 400 576 0
w 400 464 576 464 0
w 400 624 400 736 0
w 576 736 400 736 0
w 368 624 400 624 0
w 368 576 400 576 0

Building Logic Gates Using Transistors

Moving on from the NOT gate we built using a single transistor and described in a previous post, I decided to show my son how to build more complex logic gates and ultimately much more complex combinational logic circuits using transistors; which is the basis of all modern computers including the one you are using right now to read this blog. The video attached below from Make is a great overview to the transistor, but I would also suggest performing some simple experiments with NPN transistors before moving onto combinational logic.

The circuits below for the gates NAND, NOR, AND, OR and NOT have been designed using NPN transistors and these circuits will be the basis of the Full Adder which we intend to build using them; please note that these circuits may not be the most efficient as I designed them just for fun. In the screen shot you will also see the symbol for each of these gates and if you are unfamiliar with them and their truth tables, I suggest taking a look at the wikipedia article for each.

NAND, NOR, AND, OR and NOT Gates Using NPN Transistors

In order to get a feeling for how they work, I would recommend getting a copy of the excellent and free Java Circuit simulator and importing the following code into the program.

$ 1 5.0E-6 10.20027730826997 50 5.0 50
t 304 176 352 176 0 1 0.5607262480623159 0.6439221594808273 100.0
t 304 224 352 224 0 1 0.5610808902467164 0.6446279101012331 100.0
w 352 192 352 208 0
g 352 240 352 272 0
r 304 224 240 224 0 10000.0
r 304 176 240 176 0 10000.0
R 176 176 128 176 0 0 40.0 5.0 0.0 0.0 0.5
s 176 176 240 176 0 0 false
s 176 224 240 224 0 0 false
w 176 224 176 176 0
w 176 176 176 128 0
w 176 112 352 112 0
162 352 160 400 160 1 2.1024259 1.0 0.0 0.0
w 400 160 400 240 0
r 352 160 352 112 0 330.0
w 176 112 176 128 0
x 242 86 313 92 0 24 NAND
t 560 720 592 720 0 1 -1.7015314369328909 0.0985395491791375 100.0
R 416 720 368 720 0 0 40.0 5.0 0.0 0.0 0.5
s 416 720 480 720 0 1 false
r 480 720 544 720 0 10000.0
w 544 720 560 720 0
r 592 704 592 656 0 330.0
w 592 656 416 656 0
162 592 704 640 704 1 2.1024259 1.0 0.0 0.0
g 592 736 592 768 0
x 489 626 541 632 0 24 NOT
w 416 656 416 720 0
w 640 704 640 736 0
w 176 416 176 432 0
r 352 464 352 416 0 330.0
w 176 416 352 416 0
w 176 480 176 432 0
w 176 528 176 480 0
s 176 528 240 528 0 0 false
s 176 480 240 480 0 0 false
R 176 480 128 480 0 0 40.0 5.0 0.0 0.0 0.5
r 304 480 240 480 0 10000.0
r 304 528 240 528 0 10000.0
g 352 544 352 576 0
w 352 496 352 512 0
t 304 528 352 528 0 1 0.5610808902472575 0.6446279101002914 100.0
t 304 480 352 480 0 1 0.5607262480628803 0.6439221594798585 100.0
w 448 448 448 480 0
162 400 448 448 448 1 2.1024259 1.0 0.0 0.0
t 352 464 384 464 0 1 -1.6333280543612416 0.1667429312700123 100.0
w 592 736 640 736 0
w 352 240 400 240 0
w 400 480 448 480 0
r 352 416 400 416 0 330.0
w 400 416 400 448 0
w 384 448 400 448 0
w 384 480 400 480 0
x 255 369 308 375 0 24 AND
w 832 240 880 240 0
x 685 85 737 91 0 24 NOR
w 608 112 608 128 0
r 784 160 784 112 0 330.0
w 880 160 880 240 0
162 832 160 880 160 1 2.1024259 1.0 0.0 0.0
w 608 112 784 112 0
w 608 176 608 128 0
w 608 224 608 176 0
s 608 224 672 224 0 0 false
s 608 176 672 176 0 1 false
R 608 176 560 176 0 0 40.0 5.0 0.0 0.0 0.5
r 736 176 672 176 0 10000.0
r 736 224 672 224 0 10000.0
g 784 240 784 272 0
t 736 224 784 224 0 1 0.561235418839239 0.6443539216856129 100.0
t 736 176 784 176 0 1 -0.01047151862990496 0.07264698421646892 100.0
w 784 208 800 208 0
w 784 192 832 192 0
w 784 160 800 160 0
w 800 160 800 208 0
w 832 192 832 240 0
w 832 240 784 240 0
w 800 160 832 160 0
w 384 480 384 544 0
w 384 544 352 544 0
w 800 464 832 464 0
w 832 544 784 544 0
w 832 496 832 544 0
w 800 464 800 512 0
w 784 464 800 464 0
w 784 496 832 496 0
w 784 512 800 512 0
t 736 480 784 480 0 1 -0.010470026008861447 0.07264847683763566 100.0
t 736 528 784 528 0 1 0.561235418839193 0.6443539216856902 100.0
g 784 544 784 576 0
r 736 528 672 528 0 10000.0
r 736 480 672 480 0 10000.0
R 608 480 560 480 0 0 40.0 5.0 0.0 0.0 0.5
s 608 480 672 480 0 1 false
s 608 528 672 528 0 0 false
w 608 528 608 480 0
w 608 480 608 432 0
w 608 416 784 416 0
r 784 464 784 416 0 330.0
w 608 416 608 432 0
x 696 372 730 378 0 24 OR
w 864 544 832 544 0
w 864 480 864 544 0
w 864 480 880 480 0
w 864 448 880 448 0
w 880 416 880 448 0
r 832 416 880 416 0 330.0
w 880 480 928 480 0
t 832 464 864 464 0 1 -1.7169524832810044 0.0831185028464971 100.0
162 880 448 928 448 1 2.1024259 1.0 0.0 0.0
w 928 448 928 480 0
w 784 416 832 416 0
151 336 64 432 64 0 2 5.0
153 768 64 864 64 0 2 5.0
150 336 352 432 352 0 2 0.0
152 768 352 864 352 0 2 0.0
I 560 608 656 608 0 0.5

First Project Using The PICAXE-08 Proto Board Kit

After building the first prototype of our timer device and then making preparations to use the PICAXE 08M and save space by using a single NPN transistor as a NOT gate, we have finally completed our project using the PICAXE-08 Proto Board Kit. As usual, I purchased the Proto Board and PICAXE chips from those reliable folks at techsupplies in the U.K. For around 5 Euros, the  PICAXE-08 Proto Board Kit with a PICAXE-08M microcontroller is a real bargain. It has almost everything you need to get going – the only extras you will require are a USB cable for programming the PICAXE and a battery box for holding 3 AA batteries to supply the circuit with 4.5v. I found the size of the prototyping area on the board to be ample for simple projects. Please note that the kit comes in component form, shown in the picture below, and has to be assembled using a soldering iron and a little bit of time – it is not complicated.

PICAXE-08 Proto Board kit

Moving the timer to the PICAXE-08M from the PICAXE-20M prototype was relatively straight forward. The new circuit uses pins 0, 1 and 2 to power the “minute/seconds LEDs” while pin 3, which is an input pin only, is used to select the device’s function (eggs or teeth) and pin 4 is used to power the piezo buzzer. On the prototyping area I placed the resistors to drive the LEDs and a voltage regulator to power the circuit from a 9v battery. In our circuit pin 3 is also pulled down to 0v using a 10k resistor. Below is the code for the device.

symbol counter = b0
symbol teeth = b1
symbol eggs = b2
symbol loopCounter = b3
init:
pause 200
loopCounter = 0
if pin3 = 1 then
teeth = 1
eggs = 0
else
eggs = 1
teeth = 0
endif
start:
for counter = 1 to 60
low 0
pause 500
high 0
pause 500
next
for counter = 1 to 60
low 1
pause 500
high 1
pause 500
next
for counter = 1 to 60
low 2
pause 500
high 2
if counter > 55 and teeth = 1 then
high 4
elseif counter > 55 and eggs = 1 and loopCounter = 1 then
high 4
endif
pause 500
low 4
next
if eggs = 1 and loopCounter = 0 then
loopCounter = 1
goto start
endif
end:
high 4
pause 1000
low 4

Luckily, as mentioned previously, we had prepared to save space in the enclosure – which is good because the space available turned out to be even smaller than I thought. The wiring to the LEDs and switches added quite a bit of bulk and as a result the whole circuit plus battery only just squeezes in. The image below helps to illustrate just how much bulk the wiring added to the internals of the device.

Unexpected Added Bulk Through Wiring

After many hours of work, the device is now completed and we used it tonight to time the brushing of our teeth. Tomorrow morning, we’ll use it for the first time to time our soft boiled eggs ;-).

The Completed Eggs-Teeth Timer