Detecting a closed circuit with a few complications. - Page 1
Forum section: electronics / beginners

author: system24seven
author_rank: Newbie
timestamp: March 02, 2018, 01:47:10 pm
content: Hi All,I have been working on solutions to a problem I have in one of my designs.The basic circuit is the following:I need to monitor the status of the limit switch.For physical reasons, I only have access to the "GO Button " half of the circuit.When the GO Button is not closed, I can detect 24v in parallel to the Go Button if the limit switch is not open.When the go button is pressed, there is no voltage drop across the go button contacts, so my circuit would report that the limit switch is now open.What is the easiest way to detect this in both Go Button states?

author: danadak
author_rank: Super Contributor
timestamp: March 02, 2018, 02:23:26 pm
content: If your detection has to be a logic level signal to another logicdevice, then it has to be debounced.I would do something as simple as a series R to a PSOC input,then use the debouce component inside it to clean up the signal.In addition at the PSOC inout pin I would also connect a pair ofdiodes as per -PSOC debounce component usage page 10.http://www.cypress.com/documentation/application-notes/an60024-psoc-3-psoc-4-psoc-5lp-switch-debouncer-and-glitch-filterYou can do this by writing no code, for what you have described so far.Regards, Dana.

author: Ian.M
author_rank: Super Contributor
timestamp: March 02, 2018, 03:07:53 pm
content: @Danadak: Not helpful. Please readhttps://www.eevblog.com/forum/beginners/beginners-don't-run-away-please!/ and possibly reconsider your posting habits.@system24seven,You cannot detect the limit switch state solely by detecting voltage across the 'Go' button. When 'Go' is open, the voltage reflects the limit switch state, but when its closed, you need to monitor the current through the button. Detect the current and OR it with the voltage present signal, and you'll have the actual limit switch state. How you detect the current is highly dependent on how much current there is. Connect a multimeter on its 10A range in series with the GO button, push it, measure the current and post it here.The next question is:Do you need a logic level output from this detection circuit or do you just want to drive an indicator lamp, sounder or relay or switch something?

author: Simon
author_rank: Unknown
timestamp: March 02, 2018, 03:37:40 pm
content: Quote from: danadak on March 02, 2018, 02:23:26 pmPlease would you STOP!!!!!!! telling everyone to do everything with a PSOC no matter how irelevant to the discussion.

author: danadak
author_rank: Super Contributor
timestamp: March 02, 2018, 04:34:45 pm
content: Simon, regarding this thread -https://www.eevblog.com/forum/beginners/detecting-a-closed-circuit-with-a-few-complications/I am not sure what the problem is you are seeing.I, like others who advocate STM or uChip or Intel, always think in terms of the parts I regularly useand recommend accordingly. Is that not allowed on this site ? If you look at my posts I have alsorecommended Freescale, and Atmel Tiny. I think I even covered Renesas at one point. Should I notbe doing this ?This particular design, I assumed, maybe wrongly, that he was trying to develop a logic signal offa mechanical switch. So PSOC came to mind, not only because it has a debounce component in it,but that's its behavior is also programmable. Then I showed, as you can see, how to protect aninput to a generic gate....And I will admit I also assumed he was going to do something with thesignal. Maybe that is a mistake on my part.You can also see in other posts for users that are looking for really small amounts of logic, I alsorecommend the verilog capability attached to the fabric inside PSOC. Most of those usersneed that small fabric + a CPU + analog, so its a natural for PSOC. And as you know othervendors are starting to offer that capability, although in severely reduced form, in general purposeembedded CPUs. They are catching up to Cypress.Is there a problem using ones knowledge base here, seems like a great forum to me.I enjoy helpingpeople here. And occasionally finding out something I do not understand. I do not have a lockon the field of EE, and never will.I have seen some resistance to PSOC from specific people, not sure why. If you examine I make mypoints and let those people go on their way. Its not my attitude to force anyone to do anything, justshow them what I think is a good solution. Like I think all responsible posters do. Have been accusedof being a Cypress employee, or on their payroll. Just call their HR department, you won't find me therein any capacity. I do know a lot of people there, in management and field engineering, which was the majorityof my profession, FAE. Same is true for Renesas and Freescale (Iwas at one point a specialist for Freescale 8 bit),ST to a minor degree. I did a lot of work past years on Cypress forum, leaving it ~ 2 years ago, mainly I wantedexposure to a broader spectrum of experienced EEs, I still learn a lot here from other experienced EEs.Let me know, if you want I will leave the forum. I will comply with your decision.Regards, Dana.

author: Simon
author_rank: Unknown
timestamp: March 02, 2018, 04:48:28 pm
content: Thank you for completely disrupting this thread and apologies to the original poster. You did not answer the original question you instead decided that there will be another question and you decided on the answer. I'm sorry but I'm getting fed up with you. As is the rest of the forum. I have nothing against PSOC and I have a couple of sample boards of them myself I wish to look into but you do nothing but push these devices as the answer to everything. Stop doing it or I will ban you!!!!!!!!!!!!!!. You are not helping anybody you are simply running around talking about your pet parts. We don't want to know and we don't care. In fact the question sofar has not even asked about microcontrollers. The question is generic and has nothing to do with any particular microcontroller family. This is your final warningIn answer to the original poster and the answer has nothing at all to do with the discussion sofar that has nothing to do with the question is that you cannot detect the state of the limit switch in the way you expect to. It's simply not possible. As you correctly suggest you can detect whether or not the go button is pressed. Nothing about the go button can tell you state of limit switch. You could measure across the go button and you should see 24 V if the limit switch is closed should it open you'll see no voltage. But once you have closed the go button there is no way of detecting the state of the limit switch it simply not possible.

author: Ian.M
author_rank: Super Contributor
timestamp: March 02, 2018, 05:07:34 pm
content: @Danadak,The problem is: You frequently reply with some variant of 'Use a PSOC ....' without considering if it can solve the O.P's problem.From your posting history, it wouldn't be unreasonable to assume that you are being paid or receiving some other tangible benefit for promoting PSOCs. It looks like spam, it smells like spam, it tastes like spam, and really isn't welcome here no matter what brand of tinned luncheon meat it actually is. If you are just an enthusiast, and haven't been paid or received any PSOC related freebies, then its possibly even worse as it makes you appear rather obsessive, which reduces the likelihood that your non-PSOC contributions will be valued.In this specific instance, the O.P. is already detecting 24V across the button, isn't having problems detecting that voltage, but is having problems detecting the limit switch state when the 'Go' button is pressed, shorting out the 24V signal. As the O.P isn't complaining about any contact bounce issues, and your proposed circuit cant detect the limit switch state with the 'Go' button pressed, your reply was unhelpful and irrelevant, so I and Simon called you on it.I suggest you refrain from mentioning PSOCs unless specifically asked for the rest of this month. After that, please *READ* and *COMPREHEND* the question and only propose a PSOC if there has been no other suggestion for 24H or if, compared to the alternatives, using a PSOC will be significant time and cost saving and can actually solve the problem.@Simon + O.P,Quote from: Simon on March 02, 2018, 04:48:28 pm.... unless you can also detect the current through the 'Go' button. Unfortunately this may not be possible without breaking the circuit to add a current sensor in series with it.I am not an EEVblog forum moderator, nor do I have any contractual relationship with EEVblog. My opinions are solely my own.

author: Simon
author_rank: Unknown
timestamp: March 02, 2018, 05:25:56 pm
content: Yes a current measurement would probably work. Ultimately it might help if the original poster gives us some context.

author: Simon
author_rank: Unknown
timestamp: March 02, 2018, 05:26:59 pm
content: Quote from: Ian.M on March 02, 2018, 05:07:34 pmI suspect this is the case. I appreciate the enthusiasm but is not helpful.

author: Simon
author_rank: Unknown
timestamp: March 02, 2018, 06:11:59 pm
content: further posts about anything not related to the topic will be deleted.

author: drussell
author_rank: Super Contributor
timestamp: March 02, 2018, 06:15:51 pm
content: +1 for monitoring the current through the circuit as your second input aspect if you cannot reasonably monitor across the limit switch itself due to physical location.

author: danadak
author_rank: Super Contributor
timestamp: March 02, 2018, 06:18:41 pm
content: One approach would be to inject a small signal AC component onto the high side of goswitch and look for inductance of the contactor coil A controller could manage this withA/D and some math and measuring the phase on the line. Depends on L variation inthe contactor coil, line variations. You would have to error budget this.Another approach is to simulate go switch closure but with hi Z and measure the currentto keep coil from energize if limit switch closed. You would detect go is open and close the loop,say an external FET driven by output on a UP with a series R that limits current to < pullin current ofcontactor coil. LPF or averaging the measurement would be prudent to eliminate AC linepickup and focus on DC component.Another possibility is detect transient when load is disconnected by limit switch.This is tricky, depends on some capacitive coupling or limit switch bounce. Possiblyjust line L field collapsing would be enough. This of course does not necessarily functionto detect contactor coil energize, just disconnect. Especially if it has a snubber or diode transientsuppressor across its coil. Is the switch centrifugal or just a simple mechanical activation ?In either case you need to debounce any effects of limit switch and go switch in themeasuring loop. Again leading to a processor of some sort.Let forum know if you want specific recommendations on either.One other possibility, a small series R with the go switch, and a LED across it.R sized to insure LED turn on when GO and LIMIT closed. R also has to be sizedto insure contactor coil turn on can occur. Thinking another way LED could be inoptocoupler, allowing you to get an isolated logic level status.Regards, Dana.

author: drussell
author_rank: Super Contributor
timestamp: March 02, 2018, 06:24:57 pm
content: Quote from: danadak on March 02, 2018, 06:18:41 pmWhy would that be? You don't even know what he is trying to do.Most likely a resistor and a simple transistor amplifier or an op-amp or something will easily suffice. IMHO, the answer to everything is not always a microcontroller.

author: Simon
author_rank: Unknown
timestamp: March 02, 2018, 06:26:41 pm
content: As I said I think the original poster need to give us an context. It's hard to recommend a solution if we don't know exactly what he's trying to do.

author: grifftech
author_rank: Frequent Contributor
timestamp: March 02, 2018, 06:29:06 pm
content: if the switch is spdt replace with dpdt, if spst replace with dpst.

author: drussell
author_rank: Super Contributor
timestamp: March 02, 2018, 06:29:58 pm
content: Quote from: Simon on March 02, 2018, 06:26:41 pmIndeed. No need to make anything unnecessarily complex.I suggest we wait for additional context from the OP before wildly speculating any further.

author: Simon
author_rank: Unknown
timestamp: March 02, 2018, 06:32:28 pm
content: Quote from: grifftech on March 02, 2018, 06:29:06 pmIt sounds a little like the current limit switch is built into a sealed device hence a lack of access.

author: BrianHG
author_rank: Super Contributor
timestamp: March 02, 2018, 06:33:33 pm
content: @system24seven, please don't be discourages about some of the argument above. This has been going on for awhile here in a few different beginner threads.Ok, now on to your problem. I have 2 questions before I can give a few solid suggestions.1. When you say knowing the status of the 'Limit Switch', do you just mean lighting up or turning off and indicator lamp if the 'Limit' switch is open? Or, do you need to feed another device like an alarm or buzzer?2. How much current does your 24v relay coil consume? (You can measure this by placing an amp meter in parallel with the 'GO' button.) Will it still operate with 22v? (You may find out in the relay's data sheet)Depending on your answers, there may be a truly easy way to solve this problem.(With this, others may have figured out what I am proposing, so please don't spoil it...)

author: drussell
author_rank: Super Contributor
timestamp: March 02, 2018, 06:36:36 pm
content: Quote from: system24seven on March 02, 2018, 01:47:10 pm(emphasis mine)Quote from: grifftech on March 02, 2018, 06:29:06 pmIndeed, if that is an option, it is certainly a very valid answer to the original question, which was looking for easy, simple methods to obtain the desired monitoring result.+1

author: drussell
author_rank: Super Contributor
timestamp: March 02, 2018, 06:40:10 pm
content: Quote from: Simon on March 02, 2018, 06:32:28 pmNo, he means replace the GO button so you have an additional set of contacts so you can tell whether the GO button is presently activated or not, hence be able to deduce the limit switch position from lack of voltage across the main GO button contacts when you know the GO button isNOTbeing pressed.The original phrasing of the OP's question seems to indicate that he needs to do all the sensing and monitoring at the GO button, otherwise he would just monitor the limit switch directly.I can think of many situations where this would be the case and, indeed, it is a good question!

author: BrianHG
author_rank: Super Contributor
timestamp: March 02, 2018, 06:42:03 pm
content: Quote from: drussell on March 02, 2018, 06:36:36 pmQuote from: system24seven on March 02, 2018, 01:47:10 pm

author: ArdWar
author_rank: Frequent Contributor
timestamp: March 02, 2018, 06:43:40 pm
content: Yep, the most obvious way is to monitor both the voltage and current flowing across the go button.0 V, 0 mA = Limit open Go open OR Limit open Go closed (do you need to differentiate that? Either case the limit switch position are the same)24 V, 0 mA = Limit closed Go open0 V, some mA = Limit closed Go closedOtherwise if you can use SPDT switches on both of the switches, you can place fairly large resistors (enough resistance to not activate the coil) so that the switches is completing the circuit directly when closed, or completing the circuit through resistor when open. In that case, detecting switch states is simply detecting voltage level across GO button.

author: Mechatrommer
author_rank: Super Contributor
timestamp: March 02, 2018, 06:44:42 pm
content: Quote from: BrianHG on March 02, 2018, 06:33:33 pmbe it the moderator hasnt got in the shitty way, everything was just about to go fine. the OP has made it pretty clear. SPST switch and no access to other parts. what helpful in speculating any further? want to hear another solution? use mechanical relay instead of SPST switch, so we can make algorithm if no go and no voltage = no limit switch. ie limit switch state can only be decided if relay is not energized, some sort of chopping mechanism should be able to distinguish both states.will this solution being deleted too? F! serving oneself for the country

author: drussell
author_rank: Super Contributor
timestamp: March 02, 2018, 06:49:18 pm
content: Quote from: ArdWar on March 02, 2018, 06:43:40 pmYou don't need to use an SPDT switch to put a resistor across it.MANYfault indicators, status lights, etc. use this idea. Heck, even a neon bulb across the thermostat in your kettle of coffee pot will light up to indicate that the cycle is complete. Very, very common.

author: drussell
author_rank: Super Contributor
timestamp: March 02, 2018, 06:57:27 pm
content: Quote from: BrianHG on March 02, 2018, 06:42:03 pmI realize thelimitswitch is "off limits"I thoughtgrifftechwas talking about the GO button. Thatwouldwork if it had an additional contact, wouldn't it, or did I miss something?(Other than, of course, that he may well not be able to replace the GO button switch, even though he hasaccess to the circuit for sensing, so it certainly may not be a useful solution in this case... We will obviously need the OP to chime in on this.)

author: capt bullshot
author_rank: Super Contributor
timestamp: March 02, 2018, 07:03:19 pm
content: A simple (and only) solution would be to monitor the current through the "GO" switch. What components to use, depends on the current required by the contactor in normal operation. There are "current sensing" reed relays that may do the job well.

author: BrianHG
author_rank: Super Contributor
timestamp: March 02, 2018, 07:04:56 pm
content: Sorry @drussell, my comment wasn't aimed specifically at you, I'm trying to remind everyone that the OP has no access to the limit switch and contactor relay.I want my 2 questions answered since that contactor relay may have a 1 amp coil. Or, it may be an electronic circuit and only draws 25ma from the GO button. This changes the implementation of my idea and with 1 amp, a resistor solution isn't very reliable or can heat up.I want to suggest something that will be reliable and guaranteed to work.

author: Ian.M
author_rank: Super Contributor
timestamp: March 02, 2018, 07:09:54 pm
content: +1.I asked back in reply#2 for that info:Quote from: Ian.M on March 02, 2018, 03:07:53 pmHowever I was having a brain-fart and didn't think of the really simple test of simply connecting the multimeter on Amps directly across the Go button, simulating pushing the button, to measure it.

author: floobydust
author_rank: Super Contributor
timestamp: March 02, 2018, 11:45:28 pm
content: The wire can be 0V, 24V or floating. There is a way to detect the three possibilities on a single wire, but you need power.You can use a dual-optocoupler or a couple transistors. This is the sort of idea:

author: Ian.M
author_rank: Super Contributor
timestamp: March 03, 2018, 12:11:28 am
content: No. O.P's requirements:Quote from: system24seven on March 02, 2018, 01:47:10 pmYour dual opto circuit doesn't indicate the limit switch state while the Go button is pressed.FAIL

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 01:04:29 am
content: Ok, got tired of waiting for the OP to answer this my 2 questions, so, I'll just assume his contactor relay draws a huge current.My circuit will work from 100ma to 4 amps DC. At 100ma, the contactor will get 22.8v instead of 24v. At 4 amps, the contactor will get 22.4v instead of 24v. I would be surprised if the contactor would fail to properly switch losing approximately 1.5v, or around 6% on it's power supply. This circuit will handle contactors with 24vdc at up to 90 watts inrush current coils. For the 24VDC contactors which have a 225 watt inrush current, you will need to go to 10 amp diodes.Digikey has stock of the diodes and relay. The relay contacts are only 2 amps. Larger contact current 1.5v relays exist...If you need a power relay, use 1 to 2 more diodes in series and an Omron 'G6RL-1A DC3' rated with 10 amp contacts. Your contactor will now only get 21.6v to 21v.

author: floobydust
author_rank: Super Contributor
timestamp: March 03, 2018, 02:21:50 am
content: Quote from: Ian.M on March 03, 2018, 12:11:28 amI figured you'd know before and after the GO button is pressed if the limit switch tripped. So we'll have to monitor current to know in real time.This application sounds like a motor and travel limit switch? Operator presses and holds button and needs to know when you've reached the end?Most large contactors are AC coil.

author: EEVblog
author_rank: Unknown
timestamp: March 03, 2018, 04:07:22 am
content: Quote from: system24seven on March 02, 2018, 01:47:10 pmAssuming there are no grounding issues between you circuit and the switch/relay system, a simple resistor divider should do it. One that reduces 24V to say 3.3V or 5V for whatever logic you are using. Maybe with a reverse diode across the lower resistor for protection.More complex would be to use an optocoupler.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 05:08:43 am
content: Quote from: EEVblog on March 03, 2018, 04:07:22 amCan you please explain this, or, illustrate you idea. I'm having trouble visualizing you wiring.According to many contactor data sheets, for the 24vdc coils units, those coils are specked to consume as much as 3.5amps initially when switched on, then, they settle to 100ma current. If the OP's circuit is an electronic driven contactor, where there only may be around 10ma in the loop, all I would do is use an optocoupler in the circuit as well.You can see in my attached data sheet, the 90watts for the 24v DC contactor is 3.75 amps until it is closed when it goes to 2.8 watts, or around 116ma. This is a huge swing.

author: Brumby
author_rank: Unknown
timestamp: March 03, 2018, 06:07:42 am
content: Before we start getting into solutions, I thought it best to lay out the problem more clearly. Here is how I understand it...Two switches having two states each generates four possible states of the system, having the following characteristics:Here we can see three possible measurable quantities for the voltage across the GO button: 0V, 24V and Undefined - and if wehave3 distinct values for this voltage, we can exactly determine the state of the switches when no current is flowing.However, the undefined value causes a problem. It couldpossiblybe 0V or 24V, which extinguishes the certainty.If, however, there could be some unique voltage across the GO button, then the certainty is reinstated. (I have chosen 12V - but it could be ANY voltage sufficiently different from the nominal 0V and 24V that it can be reliably distinguished from them.)Inverting the table using observations to determine states produces this:My solution would introduce a voltage across the GO button from a source of sufficiently high enough impedance that it has no measurable effect on the normal operation of the system, but not so high that the voltage detection mechanism cannot reliably detect it when both switches are open. There would also be a shunt resistor for detecting current flow.How these quantities are then processed is open for discussion.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 06:29:38 am
content: Quote from: Brumby on March 03, 2018, 06:07:42 amPlease show me an example schematic of how this could work. Remember, the OP might have access to an outside voltage source, but, it is not guaranteed. Also, the op has no access to anything on the right hand side of his schematic, just the 2 wires which go to the GO button. While the go button is closed, keeping the contactor on, he needs to know if at anytime the limit switch has been opened.He does not care about the limit switch's position when the GO button is off. This would be all too easy to detect.

author: Brumby
author_rank: Unknown
timestamp: March 03, 2018, 06:42:10 am
content: I've already thought oftwothree ways. Give me some time to draw something up.Knowing the current draw and tolerance of the existing system to a voltage drop across a shunt resistor would be nice - but I'll just throw in some numbers to make it work.Quote from: BrianHG on March 03, 2018, 06:29:38 amDon't do this. As a first pass, ignoring one of the valid states BEFORE you have a solution is a brilliant way to trip yourself up. Wait until the re is a solution and THEN see if you want to ignore it or not. If a solution is still elusive, then if it isclearly statedthat knowledge of this state is not required and ignoring this state will allow a solution to be forthcoming, then and only then would I consider this a valid course of action.However, ignoring it is absolutely not necessary. It actually falls out of the solution, with practically no additional effort.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 06:45:29 am
content: Quote from: Brumby on March 03, 2018, 06:42:10 amHere are the numbers for most of the 24vdc contactor coils, the power requirements are boxed in red, the tolerances are just to the right:

author: Brumby
author_rank: Unknown
timestamp: March 03, 2018, 06:50:37 am
content: I'm not doing a full circuit design with finished calculations. I'm just going to do something for illustration.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 06:51:48 am
content: Quote from: Brumby on March 03, 2018, 06:50:37 amYou only need 2 different parts to make this work! I posted a working schematic above.https://www.eevblog.com/forum/beginners/detecting-a-closed-circuit-with-a-few-complications/msg1441675/#msg1441675Remember, the OP said he already could already tell if the limit switch was open when the GO button wasn't pressed. He just didn't have a way to tell when the button was closed. This was all we had to solve for him.

author: Brumby
author_rank: Unknown
timestamp: March 03, 2018, 07:19:05 am
content: OK then. In that case the solution is even easier.A 1k series resistor and an LED across the GO button.Next.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 07:44:56 am
content: Quote from: Brumby on March 03, 2018, 07:19:05 amWhen the button is closed, there is 0v everywhere, even if the limit switch is open or closed. This is the only other solution I have which will always tell you the status of the limit switch, no matter if the GO button is pressed powering that 3.75 amp contactor relay coil, or the GO button is open, lowering the current across the contactor relay coil below the minimum hold current of 11ma.When the limit switch is closed, the output of this circuit will go low, when the limit switch is open, this circuit's output will go to VCC:My earlier circuit is simpler, doesn't require a VCC, but this circuit gives you the limit switch state with GO on or off, makes no difference & the GO button will still properly drive that 3.75 amp contactor coil.

author: Ian.M
author_rank: Super Contributor
timestamp: March 03, 2018, 08:42:37 am
content: I'd bet on there being an excessive ground offset at the 'Go' button location, so the output from that probably isn't suitable to go direct to a logic level input. However that can be fixed by bringing the emmitter connection to the logic board as well and either optoisolating or using a well protected differential comparator, with one input from your output as shown and the other from a 2x 10K potential divider between the emitter and Vcc.Another simple solution that also offers isolation would be a pair of reed relays, one with a high impedance coil to sense the voltage across the button without activating the contactor, and the other with a low impedance current sensing coil to detect the contactor coil current. Wire their SPST contacts in parallel to mirror the limit switch's action.

author: Brumby
author_rank: Unknown
timestamp: March 03, 2018, 10:54:54 am
content: Hmmm... Yes, I went a bit too far with my "simplification".The one thing that does seem to be consistent, though, is that all the solutions combine a voltage detection and a current detection. The manner of processing those is what differs.

author: Damianos
author_rank: Frequent Contributor
timestamp: March 03, 2018, 01:33:41 pm
content: Just thinking about:

author: Brumby
author_rank: Unknown
timestamp: March 03, 2018, 02:10:23 pm
content: This was my minimum solution. It shows all 4 states with 2 resistors and a meter. There are better ways to handle the display - but I went with simple.A = GO button closed, LIMIT switch openB = GO button closed, LIMIT switch closed (yes, I know it's close)C = GO button open, LIMIT switch openD = GO button open, LIMIT switch closedYou could also feed the meter voltage via a resistive divider to an analogue input of a micro and display it however you want.

author: Kalvin
author_rank: Super Contributor
timestamp: March 03, 2018, 03:49:07 pm
content: You can use an optocoupler to detect the current through the GO-switch. The circuit assumes that the 24V solenoid will work at 21V due to voltage drop across the optocoupler. Using the optocoupler will also provide nice galvanic isolation from the circuit you are monitoring. The string of 1N4001s are there to limit the maximum voltage/current across/through the optocoupler.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 04:18:08 pm
content: Quote from: Kalvin on March 03, 2018, 03:49:07 pmThis is the same as my relay solution above:https://www.eevblog.com/forum/beginners/detecting-a-closed-circuit-with-a-few-complications/msg1441675/#msg1441675Except your 1N4007's will explode when your switch on that 3.75 amp contactor coil and, with 3 of them, even at full 1 amp load, you get a 1v drop across each equaling 3v total meaning the contactor coil will get 21v. According to the contactor data sheet I posted above, the absolute minimum DCV drive is 85% of 24v, or, 20.4v. So, if the op's powersupply and length of wiring is only down by 0.6v in any of his machines, the contactor isn't guaranteed to turn on properly. This is a super close margin for a 24v system, especially if the OP 24v source isn't regulated.

author: Kalvin
author_rank: Super Contributor
timestamp: March 03, 2018, 04:29:50 pm
content: Quote from: BrianHG on March 03, 2018, 04:18:08 pmI used 1N4007s as an example. One can select whatever diode is suitable for the job. I decided to post my suggestion as one might have an optocoupler and suitable diodes at hand.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 04:31:31 pm
content: Quote from: Brumby on March 03, 2018, 02:10:23 pmVery tricky, as I illustrated in the contactor data sheets I posted above, to switch on, (to make thing easy for your circuit I'll use the contactor which uses 3.75 amps to turn on and stabilizes at 100ma.) You need a shunt resistor which cannot exceed a 2v drop, to be safe to turn on according to the data sheet, which will be a 0.54 ohm shunt. Now, once the contactor settles to 100ma when sealed according to the data sheet, the voltage drop you will measure across your 0.54 ohm shunt will be 0.05v, not 1v like in your illustration measurement 'B'. I don't think the op will be able to get a good measurement electronics out of that except at the level of a good DVM.

author: system24seven
author_rank: Newbie
timestamp: March 03, 2018, 04:32:20 pm
content: Hi All,First of all, thanks for the replies, this has been very educational.Apologies for not replying sooner, I have been stuck in transit with the snow.Contactor in use is:Schneider LC2K1210B7https://www.schneider-electric.us/en/product/LC2K1210B7/tesys-k-reversing-contactor---3p---ac-3-%3C=-440-v-12-a---1-no---24-v-ac-coilMinimum switching voltage 17V.4.5VA holding power to keep the contactor coil energised.I did just realise that the contactor coil is in fact AC, and the power supply in the unit is not rectified. Fail.I only need to monitor the limit switch state, as correctly pointed out, the limit switch/contactor is part of a hoist assembly.It sounds like I need to use a two part approach and OR the results of voltage and current sensing.I will be taking output from the detection as a logic signal, so the optocouplers are a great solution for isolation, and would have likely been part of the signal path in the final design.The next query is whether changing to AC will require more complexity. I assume that I could rectify the output signal somehow, as I don't need more than 0.1 Second detection accuracy, so plenty of time to debounce etc.In reality, I have a cable with two limit switch circuits sharing a common (one for up, one for down) and also a separate ground, and I would have two identical circuits monitoring these.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 04:41:18 pm
content: Quote from: Kalvin on March 03, 2018, 04:29:50 pmOk, you are correct. But, I did the searching and math, as in my above posted, sitting withing the safe margins of the stratup current and startup voltage for the contactor with a little additional safe margin, the cheapest diode combination which I used was only 2x MUR540's. However, at startup, the total voltage drop was 1.6v, once the contactor was sealed, this voltage dropped to 1.3v. Unfortunately, 1.3v isn't good enough with a series protection resistor to turn on an optocoupler reliably, especially when you get that 1.6v or more startup current. My original cheap 2$ 1.5v relay's 98ma draw and 1.3-1.6v coil operating voltage was the most rugged and gauranteed to function design with the available information.+, the relay is good if all the op wants a large warning lamp, or buzzer/siren, even operated from 120v/240v.Except your 1N4007's will explode when your switch on that 3.75 amp contactor coil and, with 3 of them, even at full 1 amp load, you get a 1v drop across each equaling 3v total meaning the contactor coil will get 21v. According to the contactor data sheet I posted above, the absolute minimum DCV drive is 85% of 24v, or, 20.4v. So, if the op's powersupply and length of wiring is only down by 0.6v in any of his machines, the contactor isn't guaranteed to turn on properly. This is a super close margin for a 24v system, especially if the OP 24v source isn't regulated.

author: system24seven
author_rank: Newbie
timestamp: March 03, 2018, 04:42:06 pm
content: Page 21 for those interested for the device schematic.http://www.cm-et.com/Public/45552/CMET%20Lodestar%20Manual%2000000999%20REV%20AC-lowres.pdf

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 05:03:15 pm
content: Quote from: system24seven on March 03, 2018, 04:32:20 pmWAIT A SECOND, your contactor has an AC coil, but, in your circuit,, you are using a DC supply. Is this correct?Ok, if your circuit is DC just change the 2x 'MUR420' diodes in my 2 design with 2x or 3x Diodes Incorporated '10A01-T'.However, you need to be sure about your true turn on voltage of 17v, TeSys K contactor does not specify this. From what I have seen, 85% of the coil specified voltage, ie 20.5v DC to guarantee turn on of the contactor. Where did you get this 17V? Is you 24v DC supply regulated, or, just rectified AC-DC with a 100hz/120hz pulse in it?

author: system24seven
author_rank: Newbie
timestamp: March 03, 2018, 05:08:09 pm
content: Quote from: BrianHG on March 03, 2018, 05:03:15 pmMy supply is inside the hoist, which has a rectifier for another purpose (DC coil brake), and it has a conventional transformer, so the circuit is not using DC at all. That was my big mistake.As far as the 17v, if you scroll waaaaaaay down the page, there is another table with "Complementary" title.There is where the extra signal circuit details are listed.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 05:22:25 pm
content: AC, this changes quite a bit. Yes, the AC coils have a lower turn voltage range because of the peaks in the swing of the AC.Also, taken from the datasheet:Minimum switching current 5 mA signalling circuit *** This usually means once switched on, this is the amount of power which can hold the relay in place.Minimum switching voltage 17 V signalling circuitBut read just above:Control circuit voltage limits 0.2...0.75 Uc at <= 122 °F (50 °C) drop-out0.8...1.15 Ucat <= 122 °F (50 °C) operational***This is 19.2vInrush power in VA 30 VA at 68 °F (20 °C)***This means around 1.25amps to switch.Hold-in power consumption in VA 4.5 VA at 68 °F (20 °C)***This means around 188ma to hold. These numbers make a lot more sense...0.80, or 80% of 24v = 19.2v at 122 degrees. The lower 17v figure is probably minimum at room temperature, not a good choice for guaranteed operation at all specified temperatures.Next question, will an optocoupler output be sufficient for your detector. What do you need to switch, an AC or DC device and at how many volts?

author: system24seven
author_rank: Newbie
timestamp: March 03, 2018, 05:29:42 pm
content: I will be taking multiple of these detector circuits in using MCP23017 IO expanders, so an optocoupler would be ideal, as I could separate my +5v rail from the AC side of the system. Originally I was going to use an LM339 Comparator then chain in an optocoupler after that.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 05:33:29 pm
content: New schematic coming...

author: Ian.M
author_rank: Super Contributor
timestamp: March 03, 2018, 05:57:52 pm
content: As its AC, the best option for the current sensing would be current transformers. That gives you isolation and minimal voltage drop. As the holding current is about 190mA with a 1.25A surge at pull-in, there's plenty of drive available. Each current transformer secondary would feed a bridge rectifier (1N4148 signal diodes would be suitable as long as the transformer ratio is high enough) and then be loaded by a burden resistor and a Zener clamp to limit it to an appropriate logic level, with a capacitor to smooth the output enough so it stays at logic '1' between half cycles. Choose the burden resistor so it reaches the logic '1' threshold at 2/3 the holding current. For a one-off you could easily wind your own on pot cores. I expect a 100:1 ratio would be satisfactory.The voltage sensing will obviously use an AC input optocoupler, with a pair of suitable limiting resistors in series, with Zener clamping (2x 24V back to back, or a 24V bidirectional TVS diode) across the opto LED + the lower resistor to handle the back-EMF from the contactor coil when the Go button opens.Its purely a matter of personal preference if you take the voltage and current inputs direct to separate MCP23017 inputs and OR them in software or if you use external OR gates to combine them before the MCP23017.

author: system24seven
author_rank: Newbie
timestamp: March 03, 2018, 06:17:25 pm
content: Quote from: Ian.M on March 03, 2018, 05:57:52 pmHaving never used current transformers, I had a search through the offerings at RS, they seem to only have large units >30A that install onto cables.I assume there are tiny <2A PCB mount offerings available?

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 06:37:47 pm
content: Ok, this circuit will work with AC or DC.It is 100% isolated from your lift's wiring. This means no powering, filtering, and protecting any analog comparators/op-amps on the AC side or within your MCU side since there is no connected link.It meets all the min and max values for your contactor's coil surge - on - minimum hold for off - off currents with some good clearance.You may parallel the transistor outs of the optocoupler if you want just the status of the limit switch, otherwise, having separate outputs may be useful to you. I recommend a 10-100k pullup on the OC's transistor out with a 1uf to GND to filter out the 120/100hz from the AC cycling transitions in the circuit which the optocoupler is fast enough to pass through.The contactor coil will get 20.8vac during power-up surge 21.4vac while kept on. When the GO switch is open, the contactor coil will only see 2ma. This circuit will withstand a 4amp continuous.Note you can switch the 8 diodes with a current sensing transformer.

author: Ian.M
author_rank: Super Contributor
timestamp: March 03, 2018, 07:00:39 pm
content: That's why I was suggesting pot cores. Try winding 200 turns of fine magnet wire directly on the former for the secondary and a 2 turn heavy gauge primary wound on top of it. Eventually you'll use enamelled solid copper wire for the primary, and protect the secondary with tape, but while you are messing around with it to get a suitable turns count and turns ratio, its easiest to use stranded hookup wire for the primary, so you can easily get to the secondary to add or remove turns. Use a Variac feeding a low voltage transformer and a fixed resistor to get a suitable current through its primary for testing.Its also possible to build them on ring cores, but they are a PITA to hand wind so don't do that unless you are planning on volume production.If you want to use BrianHG's circuit, you could replace the eight diodes with two bridge rectifiers. Short each one from + to - and connect them in series via their AC terminals.Brian's circuit is likely to be the cheapest and most compact, but you do need to be able to tolerate about 2V voltage drop, and we don't know how much is already taken up in wiring losses.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 07:11:47 pm
content: You can eliminate D4 and D8 in my design, however, during operation, the optocoupler LED will only see 2v going thru the 220 ohm resistor, 2.5v max during the current in-rush. The nice thing here is regardless of some small losses in cables, these voltages are fairly closely constant as they represent the loop current and current across the diodes.And yes, using a bridge rectifier with the +&- shorted is a cheap way to get 2 diode drop, but you will need 2 of them.

author: system24seven
author_rank: Newbie
timestamp: March 03, 2018, 08:04:11 pm
content: Quote from: BrianHG on March 03, 2018, 07:11:47 pmIn the context this circuit exists in, the cables between this detector and the contactor are normally 1mm diameter copper of up to 100m.That equates roughly 4v drop in the line.I am worried that this would be possibly unreliable at distance.If I was to make a gain stage out of a couple of transistors and a few resistors, place this where the optocoupler is, and feed the opto with the output of the transistors, could I decrease the number of diodes to 2?One forward, one reverse in parallel~1V drop on the 24v line.I would need to have a low voltage rail to switch with the transistor, but thats ok in context.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 08:10:07 pm
content: Yes you can. I just checked the optocoupler datasheet. Using only diodes D1,D2 & D5,D6, you will see a 1.35v drop (voltage loss across relay @ 200ma holding contactor on) and the optocoupler needs typically 1.2v to turn on. During the 1.25 amp surge, you voltage loss at the contactor will now be 1.6v according to the MUR240 datasheet.Going down to 1 diode, you are now talking about 0.65v across the diodes. Even with transistor amplifiers, this is getting messy. Having single diodes back-to-back, and using a signal transformer to send to an op-amp on your PCB or MCU to sample will be the only cheap isolated choice here. In other words, for when the switch is open, use a single optocoupler. When the switch is closed, use the output of the transformer which you will need to amplify with an opamp or comparator to feed a MCU digital input.Using this transformer across 2 parallel back-back silicon diodes diodes for that 0.75v drop, you can now go to a schottky diode making your voltage drop go down to around 0.3v.Xformer #1:https://www.digikey.com/product-detail/en/tamura/TTC-5023/MT7238CT-ND/674136Xformer #2:https://www.digikey.com/product-detail/en/triad-magnetics/TY-400P/237-1133-ND/242655Schottky :https://www.digikey.com/product-detail/en/vishay-semiconductor-diodes-division/SB540-E3-73/SB540-E3-73GICT-ND/3711864However, the output of the transformer will be a 50/60hz square wave at 0.2v instead of the optocoupler transistor output of 5v.

author: system24seven
author_rank: Newbie
timestamp: March 03, 2018, 08:29:39 pm
content: I think that gives me some serious tinkering to do now, ill build it and show my results. Could take a bit of time though.Thanks all.

author: BrianHG
author_rank: Super Contributor
timestamp: March 03, 2018, 08:44:58 pm
content: Using the 4 diode total scheme, only D1,D2,D5,D6 you may need to lower the 220ohm series resistor to 100 ohm, or even 47 ohm.

author: Brumby
author_rank: Unknown
timestamp: March 04, 2018, 02:16:39 am
content: Quote from: BrianHG on March 03, 2018, 04:31:31 pm* The analogue meter was just toillustratethe four conditions. Placement of the dots was indicative (actual positions will be dependent on the math). Try doing the sameillustrationwith a digital one.* Implementing a digital processing solution wasalwaysgoing to be thepracticalpath.* The concept is simple and valid* The AC twist adds a minor complexity - resolvable in at least 3 simple ways that came to mind as I was typing this.... but considering the direction this thread is going, I'll leave you to it.

author: drussell
author_rank: Super Contributor
timestamp: March 04, 2018, 05:32:58 am
content: Quote from: system24seven on March 03, 2018, 08:04:11 pmHave you measured the actual voltage in typical operation? "24 V" is often more like 25.6 V to start with, for one thing.... Can you check the actual voltage at the contactor in a typical sample unit and get a real idea for how much additional voltage drop you're going to be able to tolerate?

author: Zero999
author_rank: Super Contributor
timestamp: March 04, 2018, 09:14:50 am
content: Lots of elabourate solutions have been proposed, involving opto-couplers.Why not just use a current monitoring relay? It goes in series with the load and closes a set of switch contacts, when the current exceeds a certain threshold. The downside is, most current monitoring relays I've found are quite expensive. As this application is AC, a current transformer could be used to switch an ordinary AC voltage relay.https://www.digikey.com/product-detail/en/littelfuse-inc/TCSH2A/F10659-ND/7931381

author: Brumby
author_rank: Unknown
timestamp: March 04, 2018, 12:48:09 pm
content: Quote from: Hero999 on March 04, 2018, 09:14:50 amPerhaps because the state of the limit switch is required to be known when current is flowing ...andwhen it's not.

author: Damianos
author_rank: Frequent Contributor
timestamp: March 05, 2018, 06:52:59 pm
content: Continuing to play on this subject, I attached one more idea!Note: LED2 and U2 input must be connected as shown. An AC input optocoupler does not work in this circuit.BTW: signaling minimum levels, that referred in datasheet, are relative to auxiliary contact (terminals 13 & 14), to keep it clean from corrosion.

author: Kalvin
author_rank: Super Contributor
timestamp: March 05, 2018, 07:03:35 pm
content: Here is another one: Put a resistor in series with the GO-switch and select a resistor so that it gets heated to 60C when the solenoid is active. Then glue the resistor to Attiny85 and use the Attiny85 to measure the temperature. The temperature is "high" when solenoid is "on" and temperature is "low" when solenoid is "off". Alternatively you can use a diode or NTC/PTC as temperature sensor for the resistor and use Attiny85 to measure the voltage change across the diode/NTC/PTC. Of course you can build analog counterpart from a comparator or an op amp, but that would be too simple and old school.