Relay help

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Relay help

Postby rwigs » Tue May 22, 2012 2:11 pm

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

Postby philba » Tue May 22, 2012 4:01 pm

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

Postby rwigs » Tue May 22, 2012 4:17 pm

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

Postby adafruit_support_mike » Tue May 22, 2012 7:09 pm

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.
User avatar
adafruit_support_mike
 
Posts: 1418
Joined: Thu Feb 11, 2010 1:51 pm

Re: Relay help

Postby rwigs » Wed May 23, 2012 12:45 pm

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


Return to General Project help

Who is online

Users browsing this forum: mibignistinly, Zener and 8 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [108]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
Android[6]
 
BeagleBone[24]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[34]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]