Data connection to switch

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ajocius
Posts: 83
Joined: Mon Feb 19, 2018 6:31 am

Data connection to switch

Post by ajocius » Sun Feb 07, 2021 11:45 am

i have 12V power line running via switch controlled by ESP32. Data is connected to let's say Pin13. Project is set that movement detection sensor registers movement and ESP32 sends signal to switch via Pin13, which turns LED lamp on. I would like to add Alexa command to turn LET on, that will shoot MQTT message to ESP32.
Question: Should I use same Pin13 to turn signal on for both cases? Use same switch, but wire two data cables (one to Pin13 other one to Pin12)? or use separate ESP32 pins and separate switches ?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Data connection to switch

Post by jimmo » Mon Feb 08, 2021 6:26 am

ajocius wrote:
Sun Feb 07, 2021 11:45 am
Question: Should I use same Pin13 to turn signal on for both cases? Use same switch, but wire two data cables (one to Pin13 other one to Pin12)? or use separate ESP32 pins and separate switches ?
Can you explain more about what you mean by "switch". If the switch only has one input, then you only want to connect it to one pin on the ESP32 (otherwise you'll end up in a situation, for example, where you're driving Pin12 low and Pin13 high)

Post Reply