logo elektroda
logo elektroda
X
logo elektroda

How to combine a 12v chip (touch switch) with a 3.3v chip (esp32) or a 5v ...

Primo83 915 1
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20034887
    Primo83
    Level 5  
    As per the topic. I am creating a DIY home automation at my home based on a raspberry pi (Home Assistant), esp32 mcp23017 to control relays and receive simple signals. I would like everything between esp32 mcp23017 to be wired together. The problem is that I can't find nice touch switches based on cable and 5v. I have a 12v switch and it can be set to high or low, the high 12v signal doesn't really fit the mcp23017. I understand that low can't really be used in a 5v circuit either?

    I have 3 questions:
    1. how to plug this switch into my circuit?
    2. maybe there is a better solution to my problem?
    3. general question: How are popular home automation systems and more constructed since they run on 12/24v and sometimes higher since all microcontrollers run on 3.3/5v chips? Can you know of any source to read? I can't find one on google, or I'm asking the question wrong.
  • ADVERTISEMENT
  • Helpful post
    #2 20035509
    khoam
    Level 42  
    Generally, the solution to the problem would come down to the use of suitable logic level (state) converters, for voltages such as 12V or 24V when 'switching' to 3V3 or 5V logic, rather optoisolators are used. These are solutions for unidirectional data transmission.

    Or you can simply use simple voltage dividers to reduce the input voltage from 12V or 24V to 3V3/5V. For example, to 'convert' 12V to 5V:

    How to combine a 12v chip (touch switch) with a 3.3v chip (esp32) or a 5v ... .

    The Zener diode provides protection in case the input voltage of the processor is too high.
ADVERTISEMENT