This 4 Digit Up/Down Counter has all the features you need. And they are all ON the PC board.
This project is as old as Methuselah but it’s very handy for anyone producing or packaging a product or “counting their chickens.”
You don’t need any extra relay or buzzer and the up/down switches have inputs for remote switching as well as a 10-pin connector so the project can be mounted on a cabinet.
It also has a very easy to use PRE-SET using 2 buttons, to quickly load any value.
Simply press SET and the display will show – – – –
Use the INC button to increment the units display and press SET. The tens display can now be incremented, then the hundreds and thousands.
Press SET and the display will show 0000 and the buzzer will screech.
Press DOWN and the preset value will appear. When the count reaches 0000 the buzzer will sound and the relay will activate during the time when 0000 is on the display.
The counter will then show the preset value when the DOWN button is pressed and counting can continue until the display is zero.
There is almost nothing else to know as all the “workings” are contained in a micro and if you want to learn about programming this microcontroller, we have separate projects to get to started.
In addition, we show how to create your own PC boards using the simplest software package that “doesn’t fall over” and doesn’t frustrate. These are all to come.
Don’t even attempt to put this project together unless you have a fine tipped, temperature controlled soldering iron, tweezers, fine solder and a steady hand. The solder must be 0.8mm or 0.5mm
The surface-mount components are the most rewarding part of construction. They are fitted just as fast as through-hole components by using a pair of tweezers and only soldering one end. Put you finger or nail on the component and heat up the connection again to make sure the component sits firmly on the board and solder the other end quickly.
Once you go to surface-mount – you never go back. They simplify a project enormously by virtually disappearing and you can use both sides of the board to produce a more-compact project.
Logic Probe Test Points have been added to the latest batch of boards so you can check the running of the program and for test purposes. A low-cost Logic Probe will be one of the next projects we describe.
All the testing of the project will be covered in future articles after we present two pieces of TEST GEAR – a LED Tester and LOGIC PROBE.
Construction
Start by fitting the surface-mount transistors, resistors and capacitors, as well as the 5v regulator and 10u tantalum capacitor, to the underside of the board. Then fit the 4 displays, terminal bocks, tactile switches, 18 pin IC socket, 2 electrolytics, BD679 transistor, 1N4148 diode, on/off switch and finally the relay. The 10-pin connector can be fitted if you are mounting the board and using remote switches.
Fit the PIC microcontroller chip containing 4-Digit routine, connect 12v to the input terminals and switch the project ON.
The display will show 0000 and the buzzer will sound.
Use the SET button to create a pre-set value and press the DOWN button to start the count.
The buzzer will sound when the display reaches 0000.
The buzzer is classified as an active device as it has its own internal oscillator, coil and metal diaphragm to produce an output when DC is applied. It is called an electromechanical buzzer.
NOTE:
You can get the assembly file (.asm) and .hex file for the 4-Digit Counter as well as prices for the kit, PC board and chip, from the author: Colin Mitchell talking@tpg.com.au You will get a listing and address of your local kit supplier by return email.
To save space in the magazine, the PCB trackwork is not included in the article. It is available via email. The board is too complex to make yourself (double-sided) and is available at low-cost from your local kit supplier.
All projects designed by Colin Mitchell are available as a kit and a full back-up service for testing and repair is available via email. This is an exclusive FREE service for Electronics Maker readers so you are guaranteed to get every project working.
PARTS LIST
7 – 47R resistors (470)
1 – 150R SM resistor (151)
2 – 220R SM resistors (221)
6 – 2k2 SM resistors (222)
4 – 4k7 SM resistors (472)
3 – 100n SM capacitors
1 – 10u SM electrolytic
1 – 22u electrolytic 16v
1 – 100u electrolytic 16v
1 – 1N4148 diode
12 – BC848 SM transistors
1 – BD679 Darlington transistor
4 – TIL 313 displays or equiv
1 – TV-3 12v DPST relay
1 – 78L05ACM 5v regulator IC
1 – PIC16F628 microcontroller (4 Digit program)
1 – 5v buzzer
1 – 18 pin IC socket
5 – 2-pin terminal blocks
1 – 10 pin 90° double-ended connector strip
4 – tactile buttons
1 – mini slide switch
30cm very fine solder
1 – 4 Digit Counter PCB