relay design advice for a beginner - Page 1
Forum section: electronics / beginners

author: BlueSmokedAgain
author_rank: Contributor
timestamp: September 04, 2015, 01:38:44 am
content: Hi all,I am designing a circuit which will high side drive 4 12v relays. I have been looking at the various options and costs of parts, and I came across the A2982. (data sheethttp://www.farnell.com/datasheets/1691044.pdf) I have read the data sheet but not being the most experienced in deciphering these I have a few questions! Firstly a basic schematic is attached below!1) can I connect the Arduino directly to the A2982 input as shown or do I need some sort of resistor? (10K?)2) the relays will also need to be thrown manually via a push button, do I need diode 1? The data sheet seems to indicate the A2982 has diodes built in to protect against reverse voltage?3) the data sheet says any pins not used should be connected to ground, and any which might float when power is applied to VS must be pulled down. So the Arduino will take a moment or two to boot, do the Arduino pins need to be pulled down externally or can I just enable the microchip built in ones via software?4) just to check I haven't got it all wrong, this is a suitable chip for this purpose?Thanks for the advice

author: picandmix
author_rank: Frequent Contributor
timestamp: September 04, 2015, 08:25:17 am
content: You want to use this popular chip which is ready to connect to the Arduino , no extra resistors or diodes needed.As long as you set your ports to output and zero as soon as the Arduino starts then there should be no problem with any momentry highs as the relays need a relativley long time to be swtiched on.http://www.farnell.com/datasheets/1690352.pdf

author: Chris C
author_rank: Frequent Contributor
timestamp: September 04, 2015, 08:50:06 am
content: 1) Directly, no resistor required for either the A2982 or ULN2803A.2) Both the A2982 and ULN2803A can inherently handle reverse voltage, so D1 isn't needed. But you've misinterpreted the function of the internal diode, as it's not what's responsible for blocking reverse voltage. Look closer and you'll see it's connected between the output and ground - same as your D2, and in the same orientation, on both ICs. It's meant to handle inductive kickbacks from relay coils. So technically, D2 isn't strictly necessary either. Though if you're trying to minimize RF noise, or there's a wire longer than a few inches between the IC and the relay, I'd include D2 close to the relay to shorten the path that the inductive kickback has to travel.3) If the datasheet says to tie unused inputs to ground, and add 10K pull-down resistors to used inputs that may not be actively driven (like during MCU startup), then just do it.Even if you find it works without the pull-down, which it probably will under the most circumstances; but shortcuts like these can come back and bite you when you least expect it.4) Both the A2982 and ULN2803A are suitable.

author: BlueSmokedAgain
author_rank: Contributor
timestamp: September 04, 2015, 08:55:05 am
content: Hi picandmix,Thanks for getting back to me!The layout you have shown is pretty much what I want to achieve with the A2982, but I think the ULN2801 chips are for low side switching? I really need to be high side switching these relays.Thanks for the tip on setting all the ports to zero on startup, I shall make sure I do that!Hi Chris C,Thanks also for getting back to me!I'll ditch diode 1 and leave diode 2 then! The wires to it will be almost an inch long. I shall add the 10k resistor also!Thanks for your help!

author: picandmix
author_rank: Frequent Contributor
timestamp: September 04, 2015, 09:04:57 am
content: Quote from: BlueSmokedAgain on September 04, 2015, 08:55:05 amTo what end, over low side ?

author: BlueSmokedAgain
author_rank: Contributor
timestamp: September 04, 2015, 09:40:21 am
content: The relay being powered is the power switch for the project, so initially the relay will be thrown by the button, but then held by the Arduino once it boots for a certain amount of time, before the Arduino releases the relay and turns the project off. It's for a boat where even the smallest amount of current causes corrosion so I want it to be completely isolated from the power when off.But that said you do have a point, if I switch it low side I would be just as isolated from the battery if the relay switch was the last thing before the negative back to the battery? Hmmm maybe I don't have to high side switch it...

author: picandmix
author_rank: Frequent Contributor
timestamp: September 04, 2015, 12:08:18 pm
content: Is that for a model boat or full size sea going craft ?If you want total isolation then you could use a double pole switch and relay as shown, so when off, no power is going to any of the electronic parts, just waiting across the physical gaps of the switch and relay.Also if waterproofing is a factor, then consider using a reed relay and magnet instead of the switch so the electroncs can be totally covered.

author: BlueSmokedAgain
author_rank: Contributor
timestamp: September 06, 2015, 02:13:34 am
content: A full size boatDouble poles relays is a good idea, I shall look into thoseUnfortunately for switches there are some existing ones so I shall just use those to keep the panel matching what is already there