How to use a 5v DPDT relay with 3.3v (Due)

Hi,

First off ... I am brand new to electronics & Arduino and so I'm just bouncing ideas around inside my head at the moment hoping that they'll work (my understanding should kick in soon as I work my way through my Arduino for dummies book :) )

I'm planning on creating an Android Car PC based off the Udoo Quad (www.udoo.org) which essentially has an Arduino Due stuck on top.

What I'd like to do (and need help with) is be able to control which of two audio sources is passed through to the car's aux input (either audio from the Udoo or from a bluetooth handsfree). Both inputs and the output will be 3.5mm audio line-level, so from what I understand, I can just use a DPDT relay to switch between input 1 and 2. Basically - the same as http://solderintheveins.co.uk/2009/12/simple-audio-switch/. Using the Android ADK, it'd just be setting the control pin to be HIGH/LOW depending which source I want (that's the easy bit!).

However ..... the above solution assumes a 5v circuit ... but the Due only has 3.3v coming from the pins and so the relay would never trigger - so how can I get the 5v relay to work with my Due?

Once again, sorry for the nooby description, I'm learning as I go :)

Thanks in advance! Mike

If you have 5V available elsewhere in your system, an NPN transistor and a resistor of 200 ohms or so between the Due's output and the base will do it. Connect the Emitter to 0V, the collector to one side of the relay and the relay to 5V. Be sure to use a freewheeling diode across the relay coil to protect the transistor.

While it's simple enough... it begs the question why?

In order to energize the relay it will cost you power, it's also bulky and not solid state and of course one day it will fail...

A mux or a bi-lateral chip would give you flexibility of several inputs, requires very little power, much less likely to fail, can be driven (I'll have to check to be sure) from 3v?. It's also silent, cheaper to buy...

While it's simple enough... it begs the question why?

The "why" is because the OP is switching AUDIO signals on something we know little about (such as voltage swing, impedences, etc). Some solid state switches will even inject offsets, leakage and possibly even switcher noise. You certainly don't want that in your audio system. Also much simpler for a newbie to tackle.

It also wasn't his question. You DO need to select the right relay for the job though, choose one with "low level" contacts designed for small signals. Don't use a 30A relay with silver oxide contacts that can tarnish and need a minimum current.