i want to operate 12 volt relay with 89C51 any idea?
i wrote a program which set HIGH at pin 1.0 , although its working and giving 5 volt but does not turn on 6 volt relay
any idea what to do with this, i have also tried to connect a 2N2222 and also d313 with this pin 1.0 and take output from transistor's emitter pin making collector common but still it dose not work ,any additional circuitry i should made?
no that circuit is not working
you know i lost 3 controller for this
show me your schemetic.
i just make this ckt and it worked pretty fine. i have used the same 89c51 controller.
you just have to use a seprate 12v supply for relay. and it will definitely switch.
here is the code:
org 00h
mov a,#11111111b
again:
mov p1,a
call delay
cpl a
sjmp again
delay:
mov r7,#10
b1: mov r6,#249
a1: mov r5,#200
djnz r5,$
djnz r6, a1
djnz r7,b1
ret
end
for the batteries you have shown in figure a dry batteries and are not rechargable. for charging battries first you have to know abut its chemistry that either it is lead acid type, NiMH, OR NiCd type cells. and then you can develop a charger for it.
look out here:
Battery Charger Circuits | CircuitDiagram.Org
this is my circuit which will connect batterys in series when charger/adapter is not connected and when charger/adapter is connected it will make parallel both batterys and obviously charger both of them by charger connected
View attachment 66307
Hi Zohaibmaroof,
Try to follow one very specific rule,
Before testing any interface with your microcontroller, try your best to test with without microcontroller first, to avoid unnecessary burnout of your precious microcontroller. Confused?
a Microcontroller gives 5V output but current is minimum, Use a simple push button first instead of a microcontroller pin to test the circuit, so try the above circuits to operate a relay by simulating with a push button or a simple wire. be very careful to select a transistor for switching relay, for 12VDC relay 2N2222, BC547, 2SC828, 2SC945 transistors are perfect.
First thing is to select and use a perfect hardware for your project than use your time to program your microcontroller for your required function.
If you get success from push button simulation than it will also work with your microcontroller.
Hi Zohaibmaroof,
Try to follow one very specific rule,
Before testing any interface with your microcontroller, try your best to test with without microcontroller first, to avoid unnecessary burnout of your precious microcontroller. Confused?
a Microcontroller gives 5V output but current is minimum, Use a simple push button first instead of a microcontroller pin to test the circuit, so try the above circuits to operate a relay by simulating with a push button or a simple wire. be very careful to select a transistor for switching relay, for 12VDC relay 2N2222, BC547, 2SC828, 2SC945 transistors are perfect.
First thing is to select and use a perfect hardware for your project than use your time to program your microcontroller for your required function.
If you get success from push button simulation than it will also work with your microcontroller.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?