1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

120 VAC voltage detection

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by embedded_sys, Sep 8, 2017.

  1. embedded_sys

    embedded_sys New Member

    Joined:
    Sep 8, 2017
    Messages:
    21
    Likes:
    1
    I'm working with a system that requires me to read 120VAC inputs on a pivot irrigation system. The wires travel 1/4 of a mile. Occasionally on the line I am reading, the voltage is 65VAC instead of 120VAC. I believe this is an induced voltage because of the length of the wires. I only want to know when the line is 120VAC. I'm using a simple opto-coupler with a resistor to detect the voltage. At 65VAC, my micro-controller reads high. How can I adjust my circuit (or redesign it) to detect only voltage about 100VAC? I've tried increasing the value of R14 so that it only turns on the LED above 100VAC, but at 120VAC, the input reads high and low intermittently. I need to know exactly when the line has 120VAC on it and never anything less. I've used this module before with success, but at $11+ it is too expensive. It has a voltage range of 90-140VAC.

    Below I have the current components I use and the schematic.

    Opto Isolator TLP290-4
    100K Resistor

    Screen Shot 2017-09-08 at 1.54.20 PM.png
     
  2. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,324
    Likes:
    585
    Location:
    Peterhead, Scotland
    ONLINE
    Try something like this:

    Phantom Voltage 1.png

    Adding a relatively low value of resistor, which will load down the high impedance phantom voltage, but not dissipate too much power when the line is energised with a real 120v.

    JimB
     
  3. embedded_sys

    embedded_sys New Member

    Joined:
    Sep 8, 2017
    Messages:
    21
    Likes:
    1
    I tried something similar to that. I first tested it by added a light bulb between the input and neutral. That was successful. After that, I added a 330 ohm 50W resistor between the input and neutral. The resistor got really hot, and I still saw the phantom voltage.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334

    Are you missing a pull-up resistor on the microprocessor input? That will control the current transfer ratio, and make the operation more repeatable.
     
    Last edited: Sep 8, 2017
  6. embedded_sys

    embedded_sys New Member

    Joined:
    Sep 8, 2017
    Messages:
    21
    Likes:
    1
    I'm using the internal pull up resistor (100K) which is working great on all circuits except for this one.
     
  7. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334
    Try an external 4.7K or 10K.
     
  8. embedded_sys

    embedded_sys New Member

    Joined:
    Sep 8, 2017
    Messages:
    21
    Likes:
    1
    Adding a 10K external pull-up resistor did not seem to help.
     
  9. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334
    Here is a wild ass guess at what you are doing. Note that unless you put diode D1 as I show below, you likely have damaged the input LED to your opto-isolator. Note the red trace, V(a) and how the diode clamps the voltage to -1V. Without it, you will exceed the -5V Absolute Max allowed.

    I dont have a model of your specific opto, but this one is likely close enough.

    Note that this simple circuit follows the AC input on a cycle-by-cycle basis; is that what you intended?
     

    Attached Files:

    • 56.png
      56.png
      File size:
      35.3 KB
      Views:
      31
    Last edited: Sep 8, 2017
  10. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,324
    Likes:
    585
    Location:
    Peterhead, Scotland
    ONLINE
    The Toshiba datasheet for the TLP290-4 shows the reverse voltage protection diodes are included in the IC package.

    JimB
     
  11. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334
    That's wierd. I clicked on the link in post #1 and wound up at a data sheet that looked more like the 4n25.
     
  12. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,324
    Likes:
    585
    Location:
    Peterhead, Scotland
    ONLINE
    I just googled for tlp290-4, and got this, as per the attachment.

    JimB
     

    Attached Files:

  13. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334
    So back to the simulation in post #8. Not much changes except D1 exists inside the package. The CTR is just a bit higher, so the circuit will work as the sim shows. The TS will have to "rectify" the pulsed output in software...
     
  14. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,253
    Likes:
    961
    Location:
    Loveland, CO USA
    It looks like you need to know exactly the voltage and the opto can not do that.
    The opto is not temperature stable. It does not have "gain". Many problems.
    The opto is not made to do this job. 10V verses 100V Yes it will do that.

    If you replaces the 100K resistor (R14) with: some Zener diodes that add up to 80V or something and a resistor......
    (Zener is not the best either but...)
    Now resize the resistor to see the remaining voltage.
    (ground, opto, Zener-45V, Zener-45V, resistor) Then you need to put a capacitor across the output of the opto to get rid of the pulses.
    --------------------------------------------------------
    If you need 1% accuracy then I can build a circuit with a TL431.
     
  15. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334
    Where are the Input and Neutral connected? There should be no separate connection to earth ground at the input of the opto-isolator. Input and Neutral should be a twisted pair that connects only at the pivot with the resistors on the pivot end as I showed. If that doesn't solve it, then put the shunt resistor at the pivot end as Jim showed in post #2.
     
    Last edited: Sep 9, 2017
  16. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,324
    Likes:
    585
    Location:
    Peterhead, Scotland
    ONLINE
    When I first read this thread, I made the assumption that the "65volts" was a phantom voltage coupled into the wire by stray capacitance from another live wire.
    This lead me to suggest the 10k resistor solution.

    However, when I read further information supplied by the OP, such as:

    I am convinced that something else is happening.

    The 65v is very close to half of 120v, and appears to be a low impedance source.
    The problem could be due to (say) two solenoid valves in series across the live/neutral supply and the phantom powered wire being connected to the centre point of the two solenoid valves.

    JimB
     
  17. schmitt trigger

    schmitt trigger Active Member

    Joined:
    May 24, 2009
    Messages:
    885
    Likes:
    84
    I'm in agreement with JimB. By the problem description, that "phantom" voltage appears to have way too much power capability to be caused by simple stray coupling.

    A little OT: I like Toshiba optocouplers. They are available in many specialized configurations, like this one, with the antiparallel diode already built in.
     
  18. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,253
    Likes:
    961
    Location:
    Loveland, CO USA
    The opto isolator has two LEDs. Not a diode and LED.
    The current transfer ratio, (LED current to Collector current) is different for the two LEDs.
    If the current from the positive half of the power line caused 1mA on the output the negative power line voltage could cause a output as high as 3mA or as low as 0.33mA.
    upload_2017-9-9_20-30-42.png
     
  19. embedded_sys

    embedded_sys New Member

    Joined:
    Sep 8, 2017
    Messages:
    21
    Likes:
    1
    What if I tried something a little more complicated? I found two articles on building High/Low voltage cut off circuits. This one uses op-amps and this one uses transistors. I definitely want to go transformerless to keep costs down. This takes up a lot more space, but it seems like the only solution at this point. Anyway to use just an op-amp comparator and compare the input voltage to 120VAC?
     
  20. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,910
    Likes:
    1,095
  21. embedded_sys

    embedded_sys New Member

    Joined:
    Sep 8, 2017
    Messages:
    21
    Likes:
    1
    This looks really promising. I believe the following will work.

    Vth(+) = 5V (From Datasheet)
    Ith(+) = 2.77mA (From Datasheet)
    V+ = 98V (My desired turn on voltage)

    Rx = (V+ - Vth(+)) / Ith(+)
    Rx = 33,574 ohms

    Rx/2 = 16,787 ohms

    Screen Shot 2017-09-12 at 2.52.21 PM.png
     
    • Like Like x 1

Share This Page