Replacing 1930's relays

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Hi Br,
I was thinking last night that these days we seem to have to have a lot more to do the same thing that two seemingly simple relays used to do.
If I could find relays that could handle the 32v I'd put them in.
In their absence Mike has come up with a reasonably simple approach (not the arduino).

I've not heard of magnetic amplifiers...

Cheers
Chris
 

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Here is a hack at it:

Plot shows relay coil current vs load current. Using a 24Vdc relay (almost any will do). The relay is energized when the load current exceeds the trip point. Trip point is adjustable (using R2, and must be adjusted to compensate for the actual Vt of M1) as needed. Plot shows what happens as R2 goes from 200K to 250K in steps of 10K. R2 could be replaced with a ~160K fixed resistor in-series with a 100K trim pot.

R4 drops the battery voltage from ~32V to 24V for the relay. R4 should be 0.3*Rcoil, where Rcoil is the coil resistance of the relay.

Standby current (Relay not energized) from the battery is 1.2mA.

Circuit is virtually immune to changes in temperature, and variation of the battery bank from 30V to 37V.

View attachment 90576
Mike, I just wanted to check...
The relay has a coil resistance of 1600 ohms, so R4 should be 480, correct?
 

MikeML

Joined Oct 2, 2009
5,444
470Ω (std. value is close enough)

In revisiting the schematic in post #13, I noticed that a couple of changes are needed: First, the part number of the high-side current sense chip is INA169 (not INA168). Second, if the voltage on the V+pin 5 is only 5V, then the gate voltage at the FET could only go to 5V. Even though it would have worked with a 5V Zener, changing it to a higher voltage makes it so that the circuit has a lot more headroom. Here it is again:

cs.gif

R2 could be a 150KΩ in series with a 100KΩ trimpot.

Here it is about half built for you. You might be able to get it from an Aussie Arduino dealer.
 
Last edited:

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Mike, I can't find this listed for sale here, but they will ship to me regardless.
I went back over the older posts and when I thought about other stages of the project and functions I need, some are as you mentioned in the post about Arduino.
I've looked into this a bit further after reading the info/tutorial on the Sparksfun site (very informative ) and it seems it is the smartest way to go.
You're probably shaking your head by now... do you know much about Arduino, or just getting about getting it tied into the functions I need?

I found a solid state dc/dc relay that can operate from as low as 3v and switch up to 80v so I bought it.
Obviously I still need some of your design for the shunt and dropping the voltage down...

Your thoughts?

Cheers
Chris
 

MikeML

Joined Oct 2, 2009
5,444
I have extensive experience with micro-controllers, from MicroChip PIC up to Analog and TI DSPs, so when Arduino came along, I got one and tried it. It is a good platform for non-time critical applications, with a short learning curve, lots of examples on how to do things, lots of pre-made sensors and and actuators for robotics.

The most complex project I have done using an Arduino is a motorized drive-through swing gate controller. It has lots of features, like PWM speed control of the motor, slow acceleration, de-acceleration, limit switches, obstacle and stall detection, wireless control, battery back-up, electronic locking, etc.

Using software to control a physical process like open-closing a gate or monitoring a battery bank and starting/stopping a generator is much more flexible than trying to do the same job with dedicated circuits. There are always things you dont learn about the system you are controlling until you try to run it. With a software controller, you can add these features after-the-fact much easier than a pure hardware controller.
 

BR-549

Joined Sep 22, 2013
4,928
Chris, interesting situation. So you are going to use the 32 V system.

Are these phone company batteries? i.e....individual cells?

What is the length and conductor size for this light string?

How many bulbs and where do you buy 32 V bulbs? What is the wattage?

If you want something Simple, consider winding a Simple coil.

The coil will be in series with the string. The coil will be wound with same conductor size as the string.

With 7.5 amps and some patients, it shouldn’t take too many turns to close a relay.

I don’t know all the details of your setup, but you might need to find physically large relay to wind on.

If you really have 16, 2 V, 1000 ah cells in series, I would consider a processor controlled 220 V inverter.

The processor could also monitor the individual cells.

You must have a lot of lights.

With processor control, you can poll the processor wirelessly anytime and see the voltage at your house. Or even on your phone if you are so inclined.

You’re a lucky fellow. Great power source.
 

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
I have extensive experience with micro-controllers, from MicroChip PIC up to Analog and TI DSPs, so when Arduino came along, I got one and tried it. It is a good platform for non-time critical applications, with a short learning curve, lots of examples on how to do things, lots of pre-made sensors and and actuators for robotics.

The most complex project I have done using an Arduino is a motorized drive-through swing gate controller. It has lots of features, like PWM speed control of the motor, slow acceleration, de-acceleration, limit switches, obstacle and stall detection, wireless control, battery back-up, electronic locking, etc.

Using software to control a physical process like open-closing a gate or monitoring a battery bank and starting/stopping a generator is much more flexible than trying to do the same job with dedicated circuits. There are always things you dont learn about the system you are controlling until you try to run it. With a software controller, you can add these features after-the-fact much easier than a pure hardware controller.
Mike, is the Arduino Uno R3 sufficient to control the processes I'm looking at or do I need the larger version with more inputs? (Starting we already know, but also stopping at full charge, temp sensing for choking and also cooling tank, possibly low water level as well)
This a copy of the Uno.
http://www.jaycar.com.au/PRODUCTS/K...-Programming/DuinoTECH-Classic-(UNO)/p/XC4410

This is a larger version
http://www.jaycar.com.au/PRODUCTS/K...omputer-&-Programming/DuinoTECH-Mega/p/XC4420
 

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Chris, interesting situation. So you are going to use the 32 V system.

Are these phone company batteries? i.e....individual cells?
Yes, individual cells. I actually have a 32v bank and two 24v banks as well
What is the length and conductor size for this light string?
2 circuits of about 15 m not sure of wire size
How many bulbs and where do you buy 32 V bulbs? What is the wattage?
8 bulbs at the moment. Still available here, but not cheap. 60w
If you want something Simple, consider winding a Simple coil.

The coil will be in series with the string. The coil will be wound with same conductor size as the string.

With 7.5 amps and some patients, it shouldn’t take too many turns to close a relay.

I don’t know all the details of your setup, but you might need to find physically large relay to wind on.

If you really have 16, 2 V, 1000 ah cells in series, I would consider a processor controlled 220 V inverter.

The processor could also monitor the individual cells.

You must have a lot of lights.

With processor control, you can poll the processor wirelessly anytime and see the voltage at your house. Or even on your phone if you are so inclined.

You’re a lucky fellow. Great power source.
 

MikeML

Joined Oct 2, 2009
5,444
I think that Uno is adequate to get you started. I develop on an Uno, but when my project is working, I migrated it to one of these.

The mini is pin-for-pin and code compatible with the UNO; all that is missing is the USB interface, for which I use one of these, which is unplugged after the project is running.
 

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Mike, in that case, if you're happy to continue to advise me, I'll source a Uno and the current sensor and take that path.
Any recommendations on books to learn the programming? There are a couple I've come across but not sure which is better...

Cheers
Chris
 

MikeML

Joined Oct 2, 2009
5,444
Mike, in that case, if you're happy to continue to advise me, I'll source a Uno and the current sensor and take that path.
Any recommendations on books to learn the programming? There are a couple I've come across but not sure which is better...

Cheers
Chris
Lets do it.

I would use the official Arduino Tutorial page to get started. Work through the section 1 Basics. Pay particular attention to the one called AnalogReadSerial. This code example (sketch=stupid name) contains 90% of your first program to read the current sensor. All that is missing is to compare the current numerical value to some threshold, and do something involving changing the state of a digital port pin to ultimately start the genny.

Work through these tutorials when you get your boards..., especially Tutorial #1, which helps you to install the software on your PC.

Here is the most important link I will give you today. I have it bookmarked, because I use it all the time. It is the Language Reference.
 
Last edited:

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Mike, plenty of reading and so far it seems to be straight forward.
Can you tell me what you think of this item number 301642149221 on ebay au.
I realize it's a mega and more than the uno, but it's cheap still and I'd rather have more than is necessary in case of future changes.

Cheers,
Chris
(Btw- current sensor is ordered)
 

MikeML

Joined Oct 2, 2009
5,444
Should work, as long as no one mentions USB problems in feedback. Check the reviews for the same part on USA Amazon. Get some header strips to plug into the Mega.

This is a clone, and there have been some issues with some Chinese clones using counterfeit FDTI USB interface chips (too cheap to pay the royalty to a US company), so the USB drivers didn't work.

ps. After reading the Mega description, I notice that it doesn't use the FDTI chip set...
 
Last edited:

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Mike,

The Arduino arrived today, software installed and it passed the blink test. Just waiting on the shield from over your way now.
What quantity and configuration of header strips do you suggest? Presumably MM, there are a few options....
Cheers
Chris
 

MikeML

Joined Oct 2, 2009
5,444
I had some long strips in my junk, so I just cut them to match the number of pins required. I didn't use shields for some of my projects, so I soldered wires to the erect pins in the header to run to a proto-board...
 

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Hey Mike,

The current sensor circuit arrived today..

I haven't sourced those pins yet, but other than those, what's next on the to do list?

Cheers Chris
 

MikeML

Joined Oct 2, 2009
5,444
1. Figure out how to power the Mega board independent of the USB. Eventually, you want the Mega to run stand-alone. Likely, this will need a buck converter to reduce the battery voltage to ~9V to be used to power the Mega and its stuff... If there is no commercial power at your installation, initially for testing, power the Mega from a laptop's USB.

2. Interface the current sensor to the Mega, both to power it, and to get its output to one of the Mega's analog inputs.

3. Create a sketch that as a minimum reads the sensor current, sends the readings to the serial monitor, compares the reading to a preset limit and lights the test LED if above the limit. Look at "Analog Read" (like Blink, in the learning section)

4. Cobble some sort of test set up to create a variable test current for the sensor (Variable DC power supply or battery, load resistor or lamp, or power rehostat). Seems like your initial goal is be able to generate test currents of ~6A. You could use the existing battery bank and wiring if you are willing to do the development on site.

5. Do some initial testing to convince yourself that you can select any trip current by changing the numerical value in the software.

6. Add a relay interface to the Mega capable of controlling your generator start circuit. Initially, it will just be stuff like pull in the relay if current>limit. Later, you can add smarts like generator start detection, timing the starting sequence, etc...

7. Plan for other sensing, like interfacing the battery-bank voltage to the Mega, other things, like generator oil pressure, coolant temperature, rpm, fuel level, etc, etc, etc
 
Last edited:

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Mike, bare with me as I try to ask this question...
I need to source a shunt and originally you suggested a 75 mv 10 a shunt. (before the arduino idea came into the picture)
I have been reading the Arduino and Sparkfun tutorials and Sparkfun advise that in standard form, the board can measure up to 35 ma.
How do I work out the output of a shunt (to select the right one) to ensure it fits into the necessary range? (Assuming your original suggestion isn't ok)
Also, should it be of a slightly higher amperage to allow some breathing space (ammeter currently shows 10 a with all the lights on and I miget need to add a couple more).

Cheers
Chris
 

Thread Starter

offthegridshed

Joined Aug 24, 2015
22
Mike, it's been some time since I returned to the project and I have managed to assemble various components for the control circuit in the meantime.
I've been looking at programming examples, but I can't find a code example that limits how long an if statement condition is performed.
I.e if current sensor exceeds threshold, digital write (A0) = high but only for say 5 seconds.

Ideally, once it's executed this for the 5 secs, it needs to stop as by then the engine would have started and I don't need it to keep performing the task once the engine is running.

Can you point me in the right direction?

Cheers
Chris
 
Top