## Relay help

General project help for Adafruit customers

### Relay help

Here is what I am trying to do. I have two batteries, both 12V 12AH. I want to setup an electronic voltmeter (part number 460) to show me the voltage for battery A, battery B, or both A&B. I want to cycle through the 3 settings using a button on arduino board. My thought is that I need a relay to cycle through them, but I cannot figure it out.

I am new to all this, so can someone who knows more than me let me know what I need to do?

Thanks!
rwigs

Posts: 5
Joined: Wed Apr 25, 2012 11:52 am

### Re: Relay help

Maybe the easiest way to do this is with a 3 way rotary switch that simply switches the input to the voltmeter. You can get them for <\$5. No arduino needed at all.

Though, I don't understand what it means to measure A&B. In series?
philba

Posts: 387
Joined: Mon Dec 19, 2011 5:59 pm

### Re: Relay help

Yes, A&B are the two batteries in series. So if both the batteries are fully charged I would see 12V on A, 12V on B, and 24V on A&B.

I could do it with the rotary switch, and I can think of several reasons to do it that way, but I want to figure out how to do it with relays.
rwigs

Posts: 5
Joined: Wed Apr 25, 2012 11:52 am

### Re: Relay help

The basic solution would be to wire three paths to the points you want.. GND to the top of A, GND to the top of B, and top of A to the top of B.. insert the VOM, then add relays to keep the paths separate.

You'll need at least four relays to do it: one between GND and the bottom of the VOM (relay_1), one between the top of A and the bottom of the VOM (relay_2), one between the top of A and the top of the VOM (relay_3), and one between the top of B and the top of the VOM (relay_4).

To get the readings you want, you'll open and close pairs of relays to get the paths you want.. relay_1 & relay_3 will give you the voltage across A. relay_2 and relay_4 will give you the voltage across B. relay_1 and relay_4 will give you the voltage across A & B. Be sure to open all four relays between readings though, because you really don't want to short the top and bottom of a battery together.

You can get the same effect with a lot less power using transistors.. a relay can use up to 500mA to drive its coil.

Ideally, you'd want a couple of N-mosfets where relay_1 and relay_2 go (Q1 & Q2), and a couple of P-mosfets where relay_3 and relay_4 go (Q3 & Q4). You could also use NPN and PNP bipolar junction transistors, but those use slightly more power. The control signals would be a bit different since N-type transistors want positive voltage, while P-type transistors want negative voltage. The "everything off" signal would be Q1 & Q2 at GND, Q3 at or above the top of A, and Q4 at the top of B. To read the voltage across battery A, you'd send Q1 high and Q3 to low. For battery B, you'd send Q2 (a volt or two higher than the top of A) and Q4 to GND. For A&B, you'd send Q1 high and Q4 low.

In all cases, you'd want a resistor (about 10k) connected to the control leg of the transistor (gate for a mosfet, base for a BJT), with 'low' meaning 'GND' and 'high' meaning 'top of B'.

With mosfets, your driving current would essentially be zero.. a few nanoamps to charge and discharge the gate, and maybe a few picoamps of leakage current while the signal remained stable. With BJTs, you'd spend a few hundred microamps (assuming a 10k base resistor) holding the base open enough for a high-impedance VOM to get a reading.
When you void a product warrany, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

Posts: 1418
Joined: Thu Feb 11, 2010 1:51 pm

### Re: Relay help

Thanks for the input!

I got it working last night using two relays, a single pole and a double pole. By default it shows the voltage of both batteries. If I send signal to relay A it shows only battery A. If I send signal to relay B it shows only battery B.

Working great right now.
rwigs

Posts: 5
Joined: Wed Apr 25, 2012 11:52 am

### Who is online

Users browsing this forum: mibignistinly, Zener and 8 guests