Mains/24VDC detection - Page 1
Forum section: electronics / projects

author: saint
author_rank: Contributor
timestamp: March 30, 2014, 07:57:52 am
content: Hi,first of hello to every one here at EEVBlog, special thanks to Dave for starting this great community.Now on to my problem, part of my current project (AVR based 3V3) need to sense current (mains UE 230VAC) on 3 separate inputs. The current drawn by my detection circuit (below) is just few mA so most of the Hall sensors won't even detect it, meaning I'd have to run it threw amp and on to ADC input. The only Hall sensor that could potentially work is made by Melexis, sorry lost the partnumber somewere its range was 0...80 or 100mA. If there is a Hall sensor that would work just keep in mind that there are 3 detection circuits next to each other.Any kind of relay mechanical (circuit needs to detect about 500k cycles/year) or SSR (fails colse, can't have that) is out of the question.The only thing that I need is to know when the current is present don't need its value.For now I'm using the attached circuit and it works just fine, the schematic only shows 1 of 3 identical circuits hence the 6-channel 7414. Right now I'm trying to moddify it so that it can also detect 24VDC. I am able to make it work in 24-230VAC range just by changing C8 value to something like 0.68uF but if I want to do DC detection I just omit C8 (in PCB assembly) and change the R11 to something like 2...7K. The solution is fine but I'd like the input to be universal AC/DC.Hopefully someone out there has a brilliant idea or maybe I'm just missing some simple solution to this problem. Please don't suggest using trafo as it's bulky and would only work for AC.Note: The pin 3 in C8 is there just to let me make a universal footprint for 2 capacitor packages

author: fcb
author_rank: Super Contributor
timestamp: March 30, 2014, 08:09:41 am
content: Depending on what your peak load is, you could sense the voltage across a large value shunt resistor (that also has a pair of diodes across it to limit the peak voltage). The diodes will need to be large and heatsunk (P=~0.6v x I).

author: saint
author_rank: Contributor
timestamp: March 30, 2014, 08:17:31 am
content: Quote from: fcb on March 30, 2014, 08:09:41 amMains isolation is a priority so this won't cut it.

author: David_AVD
author_rank: Super Contributor
timestamp: March 30, 2014, 08:23:13 am
content: Using 2 diodes in series (and just one in parallel but reversed) should give you enough voltage to drive the LED in an optocoupler.You'd still need a series resistor for the opto LED (maybe 47R) of course. That's assuming 1.4V drop across the 2 diodes in series and about 1.1V Vf for the opto LED.I'm sure I did this a long long time ago to sense when a load was drawn on a 240Vac circuit. I'd have to check what shunt resistor I used to stop leakage current turning the opto on.

author: ptricks
author_rank: Frequent Contributor
timestamp: March 30, 2014, 02:29:52 pm
content: Depending on the environment , a simple darlington pair of transistors can detect the load with no contact, it is generally how those pens that detect voltage by putting it near the wire work.

author: fcb
author_rank: Super Contributor
timestamp: March 30, 2014, 10:03:36 pm
content: Quote from: saint on March 30, 2014, 08:17:31 amSplit your problem into two areas. (1) detecting the small current (2) isolation.

author: ali80
author_rank: Contributor
timestamp: April 01, 2014, 05:36:33 am
content: hcpl7840 can be used for current sensing and it has optical isolation, by it maybe an overkill for your application.

author: han
author_rank: Frequent Contributor
timestamp: April 01, 2014, 05:50:50 am
content: by looping the wire you can multiple the current detected by the hall efect sensor ( depend on the sensor shape)

author: saint
author_rank: Contributor
timestamp: April 01, 2014, 08:38:10 am
content: Thanks for the replays.Quote from: David_AVD on March 30, 2014, 08:23:13 amDaveCAD would be much appriciatedQuote from: fcb on March 30, 2014, 10:03:36 pmSo basically this is similar to my solution but uses diodes insted of RC combination. Isn't this the same asDavid_ANDsuggested?Quote from: ptricks on March 30, 2014, 02:29:52 pmAlready considered it but due to multiple detectors next to each other I'm afraid it might give flase detections.Quote from: ali80 on April 01, 2014, 05:36:33 amChecked the price, yup it would be the most expensive part on the board times threeQuote from: han on April 01, 2014, 05:50:50 amDon't won't to do that the mains/24VDC input is done threw connector.

author: David_AVD
author_rank: Super Contributor
timestamp: April 01, 2014, 08:46:20 am
content: This is from a very old design to raise and lower a TV concealed in a cabinet. The 10R stopped the standby current of the load (CRT TV) triggering the opto.Some of the values may have been tweaked for correct operation, but it will give you a starting point.

author: fcb
author_rank: Super Contributor
timestamp: April 01, 2014, 09:03:08 am
content: Quote from: saint on April 01, 2014, 08:38:10 amYes, both David_AVD and I have suggested the same thing basically. He has also been good enough to find a relevant schematic.As you haven't given much indication what peak load is going to be, you will have to size the diodes carefully.

author: saint
author_rank: Contributor
timestamp: April 01, 2014, 09:15:30 am
content: Quote from: fcb on April 01, 2014, 09:03:08 amThe detection is done in parallel to the load, 470k resistor limits the current to be below well below If max (50mA) of the opto.Quote from: saint on March 30, 2014, 07:57:52 am~7mA@230VAC so it can work down to 24VAC but with DC the 470k resistor is just to much, that's why I swap it for a smaller few k one.

author: David_AVD
author_rank: Super Contributor
timestamp: April 01, 2014, 09:29:58 am
content: Oh, so you are wanting to detect a voltage, not a current ?This is why I thought current:Quote

author: saint
author_rank: Contributor
timestamp: April 02, 2014, 09:37:44 am
content: Quote from: David_AVD on April 01, 2014, 09:29:58 amTo clarify the load is driven through a triac/relay/ssr so there might be some leakage current, sorry about the confusion.Isn'tDavid_AVD'scircuit basically shorting mains half of the time?EDIT:I guess I should have started with a better schematic. For simplicity I've drawn a switch S1 and a lamp as a load. Basically I just need to know when the lamp is on/off.

author: David_AVD
author_rank: Super Contributor
timestamp: April 02, 2014, 10:14:56 am
content: The circuit I described and showed is for detecting current and as such is inserted in series with the load. You since clarified that you want to detect a voltage. This will require a different approach.Trying to use the same circuit to detect 24V DC and 230V AC may not be the best idea due to the vastly different voltages.The 24V DC detection can be done with a resistor (say 4K7) in series with an opto coupler LED input.The 230V AC version could use two (or more) much higher value resistors in series. Keep in mind that resistors have a (working) voltage rating. Using several in series will keep the voltage across each one within their limit. You'll also be sharing the dissipation that way too.Any AC version (high or low voltage) will need a reverse diode across the opto's LED, or an opto with back to back LEDs. When searching, they will be specified as AC input optos. Hopefully this gets you started.

author: saint
author_rank: Contributor
timestamp: April 02, 2014, 10:43:23 am
content: Quote from: David_AVD on April 02, 2014, 10:14:56 amThank's but I'm already doing it using two separate circuits, the goal is to detect voltage using a single circuitThe only difference is for AC I'm using capacitor instead of more resistors so I don't have to dissipate so much power. The DC uses 2...7K resistor and just a gap in place of the capacitor.R11 and R13 are minimelf rated at 500V wanted to use 2512 SMD (1W) but they are only 200V, R12 is just a 0603, C8 is na 630 VDC/400 VAC PET capacitor, opto is AC input.