Electronic – Need advice on microcontroller to switch relay on/off

drivermicrocontrollerrelayswitches

I am trying to connect an OMRON G2RL-2A DPST 12 VDC relay (G2RL relay datasheet) to my PICAXE 20×2 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 20×2 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

Best Answer

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