bahstrike Posted April 9, 2011 Report Share Posted April 9, 2011 I'm trying to simply detect the presence of a voltage, either AC or DC, across a wide range (5v through 240v).I attached a picture of my current schematic. LTV817 opto-isolator gain should be around x10.However I think I can simplify this design to fewer resistors and relays.Range A: 1M Resistor240v / 1M = 0.00024 * 10 = ~2mA120v / 1M = 0.00012 * 10 = ~1mARange B: 100k Resistor48v / 100k = 0.00048 * 10 = ~5mA24v / 100k = 0.00024 * 10 = ~2mA12v / 100k = 0.00012 * 10 = ~1mA5v / 100k = 0.00005 * 10 = ~500uAI suppose since the 5v case might only produce half a milliamp, I should increase the pull-down resistor to 100k and perhaps eliminate the 10uF capacitor altogether. In the case of AC, I can have microcontroller detect and ignore zero-crossings so the capacitor might not be needed anyway.Does this seem reasonable, or my original schematic is best, or is there an even simpler approach I am not thinking about? Quote Link to comment Share on other sites More sharing options...
audioguru Posted April 9, 2011 Report Share Posted April 9, 2011 An opto-isolator has a range of gain maybe from 2 to 20, not just 10.Its gain is not steady, it changes with temperature and with age.Your circuit uses old relays to switch ranges, my DVM doesn't.Your circuit will instantly burn out its LED when set to a range that is too low, my DVM doesn't.Your circuit forgets that the transistor charges the output capacitor to the peak voltage of a sine-wave which is 1.414 times higher than the RMS voltage.On the 5V range the accuracy below 1.4V will be horrible, my multimeter has the rectifier inside the feedback loop of an opamp so it is accurate down to 0.001VAC. Quote Link to comment Share on other sites More sharing options...
bahstrike Posted April 9, 2011 Author Report Share Posted April 9, 2011 DVM circuit would be wonderful.I seem to have found DVM schematics with either a lot more components, expensive ICs, or ones that are based on ICL710x which has an integrated LED segment driver.. far beyond my needs of a simple on/off.I figured that by using reed relays with varying resistance, I can achieve the goal with a relatively simple prerequisite 'learn' procedure that involves testing at highest resistance- if that does not detect the signal then test again at the next lower resistance- until the signal is detected.. Store that range identifier in EEPROM and the system is now compatible with the source.Am I on the right path or is your fully-featured DVM cheaper to build?EDIT:I'm sorry- I did fail to specify that although the circuit should have the initial capability to deal with 5v - 240v, it does not change once the source is identified. Quote Link to comment Share on other sites More sharing options...
Hero999 Posted April 9, 2011 Report Share Posted April 9, 2011 You should use a constant current source rather than a load of relays, that way there's not need to switch ranges. Quote Link to comment Share on other sites More sharing options...
bahstrike Posted April 9, 2011 Author Report Share Posted April 9, 2011 ??? I don't know what you mean by constant current source.Is it a special component, like a Current Sense resistor?The 5v - 240v is generated by a 3rd party device that I don't control, and the voltage level may vary depending on the manufacturer so I cannot predict what it will be. However, the voltage level on any one particular device will not change. That's why I say it's acceptable to have a 'learn' procedure to find the appropriate range, then store in EEPROM which relay to always activate from that point forth.Unless you have a magic trick Hero999, I think the relays & resistors might still be the easy&cheap way out of this. Quote Link to comment Share on other sites More sharing options...
bahstrike Posted April 9, 2011 Author Report Share Posted April 9, 2011 In this project, it's OK to draw current from the source.But in my next project, it's NOT OK to draw any noticable current, so a true DVM would be applicable. Luckily for that scenario, I can pretty much gaurantee the voltage will be between 5v and 24v DC, therefore electrical isolation is not as important. So perhaps I can use a high-impedance input fed through opamp and then into an ADC; to get a limited range, but true, DVM.Yet, on this project, I already know 120VAC will show up often. And I know that 12VDC is also commonplace :-\And I know I can't trust a technician to actually check the 3rd party device schematics (if even available) and use a knob to select the correct range :'( The signal doesn't appear unless you're actually operating the device from another room, so it's not trivial either to just check beforehand with a voltmeter. Quote Link to comment Share on other sites More sharing options...
Hero999 Posted April 9, 2011 Report Share Posted April 9, 2011 It's still not clear what you want to do.Do you simply want to detect the presence of a voltage or do you want to measure the actual voltage?Just Google for constant current source if you don't know what it is. I was suggesting building one from transistors to limit the current through the optocoupler's LED to replace the series resistor.Measuring such a wide range of voltages using an ADC is harder. To change ranges you need an attenuator or amplifier with a programmable gain. For AC you ideally need a bipolar power supply or a virtual earth. The best way to achieve isolation is probably to use an isolated DC-DC converter to power the measuring circuit which is directly connected to the potentially dangerous voltage and transmit the data digitally via an opto coupler or a pulse isolation transformer. Quote Link to comment Share on other sites More sharing options...
bahstrike Posted April 9, 2011 Author Report Share Posted April 9, 2011 For this project, I only want to detect the presence of a voltage, regardless what that voltage may be. Quote Link to comment Share on other sites More sharing options...
Hero999 Posted April 9, 2011 Report Share Posted April 9, 2011 Then that's easyly done with a constant current source powering the LED from the high voltage side. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.