Robot Beacon
Page 1


Robot Beacon uses a PIC12C508A OTP (One Time Programmable) 8-pin microcontroller. There is a lot of controversy over the type of microcontroller that should be promoted in a project such as this.
There are at least three manufacturers of microcontrollers suitable for this application and it's a nightmare trying to work out the best type to promote.
The problem is: each type has its own language and its own set of idiosyncrasies. Some chips have good features and others have different features, some chips have lines that are input-only, some have more lines or more memory, etc etc etc.
To gather up all the facts, prepare a set of instructions, present all the information on the operation of the chip, create sample programs and design a project to teach how to write a program, takes months and months of development time.
It boils down to this:
The PIC family have the most amount of information and back-up available on the web in the form of projects and examples. Check it yourself. For the other types, it is almost non-existent.
We have already done a complete exercise for the PIC12C508A and PIC16F84, and to wander off to a different processor requires starting the development process all over again.
The cost of all processors in the low-end range is almost the same and the features are very similar (when you are not using it to its limit), so why not go with the "swim."
It is most frustrating that each processor has its own language, as this is an enormous barrier to incorporating a second or third range of devices into a development course.
We have already provided all the software and hardware for the development of a number of projects using the PIC12C508A and there is little point jumping to another device, just because it is the "flavour of the month."
Only when something startling (such as re-programmable) comes along in an 8-pin device, will we change.
"Nothing is either good nor bad, but thinking makes it so."
Colin Mitchell - Editor.
Robot Beacon is available as a kit or ready built.
There are at least three ways you can build the Robot Beacon:
You can buy a ready-built Robot Beacon.
You can buy a kit with a pre-programmed chip,
You can buy a kit with a blank chip,
You can buy a kit with a blank chip and modify the program using a PIC16F84 and adapter socket.
You will need the Multi Chip Programmer to burn your own chip if you don't get it pre-programmed in a kit.
Files and information:
How to re-burn a '508A.
All Robot Beacon files. This window contain notepad.exe Click on notepad.exe and it will open. Drag a file to notepad and the contents will display!
Multi Chip Programmer - will burn your chip.
MPASM - assembles your .asm file into a .hex file for burning.
ICPROG.exeand a help file: ICPROG-Help.zip - software for burning.
(See Burning A Program for help on setting-up ICProg)
Logic Probe (kit) - a very handy piece of test equipment- again, using a PIC12C508A!

Robot Beacon is a rotating light. We have called it Robot Beacon as it has been designed as an addition for a robot, but it can be used for many applications.
It can be used as a mast-head beacon on a boat or as an "all-round" warning light on a bike. The author saw a similar device in a "What's New!" store for $99!
This is another project to show the versatility of the PIC12C508A. It's a handy little chip for all sorts of applications.
Even in a project such as this, it takes the place of at least two chips. But the LEDs are switch-mode at a duty cycle of 50% at 500Hz and it would be difficult to produce this with less than 3 chips. Switch-mode saves nearly 30% in current (from 30mA to 20mA). A full explanation is given in the article. You can modify the effect, make it reverse, invert the effect or randomize it. This would normally take 4 or 5 chips. The display can be turned off in bright light. A photo-darlington transistor has been included to detect surrounding light level.


Complete Robot Beacon

There is more in this article than a chip and a few LEDs.
It's a good start to two of the topics we are covering in our electronics course.
These are:
Programming a PIC12C508A chip
Using a Logic Probe
Designing a project involves three separate areas of work. The author has one area where he builds the prototypes. It has a soldering iron, test equipment and all the parts needed for prototyping.
Another areais where the hand-writing takes place, including circuit designing and where the pages of books are laid out, plus the library of reference books. The last area has the computer, multi-chip programmer and is where the pages are typed on the computer for the web (and future books).
I think yours will be the same. Most often the workshop is separate from your computer and you will have another section called "library," holding books and where things can be written and laid out.
This project involves all these areas, and more. It introduces the use of a Logic Probe to help with the design and testing of a project and how to produce program for the 8-pin PIC12C508A.
Even a project as simple as this can require trouble-shooting and the Logic Probe we have designed is one of the best.
It is both a logic probe and a pulser as well as producing a number of tones and tunes to test audio amplifiers.
We cover its assistance with this project, in the text.
We also show how to produce a program for the PIC12C508A. This chip is normally very difficult to use as it is not "user friendly." It is a One Time Programmable device and if the program does not work perfectly, the chip has to be thrown away.
For developing a program, you need a number of EPROM versions (also called "window" versions) as well as an ultra-violet lamp. This adds considerably to the cost of development and makes it impractical for the hobbyist. We have "cut around" the costs and developed a brilliant new approach.
It is also discussed in the article.
There's a lot to be covered, so let's start . . .
This project has 4 different levels of involvement.
1. You can buy it ready-made.
2. You can buy a kit with a ready-programmed 8-pin chip. This only requires soldering and does not involve any programming.
3. You can buy the kit with a blank PIC12C508A and burn your own program.(You will need the Multi Chip Programmer.)
4. You can modify the circuit, use the Logic Probe to check it, write a program in a PIC16F84, use an adapter socket, burn a program in a PIC12C508A and be involved in the project to its fullest.

THE CIRCUIT

TRANSISTOR TYPES
In most of our projects, we specify BC 547 and BC 557 to indicate an NPN or PNP transistor that has no special requirements.It represents a simple, basic, general-purpose transistor.
The specifications for this type of transistor is generally accepted as:

Voltage handling capability collector-emitter: / about 25v
Current handling capability: / about 100mA
DC gain: / about 100

Some magazines use the term TUN and TUP for Transistor Universal NPN and Transistor Universal PNP.
BC 547 and BC 557 are the "lowest" or "simplest" transistors you can get. They have a minimum current handling capability and a fairly low voltage capability and this means almost any other transistor can be used as a substitute.Using transistor types such as BC 547 and BC 557 is common in many magazine all over the world.They were one of the first transistor types to be readily accepted in the design of equipment and all technicians understand their characteristics.
If we specified types such as BC182L or BC214L many readers would immediately say "Why has this transistor been used?"
We want to keep the circuit easy-to-understand and that's why we specify the simplest type. Most of our circuits will take any of the general-purpose types and when we indicate a type other than BC547 or BC557, you will need to look at the specifications, to find the reason.
Generally there are two reasons for selecting a type other than BC547 or BC557. It is usually HIGH VOLTAGE and/or HIGH CURRENT.
These requirement increase the cost of a transistor enormously and that's why we don't specify them unless it is absolutely necessary.
HOW THE CIRCUIT WORKS
The circuit uses five outputs of the chip to drive 16 LEDs. Two LEDs are placed in parallel on each output (something you should not really do) so that they are illuminated at the same time. Four lines are used to produce a "run-of-four" or "4-chase" and one line is used to select between two banks. When the select-line (GP4) is HIGH, the BC 547 transistor is turned ON and the first four LEDs in the sequence are activated by the outputs mentioned above. When the select line is taken LOW, the next four LEDs in the sequence are activated. This gets the action to 180°. LEDs on the other half of the display are also activated during this time and thus the sequence is complete.Two LEDs run around the display at the same time.
You will notice each output drives a pair of LEDs in parallel. In our case, they cannot be placed in series as the voltage drop across each LED is 2.2v (they are high-bright LEDs). The voltage across two LEDs would be 4.4v plus .35v across each transistor and this does not give any meaningful voltage for the current-limiting resistor. If the supply drops 1v, the LEDs would not illuminate.
The only problem with this type of design is the need to match the LEDs. In other words, the LEDs should come from the same batch or manufacturer.
If two LEDs with different characteristics are used, one LED will be robbed of turn-on voltage and will produce a very dull output.
The LEDs in the kit are all high-bright and can be seen at 100meters (yards).
Now we come to some of the other components.
The three components across the power rail are important.
The 100n across the chip is to provide good start-up for the oscillator inside the chip.
The 100u electrolytic helps maintain brightness of the LEDs when the battery is low and the 10k resistor bleeds the 100u when the circuit is turned off. Without the resistor, a very small voltage will remain in the electrolytic and this will maintain memory in many of the cells inside the chip.
When the chip is powering down, the content of some cells gets jumbled and if the micro is turned on in this state, it will fail to start-up (the chip does not have "brown-out" detection).
The MEL-12 Photo-Darlington transistor puts a low on the input line of the micro when it detects light and the program is held in a loop, looking for a high on this line.
The operation of a photo transistor has been covered in our Basic Electronics Course, on page 47.
By using a low value resistor on the collector, it requires a high level of brightness to turn the circuit off. If a high value is used for the load, the slightest amount of illumination will turn the circuit off.
The program executes one cycle before closing-down in bright light, to prove the program is working.
A small black hood can be placed over the photo transistor to keep the circuit operating at all times.

MARK-SPACE RATIO
A LED is capable of being turned on and off very quickly. It produces light by the passage of current though a crystal and not via the heating of a filament, such as in a globe. This means the LED will turn on and off very quickly as there is no filament to take time to warm up and cool down.
There are two ways of activating a LED. One is to deliver a fixed current and the other is to deliver pulses of current.
One of the amazing things about a LED is the delivery of pulses of current. If you deliver a slightly higher current in short pulses, the illumination produced is the same as a constant current at the lower mA value.
Providing the pulses are delivered at a repetition rate above 100Hz, you will not be able to detect any flickering and the overall energy taken by the LED will be lower.
That's what we have done in this project. The LEDs are not turned on with a constant current but pulsed at about 500Hz.

PARTS LIST
Kits for this project are available from Talking Electronics.

ROBOT BEACON
PARTS LIST
au$29.50 plus $2.20 post
Order kit
2 - 100R all 1/4 watt 5% resistors
4 - 470R
1 - 4k7
1 - 47k
1 - 100n monolithic capacitor "monoblock"
1 - 100u 16vw electrolytic
16 - 5mm red LEDs
1 - 1N 4004 power diode
1 - BC 547 transistor or similar
5 - BC 557 transistors or similar
1 - MEL-12 photo Darlington transistor
1 - black sleeve for MEL-12
1 - 8pin IC socket
1 - PIC12C508A chip (with routine)
1 - Battery Snap
1 - 4-AA cell battery holder
4 - AA cells
1m -very fine solder
1 - Robot Beacon PC board
Kits for Robot Beacon can be obtained from Talking Electronics:

Adaptor Socket
PARTS
au$5.40 plus $2.20 post
us$3.40 plus $5.50 MAX post

SOLDERING
The kit comes with very fine solder to introduce you to the "best aid ever devised for soldering."
Fine solder makes soldering so much easier. The quality of your soldering improves enormously andyou will not want to go back to thick solder again.
Make sure you apply a small amount of solder to the actual joint as the only real item you want in the solder is the flux. It's the flux that makes the joint small and shiny, It makes everything "stick" better. You can see the edges of the joint have a better adhesion to the track-work when fresh solder is used.
All our boards are pre-tinned and have a solder mask around the lands to the solder will only adhere to the required places.
It's not until you work with one of our boards that you will never go back to a board without the same features.
Here's an unusual question: "What's the life of solder?"
"About 5 seconds!"
Solder is absolutely useless without rosin (or resin) and the rosin must be melted to provide its cleaning properties.
So, the life of solder is only during the time when the rosin is melting and evaporating. That's why you have to apply the solder at the joint.Trying to carry hot solder on the tip of a soldering iron is impossible. It is absolutely DEAD by the time it reaches the joint. Sometimes you can "tack" a component by using dead solder on one lead. You can then solder the other lead with fresh solder and re-do the first connection by adding fresh solder.

CONSTRUCTION
Before starting, decide on where you will be using the project so the positioning of the LEDs can be worked out. They can be facing radially outwards or towards the front, to produce a miniature sign such as for a train layout.
The type of LED can also be altered. The kit contains 5mm high bright LEDs but these can be changed for diffused LEDs of any colour and size.
There is only one point to note. Each output drives two LEDs in parallel and they must be of the same type as the voltage drop across each must match very closely. For example, one LED in the parallel pair cannot be a different colour as each colour has its own characteristic voltage drop and the LED with the lowest drop will rob the other of voltage. If a LED does not see its characteristic voltage, it will not turn on AT ALL. This is one of the major differences between a LED and a globe. Alternate LEDs in the sequence can be a different colour.
Fit the IC socket first. Use our resistor identifier to identify the 470R from the 4k7. Fit a maximum of three or four components at a time and cut the leads after soldering. If the LEDs are to face outwards, fit the leads down the holes and bend them over so the body just touches the edge of the board.
Make sure the short lead is identified as the cathode and matches the line on the overlay.
The short lead of the MEL-12 is the collector. Keep the Photo Darlington transistor off the board to prevent it getting too hot when soldering.
The last item to solder is the leads of the battery snap. These can solder to the underside of the board to keep the appearance neat.
Fit the chip to the project and connect the 6v supply. The LEDs will rotate approximately two revolutions per second. If the speed is increased (by altering the value of the delay in the program), the effect is lost. Your eye sees too many LEDs ON at the same time.