Friday

Interesting DIY Microcontroller Projects - Design A Track Running Announcement System !!


This article is written by flashG

Visit flashG Blogs
Visit flashG Videos
Visit flashG - Build Own PC Computer Guide

----------------------------------------------------------------------------------------------

1.1) Objectives

In this project, we look at how we can implement a "Digital 2.4km Run Announcement System".

1.2) Design Methodology

The entire design process can be partitioned into a pyramid as follows.

Specifications and Requirement Capture

Components comprises of LED display, a voice synthesizer, a keypad and an infrared Interceptor.

1) Button on keypad is depressed when the runners are flagged off.

2) The display will show continuously the time lapse at 0.1 second resolution.

3) When the infrared ray across the track of the runner is intercepted, the time at the point of interception will be announced.

4) The time will also be logged on the system.

System Concept

The system is capable of displaying the time on the LED display once the start button is pressed. At the same time, the infrared interceptor is started, and is continuously checking if its infrared ray is intercepted, and if so, trigger the system to announce the time of interception to the runners, and make a log of the time of interception to the system. The runner should also be able to see the time they took on the LED display. If the STOP button is pressed, the timer should stop timing, and log the time of disconnection on the system. When disconnected, the infrared interceptor and LED Display are also to be off.

Working Principles

In order to implement such a system, background knowledge about the workings of each component in the system is required. In this case, we need to know the controlling of the LED display, the voice synthesizer, the infrared interceptor, and the keypad, and finally we will show a flowchart on integrating these devices.


LED Display

As found, LEDs run on about 2 volts, hence we need a simple resistor in series to absorb some of the voltage and limit the current the LED can draw. Assuming an input voltage of 5V and a current of 10 ma, and applying V=IR, we can find the required resistance as R = V/I = (5 - 2)/.010 = 300 ohms.

To have a brighter LED, I can choose the resistor as 270 ohms allowing more current flow, making the LED brighter. With that, the new current drawn is I=V/R = 3 / 270 = 11ma.

Given a 7 segment LED, the basic configurations looks as follows:

The 7 segment LED Common Anode will be adopted because the microchip is now driving up to 8 LEDs (segments) at a time off a single port. Just as each I/O pin has a limit to the amount of current it will source or sink, each port also has a limit. To do the least damage, we are sinking the current to ground rather than sourcing it to 5 volts.

To add more displays, the cathodes from a particular segment of each display are all connected together and then connected to a PIC I/O line through a series resistor. The common anode is made controllable by a PIC I/O pin. In this way, the segment value for a given display can be configured and through turning on the anode for that display, we can see the message. The same procedure can be applied to the other LED displays, and when a suitable timing is chosen, we should be able to see the full display of all LEDs without flicker. The suitable timing is chosen by finding out the time constant of the LED using a datasheet, and from this value, we can choose the appropriate refresh time such that it is less than the time constant, allowing the LED to appear bright all the time.

Also a transistor is placed between the PIC and the common anode to each display. Since the current for the entire display runs through this one pin, it could overload a single I/O line. To overcome this issue, the transistor amplifies the current drive capability of the I/O. To operate, put ground on the I/O pin to turn on the transistor and enable a given display, or put 5 volts on the pin to turn off the transistor and the display.

The figure below shows the case for 4 LED displays:

With this way of using LED displays, we can select the numbers to display based on the configuration as follows:

Take segment ‘dp’ as the MSB, and segment ‘a’ as the least significant bit, and to enable a particular segment to light up, we must apply a low to the corresponding segment, since it is an active low input. The table below shows the segments which we have to control to display each digit from 0 to 9.



Voice Synthesizer

In order to announce the time of interception to the runners, there is a need to store each digit from 0 to 9 in human voice and depending on the situation, announce the correct time by finding the location of the voice segment corresponding to the correct digit.

As found, the average human voice frequency is estimated at 2 KHz to 4 KHz. Hence, we need to sample at a Nyquist sampling rate of f(sample)>2*f(voice)= 8 KHz. We choose the minimum sampling frequency as 8 KHz. Given this frequency, it implies that the voice should be sampled every 1 / 8 KHz = 125 us.

The voice corresponding to a particular digit can also be broken down into different syllabus, and each syllabus should take up equal frequency of sampling. For example, the rate of sampling a particular digit of 3 syllabuses will have each syllabus taking up 8000 / 3 = 2667 Hz

To start, we can use the sound recorder provided under Microsoft Windows to store the voice as a wave format. We have to set the settings as 8 kHz, 8 Bit, Mono. Next, we remove the header bytes by using a binary editor such as Hexplorer. After which the voice data corresponding to each digit can be stored in the EPROM, and being referred to as and when needed.

To recover an analogue signal from the digital signal stored in the EPROM, a Digital to Analogue converter is used. The digital signal has to be fed to the analogue converter at a rate of 8 kHz or every 125 us. The output from the D/A is then fed into a LPF of 4 kHz to remove any noise. The final output is then fed through a power amplifier such as LM386, and through current amplification, we can obtain load matching with the 8 ohm speaker, and get max power output.


Infrared Interceptor

The infrared interceptor is made up of the infrared LED, the infrared detector GP1U5. The infrared detector contains both the IR detector and a small circuit that detects a 40kHz modulation. This detector is able to reject noisy light signals and hence has better performance. It works by detecting the modulated infrared light from the IR LED, and through amplifier and band pass filter of 40 KHz, get a clean signal.


The general diagram of the implementation is as follows:






A possible method of getting a 40kHz signal from the infrared LED is as follows:

If there is any runner crossing, the detector will sense a difference and we can use the signal to feed into the interrupt pin of the microprocessor which will then announce the time and also make a log on the system.

Keypad

The figure on the left shows the schematics of the 4*4 keypad. The needed outputs can be fed to the Programmable Peripheral Interface 82C55 of the microcontroller for reading the status, and through the 82C55, decide the type of interrupt request to the microprocessor.

In our system, button 1 is designed to start the run, the LED display and the infrared interceptor. Button 2 is designed to stop the run, turn the LED display and infrared interceptor off. All other buttons should not interfere with the operation of the system.



Realization

We use a flowchart to show how these different devices can work together.



With this done, we have already gotten ourselves a very concrete design on paper, and it is now time to implement this into product through the necessary hardware and software implementation.

Hope my little project has inspired you with lots of creativity for you to start your very own DIY projects as well.


No comments:

Google
----------------------------------

For more great stuffs and exciting blogs, visit

http:\\www.diypc.wordpress.com
My Other Interesting Blogs!!


Feel Free to email me at
jimmyleespore@yahoo.com.sg

Simple Step by Step PC Assembly Videos at MetaCafe
Click to learn Now !!