Programmable presentation timer

Introduction

How important time is for you ? Well time is the most important thing you own.  Time is a very special resource because we cannot store it, save for later use or borrowed. So in every little thing we do it is essential for us to manage time, effectively and efficiently.

Even when delivering a presentation, it is really important that both the presenter and the audience are time conscious.

A presentation timer is a device that helps to track down the time, during a presentation.  So the user is aware of how much time is left. And today most of the people tend to use a timer during their presentations. There are varieties of presentation timers available in the market. A presentation timer can be an up counting or down counting.

This project is about building a down count timer. Where the user has to input a desired time (the time could be set up to 99 minutes). And once the time is set, by pressing the start button , the down count can be started. There are more feature that have been included addition to down counting They are listed in chapter 2.

The PIC microcontroller  I have used is 16F877A. Description of the project has been included below . Coding and all the schematic diagrams are attached in the end. Hope you will find it easy to understand .

 


 

  Materials and methods

 

Figure 1-  Image of a PIC16F877A Microcontroller

As mentioned before the microchip PIC that is used here is PIC 16F877A. It consists of 40 pins and there are 5 ports namely port A, B, C, D and E.  There  For my project I have only used port B, C and D. You will see that my devices consists of a mother board and 3 daughter cards.

The mother board is constructed with the basic components that need to bring the micro-controller to the working condition. The crystal oscillator that has been used is a 4 MHz oscillator. Since there should be a way to program the PIC we need an ADC (Analogue-to-digital convertor). A 9 pin RS 232 is used for that. This also includes a power supply unit to give a steady 5 V power to the microcontroller including a regulater.

Daughter cards contains the rest of the circuit that needed to build the timer. There are 3 daughter cards included. daughter card 1 contains the components that are connected to port B, daughter card 2 contains the components that are connected to port C and daughter card 3 contains the components that are connected to port D.

The multiplexing method is used to display the seven segment display to minimize the amount of current driven out from the PIC micro-controller.

Features in the device.

  • Two seven segment displays( One for the presenter and one for the audience)
  • Time could be set up to 99 minutes using 2 push buttons
  • Start button to start down counting
  •    Pause button to pause
  • Reset button to reset the time
  •   A buzzer to indicate once the count is down to 1 minutes and once it reaches 0
  • Once time reaches 0 the up count will start

Orcade family release 9.2 was used to design the hardware. Schematics diagrams were designed using Capture CIS and  PCB art work is done using Layout Plus.  MPLAB is used to write the programs. The language that used was HI-TECH C. Win PIC800 v3.64 was used to program the microcontroller.

Material list

Table 1- List of materials

Component

Value

Model

Amount

Battery

9 V

1

Buzzer

3 V – 24 V

1

Ceramic cap

0.1 u

5

Ceramic cap

   22 p

2

Connector bars

Crystal oscillator

4 MHz

1

Female serial con

1

Jumper wire

Large seven segment display  (5 cm x 7 cm)c/c

4

LED 3mm Green

1

LED 3mm Red

1

MAX232 IC

MAX232

1

PIC microcontroller

16F877A

1

Polar cap

220 u

3

Polar cap

 10u

4

Pushbuttons

5

Regulator

7805

1

Resistor

10 k

5

Resistor

1 k

18

Resistor

470

2

Resistor

330

7

Ribbon wire

Small seven segment display (2 cm x 5 cm) c/c

1

Switch

1

Transistor npn

BC547

4

Transistor pnp

BC557

7

Design and construction

Hardware

Daughter card 1 contains the components that are connected to port B. The large seven segment display (for the audience) required a 9 V, and since the maximum voltage that can be given from the microcontroller was 5 V, power for the large display was given separately using a 9 V battery.  Therefore the  seven segments were connected to the microcontroller using pnp transistors and driven by 7 pins of port B (RB0 to RB6).

Figure 2- segment connected to the microcontroller using pnp transistor

And these seven segment displays (ssd) are common cathodes . Since the multiplexing method is used, where a one digit is lit at once , the four common cathodes (c/c) are connected to ground using npn transistors and will be driven by 4 pins from port C.Daughter card 2 contains the components that are connected to port C. For push buttons 4 pins from C0 to C3 are used. Special purpose to choose these pins is since there are interrupters in the code, C1 and C2 were essential for this purpose.The other push button is connected to the master clear of the micro-controller and used as the reset button. Push buttons are connected through a pull down resistor.
The other 4 pins are used for multiplexing method.

Figure 3- c/c is connected to ground using npn transistor

 

Daughter card 3 contains the components that are connected to port D. Small seven segment display only requires 5 V or less voltage. Therefore it is powered by the microcontroller itself. Each of the seven segments is connected to 7 pins of port D (RD0 to RD6) using 330 Ohm resistors. And the 4 common cathodes are connected to ground using same 4 npn transistors that used for the large seven segment display.

Buzzer has a working voltage range of 3 V to 24 V. Therefore it is also powered by the microcontroller. It is directly connected to pin D7.

The following block diagram will give you an overall idea about the whole hardware part of the circuit and how the rest of the parts are connected to the mother board.

 

Figure 4 – block diagram of the circuit

 

If you are interested the schematic diagrams have been attached at the end of this page.

 

coding

As mentioned before coding was done using HI-TECH C language. The down counting will be done by a for loop. Loop will reduce the number of seconds 1 by 1 with a delay time equals to a second.

Here i have used an interrupt isr function to interrupt the program once the button pause is pressed.

The code listing has been attached at the end of the page

 

Result and analysis

Once the daughter cards were build a testing was done to see whether there are any connection errors and to see if the hardware part is working. Initially a test was done using a multimeter. Later it was tested with a sample code using demo boards. And finally with the mother board using the proper code. The following snaps were taken in the testing phase and illustrates the response for the button presses.

Figure 5 – small ssd at testing phase

Figure 6- small ssd at testing phase

 

These 2 videos show the response of the seven segment display for the button presses (to increase the value and to reset ) in the testing phase.

YouTube Video

YouTube Video

Discussion and conclusion

The device is able to count down, starting from a given value.  And the buzzer is working as expected.
If a component with a required voltage is higher than 5 V  is connecting to the microchip it is better to use a pnp transistor other than npn transistor.Or else a separate IC could have been used  to drive seven segments. MAX 7219/MAX7221 IC s are specially build to drive seven segment displays.

As for limitation in this device is that the user only can set the no of minutes. There is no way for him/her to set the no of seconds. Or else one push button could have been used to increase the no of minutes and the other to increase the no of seconds.  But this might not be that practical because to input a value like 30 seconds the user has to press and hold the button being pressed until the value increase up to 30 minutes. And this might take a bit of time

And also the display for the audience may be too small if is it a wide hall.

Further Improvements

  • More push buttons could be used to set the no of seconds as well.
  • If an IC is used to driving the large seven segment display, then the size of the device could have been reduced and make it more portable.
  • The major improvement that could be done is to use more accurate code for down counting and up counting. Since I have used a for loop for this purpose, the second is not that accurate. It was later discovered that one of the timer pins in the microcontroller could have been used for this purpose. So the count would happen exactly a second by second.
  • Also since the large display could be too small for a wide hall, a much larger display could be constructed using LEDs .  A diagram that can be used is shown below. The display is common cathode. Therefore the same method could be used for the multiplexing method.

Figure 7- circuit diagram for the led display

http://www.wikipedia.org/
http://forum.allaboutcircuits.com/archive/index.php/t-58008.html
http://extremeelectronics.co.in/microchip-pic-tutorials/using-multiplexed-7-segment-displays-%E2%80%93-pic-microcontroller-tutorial/
https://sites.google.com/a/sci.cmb.ac.lk/esl/