Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help with uln2003a with pic16f84a

Status
Not open for further replies.
Connect:

1. output pin of PIC to input pin of ULN2003
2. output pin of ULN2003 to one side of the relay coil. The other side of the relay coil goes to +6V.
3. the GND (pin 8) of the ULN2003 goes to ground (-ve side of the supply).
4. the Common pin (pin 9) of the ULN2003 goes to the same +6V as the relay.

When you make the PIC pin high, the output of the ULN2003 will go low and 6V will appear across the relay coil to operate it.

Brian.
 

The following link shows how to use an ULN 2083 (The eight NPN Darlington connected transistors array) with a PIC16F84A.

You will get the idea. Your ULN2003A consist of seven npn Darlington pairs.
https://www.edaboard.com/threads/231528/
64411d1321777214-uln2803.png


Relay_Driver_Circuit_using_ULN2003.jpg


you can use ULN 2003 for connecting seven relays or ULN 2803 for connecting eight relays. Above Figure shows how to connect a relay to microcontroller using ULN 2003/ULN 2803. These IC’s are high voltage, high current Darlington transistor arrays with open collector outputs and free-wheeling clamping diodes hence there is no need of a diode across the relay. Also there is no need of the series base resistor as the IC has an internal resistor of 2.7KΩ see more

- - - Updated - - -

(CODE in the first link above)
 
Last edited:

I don't get your point of connecting pull-ups to the processor outputs, except you want to activate the outputs when processor is reset respectively not operating. Usually you want just the opposite, which is achieved by the internal ULN2003 pull-down resistors.

Pull-ups would be required with 8051 open-drain IOs, but not for PIC processors.
 

Here is the source code

Code:
#define RELAY PORTB.F0

void main() {
     TRISB = 0x00;
     PORTB - 0x00;
     while(1) {
              RELAY = 1;
              Delay_ms(3000);
              RELAY = 0;
              Delay_ms(3000);
     }
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top