2
\$\begingroup\$

I am trying to connect an OMRON G2RL-2A DPST 12 VDC relay (G2RL relay datasheet) to my PICAXE 20x2 microcontroller. I also have a ULN2803A relay driver (ULN2803A datasheet).

I managed to get the microcontroller to work quite well, so I don't have a problem with it.

The question is this: The ULN2803 does not have a V+ pin, so does that mean it does not require power? It only has a GND pin, which I believe should be connected to a GND (probably the GND of the microcontroller?)

Now, I think I have to connect an output of the PICAXE 20x2 to an input of ULN2803. After this, where should I connect the respective output of the ULN2803 on the relay?

Also do I have to use a 12 VDC power for my relay? Or maybe I can use the same 5 V power of my microcontroller? If not, where should I connect this 12 V on the relay?

Sorry for total noob questions, I hope you can guide me.

UPDATE

I can not still make this circuit to work properly. Here is the work I have done so far, please have a look. The problem is, if I connect ULN2803 pin 10 to +12 V or GND, the relays either dont work or just lock the current state. Where should I connect ULN2803 pin 10?

enter image description here

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

enter image description here

V+ goes through the relay, into the collector of the darlington pair inside the driver, then down to ground. A second V+ connection to pin 10 acts as a 'flywheel' diode to stop back-emf.

Connect GND to ground (anywhere), one of the outputs to the relay, and the other side of the relay to +12V.

The logic '1' signal is enough to power the base of the darlington pair to turn it on/off. It needs no power supply of its own.

Here is the circuit built on breadboard. The connectors along the top are:

  • Black: Common ground
  • Yellow: +5V
  • Blue: +3.3V
  • Green: +12V
  • Red: -12V

enter image description here

\$\endgroup\$
10
  • \$\begingroup\$ @Matt this didn't work for me, only worked when I connected the ground of my 12V adapter to ground of my 5V microcontroller chip also COM of the unl2803a to the GND of 5V source. \$\endgroup\$
    – Dumbo
    Commented Jun 26, 2011 at 0:14
  • 1
    \$\begingroup\$ The grounds of your 5V and 12V circuits will need to be commoned, yes. \$\endgroup\$
    – Majenko
    Commented Jun 26, 2011 at 8:30
  • \$\begingroup\$ @Matt but when I connect pin10 of unl2803 to +12V it stops working. \$\endgroup\$
    – Dumbo
    Commented Jun 26, 2011 at 14:46
  • \$\begingroup\$ I have just built this circuit on breadboard. Like this: Pin 1 - to button. Button to +5V. Pin 18 to relay. Relay to +12V. Pin 10 to +12V. Pin 9 to 5v's ground and to 12v's ground. Press the button, the relay turns on. Also works replacing 5V with 3.3V \$\endgroup\$
    – Majenko
    Commented Jun 26, 2011 at 15:40
  • \$\begingroup\$ If you link pin 10 to +5V the relay seems to lock on when triggered. Not desirable operation... \$\endgroup\$
    – Majenko
    Commented Jun 26, 2011 at 16:25
2
\$\begingroup\$

What the ULN2803 consists of is basically a series of transistors, with their collectors being the outputs. If you would use a transistor it wouldn't be connected to V+ either.
Connect the relay between the output (collector) and V+(12V, that's your relay type). Don't forget to connect the COM pin of the ULN2803 to V+ as well. This way you'll connect the integrated flyback diodes parallel to the relay. Since it's integrated you don't need to add a separate flyback diode like you would when you would use a discrete transistor.

If you don't have +12V, but only +5V you may want another relay, made for this supply voltage.

\$\endgroup\$
4
  • \$\begingroup\$ @Stevenh thanks, but what should I do with GND wire of my 12V adapter? \$\endgroup\$
    – Dumbo
    Commented Jun 26, 2011 at 0:11
  • \$\begingroup\$ @Sean87 - You connect it to the ground of your controller and the GND pin of the ULN2803. The relays don't need it; if they are switched on the transistors in the 2803 will connect them to its GND pin. \$\endgroup\$
    – stevenvh
    Commented Jun 26, 2011 at 16:51
  • \$\begingroup\$ Thanks, but it still doesn't work. Would you see the picture I put into the question? \$\endgroup\$
    – Dumbo
    Commented Jun 26, 2011 at 20:45
  • \$\begingroup\$ @Sean87 - You haven't connected pin 10 to +12V. If the red wire which leaves the picture bottom center goes to the PIC's ground it should work. What are the levels at the inputs and outputs of the 2803? Does the relay switch on if you short-circuit the 2803's output to ground (you can safely do this)? \$\endgroup\$
    – stevenvh
    Commented Jun 27, 2011 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.