Author Topic: relay design advice for a beginner  (Read 3222 times)

0 Members and 1 Guest are viewing this topic.

Offline BlueSmokedAgainTopic starter

  • Contributor
  • Posts: 12
  • Country: gb
relay design advice for a beginner
« on: September 04, 2015, 01:38:44 am »
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 sheet http://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?  :P

Thanks for the advice
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: relay design advice for a beginner
« Reply #1 on: September 04, 2015, 08:25:17 am »
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

« Last Edit: September 04, 2015, 08:37:17 am by picandmix »
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: relay design advice for a beginner
« Reply #2 on: September 04, 2015, 08:50:06 am »
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.
 

Offline BlueSmokedAgainTopic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: relay design advice for a beginner
« Reply #3 on: September 04, 2015, 08:55:05 am »
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!
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: relay design advice for a beginner
« Reply #4 on: September 04, 2015, 09:04:57 am »
I really need to be high side switching these relays.



To what end,  over low side ?
 

Offline BlueSmokedAgainTopic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: relay design advice for a beginner
« Reply #5 on: September 04, 2015, 09:40:21 am »
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...
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: relay design advice for a beginner
« Reply #6 on: September 04, 2015, 12:08:18 pm »
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.
 

Offline BlueSmokedAgainTopic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: relay design advice for a beginner
« Reply #7 on: September 06, 2015, 02:13:34 am »
A full size boat :)
Double poles relays is a good idea, I shall look into those :) Unfortunately for switches there are some existing ones so I shall just use those to keep the panel matching what is already there :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf