Would you use a ESP32 board as a light switch?

Hy,

I am contemplating for using a EPS32 board directly as a light switch. There is no other wiring near the socket and I would just use the pullup/pulldown resistors on the board. Would I be facing problems down the line?

Thank you

I don’t see any specific problems other than power supply. If you only have light switch - do you have both live wires there? Light switches generally only have live (phase) and return wire (back to light), while neutral is missing. If you do have it, you’ll just have to use 230v–>5V (or 3.3) module. And, of course, a relay.

Second on the above, the power may be an issue.
fwiw, for a few of similar challenges, I use a zigbee (I know … not esp) switch which I stripped of the box and could build-in. The switch also allows to use the main light-switch, so I can use both manual as automated on/off

I will deliver 5v directly to the socket and that will be the only power going to it. All I need is just a MQTT connection afterwards so the light switch operates as a simple MQTT on/off command sender and the main (220v) controller then turns on the light.

If you’re gonna use an ESP, might as well just natively ESPHome. Much easier than MQTT.

1 Like

Depending on what part of the world you live in, this might or might not be an issue. Depending on if you have fire insurance, it might or might not be an issue.

There are commercial products (some can use esphome) that are UL listed and others that have other certifications that are likely much safer than something you can cobble together. They frequently are not that expensive. Just remember, it isn’t an issue, until it is and when it is, you will likely wish you had made a different choice.

If you are committed to Home Assistant, this is okay advice. I use other things, but still like esphome and use mqtt. I find this MUCH easier than using Home Assistant, your experience may vary.

I am not sure how many watts an esp board can deliver.
It might not be enough for your bulb.

1 Like

I would not do this. The ESP is fine, but rather drive a relay to switch the light. Let the power to the light come from the source that also drives your ESP.

Basically, this is what Shelly has built.

1 Like

Or a sonoff s20.

1 Like

Might not be enough? Ya think? If you dont know the max output on a gpio, its very simple to find out by doing a quick online search. GPIO’s really arent meant for driving loads and better for driving the thing that is driving the load such as a relay or a mosfet.

What are you you using with the esp32? You arent asking avout directly driving a 220v light with an esp32, right?

If all you need it for is turning a 220v light On/Off then, I’d recommend something like this instead of an esp32 which would be way overkill.

These are esp01 w/relay modules and work excellent for things like what your needing.

Make sure you also have or buy a programmer for the esp01 board too.

Not so simple at all. Different Esp chips have different specs, some pins have different capabilities and sinking /sourcing currents are different. But most importantly Esp has configurable drive strength 0-3 and default setting is 2 which gives ~20mA source current.

Are you joking? Its not so simple because there are different models?

Thats exactly why it’s so simple! You look up your board and find its spec sheet and it doesnt get simpler than that. Well its simple as long as your looking up the right information and actually read it, which id suggest you do regarding your image becaus, your assuming most people and OP are using a bare esp32 chip and they aren’t using that, they’re using an esp32 dev board which has its own spec sheet and only referencing the espressif spec sheet would be the wrong one to use.

Quit making excuses.

Well, it’s simple if you don’t read the datasheets and just ask AI to give you simple answer.

What excuses? What are you smoking?

Just to clarify, you’re advocating that its to hard for people to look up specific details regarding their esp board?

No but most of us don’t enjoy to read tables like this:

I could not from the thread derive what kind of bulb/socket OP was going to use.
If it was a half watt GU10 bulb then the ESP could maybe feed it.

Can this be changed within esphome? If so, how (which command)? If not, this information is pointless.

Not a chance. Unless it’s led you can’t drive any light, it’s not ment to be driven, too. Not to mention that i didn’t find a light bulb on 3.3V yet…