Shop OBEX P1 Docs P2 Docs Learn Events
switches / latches / mosfets or any ideas? — Parallax Forums

switches / latches / mosfets or any ideas?

ReachReach Posts: 107
edited 2014-02-01 06:15 in General Discussion
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.
«1

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-24 10:58
    If it is high amperage switching, I suspect that latching relays are worth the cost. A marine environment is one of the most unforgiving for electricity. The advantage of the latching relay is that the actual physical switches can be waterproof momentary contact switches. You spend a lot for the relays, but you save a lot on the switches, and the heavy duty wiring can be well isolated from seawater and the elements. In an emergency, it remains easy to override.
  • ReachReach Posts: 107
    edited 2014-01-24 11:16
    Loopy i would agree with you and I favor the use of latching relays but its almost impossible to find one that they can afford on the project - most sealed latching relays run over 40 each. If I use MOSFETS and epoxy coat the PCB then it should last longer in the harsh environment.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-24 11:49
    What can I say? MOSfets need power to retain their switch position. It is an entirely different approach and less reliable if there is an intermittent loss of power.

    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.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-01-24 12:14
    Hi Reach;

    How fast or often is each relay or MOSFET switched?

    Duane J
  • stamptrolstamptrol Posts: 1,731
    edited 2014-01-24 12:34
    Loopy's right; sometimes the client's idea of price is just unrealistic. In any low volume work, you have to avoid being drawn into a race to the bottom, driven only by price. Start with a solution to the technical problem first and then consider ways to reduce the cost.

    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,
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-01-24 17:27
    Hi Reach;

    Here is a schematic snippet of a latched MOSFET circuit.
    Latched-Power-MOSFET.png

    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
    524 x 420 - 10K
  • Mark_TMark_T Posts: 1,981
    edited 2014-01-24 18:01
    Hi Reach;

    Here is a schematic snippet of a latched MOSFET circuit.
    Latched-Power-MOSFET.png

    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
    Simpler with a couple of CD4000 series NANDs (or is it NORs) to form a flip-flop, they go to 15V don't they?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-01-24 18:34
    Hi Mark;
    Mark_T wrote: »
    Simpler with a couple of CD4000 series NANDs (or is it NORs) to form a flip-flop, they go to 15V don't they?
    Possibly. However, as we have hashed this out in other threads on automotive applications. The environment is really severe.
    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.
    Latched-Power-MOSFET.png

    And more peak voltage with higher voltage parts.

    Duane J
    443 x 556 - 12K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-25 06:03
    My prime concern is that this marine environment is an individual sailboat that is trying to deploy some critical automation that one might need in the midst of a typhoon.

    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.
  • Mark_TMark_T Posts: 1,981
    edited 2014-01-25 13:37
    CD4000 series power consumption is about as micropower as its possible to get though, ignoring any pull-up or
    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 Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-01-25 13:46
    Mark_T wrote:
    Protecting against marine conditions is difficult,
    ... if not impossible. I recently disassembled a solar trickle charger from a sailboat that was draining the battery at night (shorted diode). Everything was potted in 5200. And the solder joints were still corroded. What's worse, the corrosion traveled up the cable under the insulaiton. Even after cutting an inch or so off, I had to scrape the corrosion off with an X-acto knife to render the wire solderable.

    -Phil
  • ReachReach Posts: 107
    edited 2014-01-25 14:23
    You all raise great points and I have inform the customer of many, but they continue to press low cost. I cant believe there is no rocker switch that one could control with a uProcessor. It seems that would solve much of the problems I am facing. I think I will simply use mosfets and bed the entire thing in a epoxy brick. Personally the electronics on my boat have lasted for about 6 years and continue working without any epoxy / obvious protection.

    frustration is an understatement.
  • RforbesRforbes Posts: 281
    edited 2014-01-25 19:06
    Hi Reach

    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!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-26 02:17
    Hi again,
    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.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-26 02:39
    Here is an odd ball that is currently cataloged at Honeywell-Microswitch.

    Actually, a toggle switch might be less prone to salt invasion than a rocker.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-26 10:07
    It seems you can use momentary rocker switches..maybe with an LED that indicates position active. Or you can use regular DPST rockers the S-R latches with pullups in a jamed-latch approach.

    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
  • Hal AlbachHal Albach Posts: 747
    edited 2014-01-26 19:13
    How about using small (up to 2 Amp) latching relays to operate a large MosFet for the current boost? Digikey has latching relays starting at a little over $3, breaking at 25 for for around $90, and 30 Amp MosFets for DC circuits are under $2 a piece. For AC loads a heavy duty Triac could be employed. If you wish, the relays are available hermetically sealed at a slightly higher cost.
    Do all the circuits require 30 Amp service?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-26 22:39
    Yes, using 5 or 9 volt latching relays as an interim stage might just be a lot simpler. These can drive all sorts of other relays and there are a lot of high amp automotive relays that are sealed against weather and road salt. They are cheap for 60amps and I think semi-tractor/trailer may use 24 volt or higher switches.

    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.
  • ReachReach Posts: 107
    edited 2014-01-27 10:16
    I was wondering today if solid state relays allow current to pass in both directions. Has anyone ever used them as a true switch. I need to use it for charging a capacitor and discharging the same capacitor with my latching circuit. So a NPN would not work the same holds true for a mosfet. I wonder about these.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-28 00:36
    Solid State Relays are a bit of a black box. You have to be careful to work with a source that is branded and a brand that provides excellent information about what is inside.

    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.
  • evanhevanh Posts: 15,935
    edited 2014-01-28 01:36
    Common types of low frequency SSRs are:

    - 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?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-28 05:33
    I suspect the end-user doesn't want his/her sailboat to be dependent on a touchscreen for a central control, and desires to have a console of switches that they can quickly glance at to confirm status.

    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?
  • evanhevanh Posts: 15,935
    edited 2014-01-29 01:51
    Yet a digital controller is about to be used right?
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-01-29 03:08
    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'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.
  • DamirXDamirX Posts: 12
    edited 2014-01-29 03:34
    How about power-on state of this circuit?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-29 04:04
    evanh wrote: »
    Yet a digital controller is about to be used right?

    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.
  • Hal AlbachHal Albach Posts: 747
    edited 2014-01-29 15:15
    Perhaps using a set of '595 shift registers may help simplify the logic. Two outputs will set or reset the small latching relay which will also be connected directly to the momentary, center off, SPDT toggle switch for manual operation.
    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.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-29 18:27
    The only aspect that really bothers me is the rocker switches. For 32 rockers, they seem to need 64 independent debouncing circuits provided.

    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
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-01-29 18:43
    Reach wrote: »
    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.

    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
  • ReachReach Posts: 107
    edited 2014-01-30 05:45
    If a mosfet is off how much current is leaking by? How do I calculate this number? I know its a small amount but i need to add this all up so that I can consider other options.
Sign In or Register to comment.