switches / latches / mosfets or any ideas?
Reach
Posts: 107
I am working on a project that uses the propeller in a marine environment with the use of about 30 rocker switches.
I have to keep cost low.
I tried to located a rocker switch that worked both manually and electronically but they were expensive and large. Someone suggested automotive door locks as an option. I did locate one that had a remote turn "off" but not "on".
latching relays would also work but these seem expensive (30 Amp max at 16 V.max SPST) at around $30 each = $900 bucks.
Is there a very efficient circuit that I can study to replace the rocker switches using Mosfets that somehow operate as a latching relay? I could use very basic high side circuit but this consumes a lot of power over the span of a year.
I even considered piezo switches but cost is a factor again..
Any help is appreciated.
I have to keep cost low.
I tried to located a rocker switch that worked both manually and electronically but they were expensive and large. Someone suggested automotive door locks as an option. I did locate one that had a remote turn "off" but not "on".
latching relays would also work but these seem expensive (30 Amp max at 16 V.max SPST) at around $30 each = $900 bucks.
Is there a very efficient circuit that I can study to replace the rocker switches using Mosfets that somehow operate as a latching relay? I could use very basic high side circuit but this consumes a lot of power over the span of a year.
I even considered piezo switches but cost is a factor again..
Any help is appreciated.
Comments
At times, one has to tell the customer that the right solution is expensive. If they can't afford it, they are not really serious. Sure, you can do a lot of alternative solutions as a prototype, but it won't hold up under severe conditions. There are some rather large SSRs for DC these days as well as MOSfets.
Is all the switching going to be in a sheltered location? Is there a way to consolidate the 30 switches into something less?
One might locate a surplus source for the latching relays.
How fast or often is each relay or MOSFET switched?
Duane J
Can you share some more details of the project? You say 30 rocker switches....does that mean 30 loads being driven by the latching relays/MOSFET, etc? Could the 30 switches be replaced by a touchscreen?
Why does the switch have to be "manually and electronically" operated? Why latching? presumably the Prop has to stay powered up so some amount of power is available; is it limited by being a battery source?
As for latching, you can use a standard relay by using one of its contacts to "seal-in" and transistor to give the means to reset it. It will consume a small amount of power to hold in but will be low cost. This method also gives the added benefit of being able to be operated whether the Prop is running by using small, sealed push-buttons for energizing or resetting.
Cheers,
Here is a schematic snippet of a latched MOSFET circuit.
1. Momentary ON and OFF switches.
2. Digital ON and OFF inputs.
Probably doesn't switch real fast but fast enough for occasional load switching.
Duane J
Once you start to add a regulator and a MOSFET driver circuit things get complicated.
The MOSFET SR Flip-Flop has nearly zero current draw when OFF and only 240uA when ON.
Of course that is immaterial as the load would dominate the ON current.
The 2N7000s have 20V gates but since this is only a schematic snippet some of the details may be missing. I probably should have added the pair of gate protection zeners and resistor or use a MOSFET with a higher gate voltage spec. This can survive the 60 plus voltage in these applications.
I added these parts so here is the better schematic snippet which should easily take 60V peak power line spikes.
And more peak voltage with higher voltage parts.
Duane J
If the situation isn't that dire, workarounds are possible. 30 switches seems like a huge console for anyone to be monitoring.
++++++++++
Yes a CD4000 series would work... but all latching positions are lost if power to the chip's power source goes down. The power to the logic is Mission Critical.. maybe its own Lithium ion backup supply.
But if you are going to use logic chips, 'The Art of Electronics' discusses the pros and cons of all the different logic choices. Personally, I think in an automotive environment, having solid state switching should be tolerant of spikes to 80 or 100 VDC, and that 20VDC is overly optimistic.
And these days, you AC and DC Solid State Relays that will take anywhere from 3 to 32 volts DC as an input. So I suspect the use of logic chips indicates that you might as well use 3.3 volt or 5.0 volt logical latches and have the switches configured for preventing bounce. The outputs are all going to be isolated anyway and can be a mixture of AC and DC at a variety of voltages.
pull-down currents during button-pushes. CR2032's?
Protecting against marine conditions is difficult, most insulated wire is inadequate, silicone insulation is pretty
much a requirement for anything to be reliable long term. Potting in epoxy or silicone seems a good plan - once
thoroughly tested
Time to rewatch "Das Boot" I think...
-Phil
frustration is an understatement.
It sounds like you are looking for a solenoid operated switch? If so try Schmersal for ideas. They are expensive but you can cross reference to Banner or other brands and maybe find what you need. Most switches of this type are designed for safety circuits which of course adds cost. But maybe looking at them will spark some ideas. Good luck!
Well with a S-R latch configuration, you can use a momentary rocker from any source. And a company like Microswitch may have a good sealed unit for marine applications. But the darned salt does get into everything. Craftsmanship is of the utmost importance.
It seem that there are two ways to go --- A quad latch chip of some sort or individual gates. Here is a link for the individual gate solution. It certainly does help if these require extremely low power to retain a latch. There are some nice 3.7 lithium cells that could provide a stable backup in one cell for long periods of time.
http://www.dummies.com/how-to/content/electronics-projects-how-to-build-a-latch-circuit.html
Having been a general contractor, I understand how 'customers' can be so adamant about prices being too high. But there are huge regrets and feeling of shame for having caved in and delivering something that creates a situation where you have unsatisfied customers running around and blaming you for the loss of their sailboat.
Cutting too many corners can easily result in nobody being happy. If you do solder your own boards, neutralize all the flux after soldering and before coating with any epoxy. I think that you can do a wash with baking soda to do so.
Consider having a warning for a dying battery. For a 3.7 volt Lithium system, you might not require any voltage regulation. You might even sustain a trickle charge of some sort. And a low voltage warning of 3.0 volts or less might work nicely.
By using logic chips instead of discrete MOSfets, you might make it all easier to build AND you can add some useful features -- such as a group Reset for a bank of switches, or a group Default for the same, or even Both.
In the early days, there were a lot of nice fancy hall-effect switches for uProcessors, but they seem to have entirely disappeared. The hall-effect switches required a power input as well as the switching connections, and are now only seen in large production run consumer products.
Microswitch used to have a nice line of them, but it seems discontinued. Thus are the fortunes of economic downturns and maturing technology. You can get nice tiny hall-effect sensors, but you have to build your own switch around them.
Actually, a toggle switch might be less prone to salt invasion than a rocker.
The jamed-latch approach is recommended for debouncing in The Art of Electronics, but I can't see how it plays nice with sharing the switching with a Propeller. Driving all and everything at 3.3 volts means you can use AND and OR gates to share and over-ride the physical switches if the physical switches provide momentary pulses.
Having LEDs to indicate which setting is active for all momentary switches will work as good as seeing a physical position of a rocker.
Here is a link with Figure 1 showing what I am referring to. They just call it an SR debouncer, but the swtich has to have one or the other input to ground --- thus it is called 'jammed'.
There are other latches that might be more suitable for momentary contact... Maybe having to press an INPUT button along with the actual toggle so that the latch is set. (maybe the CD4042 Quad Clocked D latch for this alternative... not sure)
http://www.ganssle.com/debouncing-pt2.htm
Do all the circuits require 30 Amp service?
http://www.ebay.com/bhp/60-amp-relay-12v
http://www.ozautoelectrics.com/relays.html
I have been trying to select between RS latches, JK latches, D latches, T-latches, and Master-slave latches. So far, my mind has flip-flopped so much that I can't think.
I believe Electronic Goldmine has in bulk 9 volt latching relays that take two inputs - one for setting each direction... not the one input toggle type. And there has been some claims that even 3.3volts will pulse 5 volt ones.
If you are doubtful, just insert a UNL2803 to boost the Propeller i/o to 9 volt pulses.
http://www.goldmine-elec-products.com/products.asp?dept=1117
Having LEDs indicate what is active is another issue. They might have to go on the output side of the latching relays and accommodate the 9 volts voltage is driving the final stage of heavy amp relays. DPDT latching relays allow one pole for power switching and another pole to light indicator LEDS.
Or all LED indicators can be both on the interim relay outputs and redundant on the final stage to track failures of critical relays in real-time.
The big benefit is that the heavy amp relays can be socketed and easily replaced quickly if there is a need to do so. They can also be set below decks and out of the weather. Less lengths of heavy wire going long distances.
Having said that, they all seem to have a different output sides for DC and AC... unlike a mechanical relay that will accept either. They also seem to only be SPST devices and need to be ganged to build more complex switching logic.
And at higher power ratings, you may have to add a big heat sink. These get so big that a mechanical relay often has a smaller foot print and less of a problem with heat that requires isolation from other things in tight spaces.
In sum, I am convinced that mechanical relays are here to stay. Under a dashboard, on a boat, or in a submarine -- they just fit in better.
If you want DC current to pass nicely in both directions with a solid state device, I suspect you will have to build your own with power MOSfets.
- Triac based AC only. This is the type usually referred to as an "SSR".
- Single transisitor based DC only.
- and dual MOSFET, "Bilateral switch", can handle both AC and DC but usually has to compromise on either voltage or current.
My question is do you need a non-powered latch like a rocker switch? Can't the micro just remember the last state and use buttons/touchscreen instead?
The is more about technology abandoning catering to ergonomic user interfaces that about what is possible. The lowly switch isolates a failure to that switch. A touchscreen centralizes failures to a complete shut out of the user interface.
Which would you rather have on your personal nuclear reactor. A touch screen console, or a banked switch console?
I've never been a great fan of solid state relays. Not since I installed one on an outside flouro light and went outside at night when it was supposed to be off and saw the flouro faintly glowing. Nothing beats an old school relay for being definitely off or on.
So the challenge is cost. Latching high current relays are too expensive. Thinking about the logic, if the high current relay is on, then it is passing high current, so then the current used to keep that relay on is insignificant compared to the current it is switching. I think this leads to thinking that a cheaper solution would be a very small and cheap low current latching relay, that then drives a high current standard relay. That has to save on costs, as high current (eg 12V automotive) standard relays are much cheaper than latching ones.
I'm not sure about the override conditions. Say I want the searchlight on, but the computer decides it has to be off? Who overrides who?
Leaving that aside for a moment, consider a small low current latching relay that can be bought for a $1 or so (Erco will find one for you!). For simplicity, go for one with two separate coils - an on coil, and an off coil.
The circuit on each coil is the same. A momentary switch, and a transistor driving by a microprocessor (eg propeller). So either the momentary manual switch or the propeller can turn the latching relay on. Duplicate this for the off coil.
If the latching relay is on, it turns on a standard high current relay.
So ok, it is not a rocker switch, but the manual part is two momentary contact switches. They are cheap and there are lots of weatherprooof versions.
Inside your IP66 case http://en.wikipedia.org/wiki/IP_Code (you might go even higher than that for a marine environment) you can build standard electronics without worrying about salt. Indicator LEDs etc are all weatherproof.
If you don't like using two momentary contact switches, you could use a center-off toggle with a spring return to center. These are available weatherproof if you want.
For total manual override, just add a power switch for the microprocessor and simply turn the micro off. Then it is all manual.
I think you would still need indicator leds. You could have green for "off" and red for "on". Alternatively, if the current drain of an "off state" led is too high, you could just have a red led that lights when the circuit is on. Again, the logic is that if a circuit is on, the 20mA the led is drawing is insignificant compared to the 30A it is switching.
So the circuit per switch might be one momentary 3 position toggle switch, one led+resistor, one small low current latching relay, one high current relay and a couple of transistors for the micro control.
I presume that the optimal configuration is to allow for microcontroller control, but with a complete manual shut out in dire situations.
Looking at how to set this up with 9vdc latching relays from Electronic Goldmine, it would seem that a bank of 4 latching relays with a UNL2803 converting logic level inputs to drive the 9vdc requirement would be optimal.
Each latching relay has two inputs.. each is a specific position. So a 4 relay bank would require 8 i/o pins on the Propeller. For 32 of these relays, a i/o expansion scheme of some sort would be necessary. But I suspect that is not a key issue.
Each relay input could be driven by an XOR that allows a momentary switch or a Propeller pulse to drive it. There are Quad XOR chips and 4 of these would be required for a bank of 4 latching relays.
On the Propeller side of the XOR inputs, their could be an 8 bit Tri-state bus driver that would lock out the Propeller inputs when desired, leaving the operator with a manual console without automation interference. Another 8 bit Tri-state bus driver could also shut out the manual switches if that is a requirement for the Propeller driven mode and a set up to toggle the two could created.
Status LEDs could be provided, and there could be status bits generated in parallel to be read by the Propeller. But again, this requires more i/o pins that the Propeller has.. so a parallel to serial chip is likely to expand the i/o.
~~~~~~~~~~~~~~~~~~~
The main thing is there is a cost effective way to do this with a mix of logic, bus drivers, darlington pair drivers, momentary rocker switches, LEDs and cheaper latching relays. All the wiring in the console would be relatively low power and the 30amp relays would be as near as possible to the device that requires their switching. if something absolutely would not turn on or shut off, there could be an appropriate shut out switch with manual override next to each high power relay.
Using automotive relays for the heavy power would likely mean better availability of replacement parts in any port of call.
So it isn't so much that it can't be done. It is mostly important to make it in banks of 4 relays, so that failure might be resolve by swapping out a board with a spare. With 32 circuits, you would have 8 boards in operation at any one time and you might care a couple of spares for emergencies... and a kit of extra latching relays and components to repair any board that is pulled.
Also, having overrides placed at each potential point of failure allows quick recovery from a crisis via immediate damage control. Repairs can follow after the crisis period has passed by.
For propeller operation:The '595 will have a single 1 or 0 shifted to the desired circuit location via S-Clk, latched to the output register via R-Clk, then OE will be pulsed with a duration long enough to ensure the relay operates. After the pulse the '595 output is tri-stated. The toggle switch may be used anytime to over-ride the propeller without the need to disable the propeller. In the event that the Propeller goes beserk (nearby lightning strike) an emergency cut-off switch to remove power from the Propeller and '595's will prevent unwanted operations. The switches will still have full control.
As Loopy has suggested above, make 8 small identical boards to operate 4 circuits each, with several spare boards for repairs.
An indicator LED can be placed by each switch, connected to the load contacts of the latching relay to show which circuit is active, regardless whether by Propeller or switch. The small relay can operate automotive type relays and can probably be used even for AC loads as long as the relay contacts are isolated from the coil, such as a four-pin relay.
The final power switching relays can be a mix of anything that works well and either driven at 12 or 24 VDC or both. If one really needs good AC mains relays, they are available on a DIN rail socket. But the automotive relays are in some cases intended to sit in the engine compartment with heat, grime, and moisture.
http://www.labbookpages.co.uk/electronics/debounce.html
There seems to be too little to go on as you haven't really described their use and why rocker switches are specified, but for some reason you mention MOSFETs as if there was a connection. Are these switches handling large amounts of current, are they operating mains voltage AC?
Why can't you just use 30 push buttons (perhaps in a 8x4 matrix) with LED indicators that are read by a small micro or the Prop and have the state maintained in EEPROM. Assuming low voltage high current loads you would need 30 MOSFETs to switch the loads perhaps driven from shift registers. You could even build this all into a mimic panel for the boat. Avoid any thought of mechanically locking rocker switches with actuators, they would be prohibitively expensive even if you could get them and they would be so 1950's.
8x4 matrix for the buttons = 12 I/O
clock, data, strobe for the shift registers = 3 I/O
LEDs and MOSFETs would be driven from the shift registers