This module is designed to work with the trainer boards we have published previously. It provides eight input or output lines, configurable with jumpers. The boards we use at NeoTeo for exercises with 18- and 40-pin microcontrollers already have some onboard push buttons and LEDs, but they are often not enough. This project adds eight more I/O lines, and you can build additional identical boards if you need more.
One feature stands out in the circuit diagram: the module has no power supply of its own. It draws power directly from the main board it connects to. With all eight LEDs lit, it uses about 100 mA, a current either PIC Trainer can supply without difficulty.
The circuit is made up of two identical sections, each with four LEDs and four normally open push buttons. The sections are separate because the expansion connectors on the central boards in this module set provide connections for four port pins each. So, you need two cables to use all eight I/O channels. If you only need four lines, there is nothing to stop you using a single cable.
As the photos show, each channel has a jumper fitted across a set of three pins. It selects whether that channel uses the push button as an input or the LED as an output. The center of the three brass pins is the common connection. The pin toward the push button sets the channel as an input; the pin toward the LED selects output mode.
With the jumper set toward the LED, current from the microcontroller pin flows through the 220-ohm resistor and the LED, making it light up. Set toward the push button, the jumper lets the 5 V supply from the main board travel through the ribbon cable to the corresponding microcontroller pin. A 10-kilohm resistor connects each channel to ground through the ribbon cable, so the pin does not float when the push button is open.
You can use any combination: set every channel as an input or an output, or divide them up however you like by placing each jumper in the desired position.
The board is very small, measuring just 75 × 38 mm. That means using 3 mm LEDs instead of the more common 5 mm size. Its connectors have the same pinout as those on the main boards, so ribbon cables made for the other modules will work with this expansion board too.
There are no special assembly recommendations. As usual, print the proposed PCB artwork with a laser printer and transfer it onto the copper using the heat of a household iron. Once the board is ready and drilled, solder in the components, taking care to orient the LEDs correctly; otherwise, they will not light.
You will need:
- 2 male 10-way Molex connectors
- 24 brass pins
- 8 3 mm LEDs
- 8 220-ohm, ¼-watt resistors
- 8 10-kilohm, ¼-watt resistors
- 8 normally open, 5 mm PCB-mount push buttons
- Pertinax board, jumpers and other materials
These components should cost no more than 5 or 6 euros. If you have been following the Microcontroller Programming Tutorial, consider building this little module: we will use it in the tutorial’s fourth installment.
More projects on NeoTeo