You are here: Home
if you are using 6v /12v/ or more volts motor then u can control this through your microcontroller .which gives only 5v and less current.
Advantages of relays: Relays can switch AC and DC, transistors can only switch DC. Relays can switch high voltages, transistors cannot. Relays are a better choice for switching large currents (> 5A). Relays can switch many contacts at once.
if you are using Keil micro vision
then try this code
#include<reg51.h>
#define lcd_data_port P2
sbit rs=P1^0;
sbit rw=P1^1;//better to connect to ground and disable this pin
sbit en=P1^2;
void lcd_cmd(unsigned short temp);
void lcd_data(unsigned short temp);
void delay(unsigned int msec);
void main()
{
lcd_cmd(0x38);
lcd_cmd(0x06);
lcd_cmd(0x0e);
lcd_data(‘A’);
delay(5);
lcd_data(‘B’);
}
void lcd_cmd(unsigned short temp)
{
lcd_data_port=temp;
rs=0;
rw=0;
en=1;
delay(2);
en=0;
}
void lcd_data(unsigned short temp)
{
lcd_data_port=temp;
rs=1;
rw=0;
en=1;
delay(2);
en=0;
}
void delay(unsigned int msec)
{
unsigned int i,j;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
i dont want to use microcontroller..
when the key is pressed the LED should be on for 10 sec/20 sec then it should be off though key is pressed.
input voltage is 12v.
i know i can control through programming using microcontroller but to save the cost i want todesign using timers/any other component.