Infolinks

Monday, October 25, 2010

Making your own Training I/O module (LED, push button, and DIP switch)

On the previous discussion, We are try to make ourself mini downloader using computer parallel interface. This time we are try to make I/O module (Input/Output) for the previous downloader.

Figure 1. Module and Micro
Here is the illustrate.
It's simple ways, caused by very easy to get the component. I/O is going to make is 2 byte input and 2 byte output. Input are using 8 pcs push button, 8 pcs DIP switch, but the output are use 16 pcs LED. It's up to you about the LED colour, the important think is for display active signal from micro. 
Input and output is active low, which is, when the logic is low or zero, LED is going to glow. Confuse about that? don't be confused. The point is when the LED receiving signal zero volt, the LED is going to shine, so, the other LED pin is connected to positif voltage. and so as the input. Input signal to the micro are have to be grounded for giving the active signal.

Figure 2. LED and Switch module
Now, we try to make it. Component needed:
- 8 pcs LED Red 2.5mm
- 8 pcs LED Green 2.5mm
- 8 pcs push button
- 2 pcs DIP switch @4 switches
- 16 pcs resistor 300ohm
- 1 pcs terminal 40 pin
- 3 pcs resistor array 9 pin, 10Kohm
- 1 pcs housing 2 pin
This circuit are tried by me and connected to downloader in previous discussion. the result, it's not bad for programing LED and switches with microcontroller.


Figure 3. Switching circuit

Figure 4. Output circuit


Switching circuit:
On the figure 3, Switch are grounded for active low by adding resistor 10k ohm to the Vcc. The function is giving logic 1 or 5 volt to the micro when the button is not pushed. And it going to supply logic 0 or 0 volt when the button is pushed. Out line on figure 3 is direct to any port on micro. Build this circuit as many 8 pcs with using resistor 9 pin 10Kohm for siple circuit.

Output circuit:
On the figure 4, using LED can be applied directly from the IC, other ways are using pull up circuit on the IC output. For safety and avoid to unload the IC, We are going to use resistor as pull up on IC output. Using pull up is only on port 0 AT89S51, caused by port 0 iskarena keluaran port 0 is threshold. so have to be sure with pull up circuit, another port are unecessary pull up circuit, because it was include in the IC. Input of this circuit is connected to IC and the output is connected to LED, it's have to be resisted with 300 ohm for decreasing current to the LED. Maximum LED current is only 20mA. If it's over, the LED is going to broken.
 
Make the LED circuit as many 16 pcs with 1 pcs resistor array 9 pin as pull up. Pin anode LED is connect to Vcc. and pin LED cathode is connected to IC with series resistor 300 ohm.
Using housing 2 pin to connecting module and micro with Vcc 5 volt. VCC 5 volt is already connected in terminal 40 pin, so you don't need more cable. For the PCb, you can make your own PCB.

How to make a PCB? we are going to discuss it at next session. Cause of the simple ways.
Are we want to learn? it's on your self. Important think is " WILL". Thanks.

No comments:

Post a Comment