I just want to ask how can i make a relay for my electromagnetic lock which operates using 12V source by providing 5V source only using a signal from PIC16F84A microcontroller. Thank you very much in advance.
I just want to ask how can i make a relay for my electromagnetic lock which operates using 12V source by providing 5V source only using a signal from PIC16F84A microcontroller. Thank you very much in advance.
https://www.rev-ed.co.uk/docs/picaxe_manual3.pdf PICAXE is just a PIC with some built-in software.
Look at page 7. "pin" is from yuor PIC'c output. Either a transistor/resistor (first example) or a logic-level power MOSFET (second example) will work. For your circuit, the +5V or +6v shown in the examples would be +12V. Don't forget the diode across the relay's coil.
Well, the Picaxe manual is wrong (again). The IRF530 part is not a logic level device so it will only partially turn on at 5 volts. It needs more than the PIC can provide to fully turn on. An IRL520 is a logic level part made to work with things like PICs. Note that it will only handle 9 amps as opposed to the 14 for the 530 part if you could turn it on.
If your lock solenoid consumes less than 9 amps, you won't need a relay. Let the MOSFET switch it on and off.