The software program
Here serial communication is used to communicate with microcontroller IC1, and the microcontroller controls the device drivers. For the serial data transfer using RS232 protocol, the microcontroller and the PC should have the same baud rate. Here the baud rate is fixed at 9600 bits per seconds. With eight data bits and one stop bit, the parity is set as ‘none’ and the flow control is hardware in both the microcontroller and the computer. This is the basic setting for the serial data transfer used in this equipment controller project.
Two programs are used in this project. One is the firmware code for the microcontroller and the other is the user interface program.
Keil µVision is used for coding the firmware for the microcontroller and generating the hex code. The hex code can be burnt into the microcontroller using any compatible programmer board from Atmel, such as TopView programmer.
The user interface program to control the devices from the PC is developed using Visual Basic (VB) 2008, which has been chosen because it is user-friendly for designing GUI (graphical user interface) applications. Eight on and off buttons are used to control eight unique loads. Up to eight devices can be operated one after the other, or turned on/off simultaneously. The device’s on or off status is also shown by an indicator in the VB program.
Construction and testing
An actual-size, single-side PCB for PC-based electrical equipment controller circuit is shown in Fig. 3 and its component layout is shown in Fig. 4. Assemble the circuit on the PCB to save time and avoid assembly errors. Carefully assemble the components and double check for any short-circuit errors in the circuit. Burn the hex code into the microcontroller using a suitable programmer.
Use IC bases, especially for the microcontroller, on the PCB. Connect the assembled circuit to the COM port available on the back of the computer.
Run the VB program and you will see the welcome screen shown in Fig. 5. You need to enter the serial COM port in next screen. In this example, we have used COM 4 as shown in the screenshot in Fig. 6. Clicking the ‘OK’ button will lead you to the main control panel, where you can control the appliances using the mouse by clicking on the corresponding device’s button as shown in the screenshot in Fig. 7. You can either control the devices individually, or all eight at a time. If you click the ‘load1’ button, you will see low voltage at port pin 12 of the microcontroller. Then the first device will be turned on. Press reset switch S1 momentarily in case the device does not turn on. For more troubleshooting, refer to the test points listed in the table.
The author is in the third year of his BE (electrical and electronics) at Vickram College of Engineering, Madurai