logo elektroda
logo elektroda
X
logo elektroda

Detection of the presence of 230V AC mains voltage - digital signal for the microcontroller

MES Mariusz 2193 6
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18819604
    MES Mariusz
    Level 36  
    Posts: 5452
    Help: 8
    Rate: 222
    What's top of mind right now when it comes to 230V AC mains voltage detection?

    I need to tell the digital input of the microcontroller whether mains voltage (230V AC) has been applied to a particular terminal.

    A circuit with an optocoupler (like a zero crossing detector)? Or maybe a very miniature relay with a 230V AC coil (it seems that they - with such a coil - are not miniature at all).

    Or maybe there are some dedicated, specialised mains voltage detection circuits that return an adequate, low-voltage logic level that can be fed into the microcontroller input ?

    Target: cheap, miniature (minimum extra PCB space), reliable.
  • ADVERTISEMENT
  • #2 18819612
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 18819667
    Krzysztof Kamienski
    Level 43  
    Posts: 21874
    Help: 2029
    Rate: 5126
    CC116 wrote:
    Other than that, it is the optocoupler that leads the way.
    Yes, but......
    https://www.elektroda.pl/rtvforum/topic3710010.html
    Oh, but how to connect the LED correctly to the network, i.e. the optocoupler too.
  • ADVERTISEMENT
  • #4 18819680
    Jogesh
    Level 28  
    Posts: 3669
    Help: 33
    Rate: 679
    How about special photocouplers such as the SFH628A-4 TLP182? I will be testing a similar arrangement soon.
  • ADVERTISEMENT
  • #5 18820874
    Anonymous
    Level 1  
  • #6 18821073
    dariusz.bembenek
    Stationary Alarms specialist
    Posts: 2139
    Help: 455
    Rate: 614
    Finished PMT product on optocoupler:
    https://ropam.com.pl/product/pmt/

    O.C output, that is "ideally" under the uC.
  • #7 18825768
    tmf
    VIP Meritorious for electroda.pl
    Posts: 14318
    Help: 2090
    Rate: 2203
    If galvanic isolation from the mains is not required, then 2 resistors of 1 MOm each will suffice - one between the IO pin and the wire, the other between the GND of the prock and the other 230V wire. Theoretically you can on one resistor, but usually resistors have an operating voltage up to 200V, so two will provide safe conditions. If separation is required, however, an optocoupler, necessarily with two anti-parallel diodes on the structure. There is nothing to combine in such a simple circuit.

Topic summary

✨ The discussion centers on methods for detecting 230V AC mains voltage for microcontroller input. Various solutions are proposed, including using an optocoupler, a voltage divider with resistors, and a reed switch activated by current in a nearby wire. Special photocouplers like SFH628A-4 and TLP182 are suggested for testing. If galvanic isolation is not necessary, a simple circuit with two high-value resistors can suffice, while an optocoupler with anti-parallel diodes is recommended for isolated applications. The focus is on achieving a compact, reliable, and cost-effective design.
Generated by the language model.
ADVERTISEMENT