Electronic and Computer Resources - Parallel Port Interfacing and Programming using Turbo C


BACK          HOME          NEXT


Interfacing with AC load

In interfacing AC loads, isolation is very important. This because an interfaced circuit that do not isolates the computer from the AC load have chances that the computer will be so much affected if ever the interfaced circuit will fail or be destroyed. Isolation can be done using a mechanical relay, an opto-coupler or solid-state relay. The figure below shows a 220V AC buzzer interfaced to the computer.


220V Buzzer Interfaced circuit diagram


The figure shows a solid state relay that is used as a switch to control a 220V buzzer. When LED lights on, current from AC source will pass through the triac and switches the buzzer on. When LED turns off, the buzzer also turns off because the current will stop flowing in the triac.

To control the buzzer, therefore, is just to control the LED of the solid state relay.


Electric fan Control Program

Lets have an example controlling a 220V AC Electric Fan


A solid state relay acts as an interface between the computer and an AC load plug to an outlet. The relay is interfaced D0 of the computer port. Together with the solid state relay is a push button interfaced to S3. Write a program that will switch on the electric fan that is plug to the outlet if the push button is pressed. If the push button is pressed in the second time, the fan will turn off. Pressing the push button in the third time will switch on the fan back and so on.  The program should end if a key is pressed in the keyboard.


R = 10k


Interfacing Circuit Diagram


Here is the link of the source code of the program: ACFan.CPP


BACK           HOME           NEXT




    Parallel Printer Port  

    Port Functions

    Sending a Byte

    Reading a Byte

    Interfacing LED

    Interfacing Push Button

    Interfacing 7-Segment

    Interfacing Coil

    Interfacing Relay

    Interfacing  S. Motor

    Interfacing AC Load

    Interfacing Sensor



Electronic and Computer Resources - Parallel Port Interfacing and Programming using Turbo C







1.  The Parallel Printer Port     2.  Port Functions in Turbo C    3.  Sending a Byte to the Port    4.  Reading a Byte     5.  Interfacing with LED

6.   Interfacing with Push Button     7.  Interfacing with 7-Segment    8.  Interfacing with Coil    9.  Interfacing with Relay    

10.  Interfacing with Stepper Motor    11.  Interfacing with AC Load    12.  Interfacing with Sensor

For questions, corrections and suggestions, 

email to: [email protected]

Hosted by www.Geocities.ws