12-03-2016, 01:00 PM
programming of atmega16 for traic
In this project, we will learn How to design a BT136 Triac based PC controlled home appliances system with AVR ATmega16 microcontroller Part-II. Here, we will use the PC keyboard as the input device to control the appliances i.e 2 bulbs and 2 fans and we will display the status of each appliance in the PC.
PC will send the control signal(ASCII value of pressed key value) to the ATmega16 microcontroller through its serial port. But current generation PCs and Laptops do not have serial port in them, so we will use one USB to Serial converter cable which will create a virtual serial port in the PC /Laptop. Again, the output of USB to Serial cable can not be connected to microcontroller directly as the output voltage of USB to Serial Cable corresponds to RS-232 level. But the ATmega16 microcontroller needs TTL/CMOS voltage levels. For this, we will use MAX-232 voltage converter which will convert RS-232 voltage level to TTL one and vice-versa.
The ATmega16 microcontroller will read the serial output of MAX-232 through its USART and it will process it to know which key of the PC keyboard is pressed. After knowing which key of the PC keyboard is pressed, the ATmega16 microcontroller will send the required control signal to the Quad Triac Driver to turn on and off appliances and it will send status of the appliance to PC also(status of each appliance will be displayed in PC).
Here, we will use one key of the keyboard to control one appliance. Same key will be used to turn on and off the appliance. Each time we press the same key, the appliance changes its status. So, for four appliances, we will use 4 keys of the keyboard. Apart from these 4 keys, we will use 2 more keys to turn on and off all appliances at a time. Now, press different keys from the PC and control the appliances as you want.