-->
Page 1 of 2

Control Light Switches using ESP-12F

PostPosted: Tue Oct 04, 2016 10:13 am
by polyfaces
I have a new idea of control lights in my new house. After study around the Internet, I decided to create my own circuit to achieve this. Basically, the board will control 3 power relays (2 solid states and 1 mechanical) with temperature sensor.

I am a paranoid person, especially that the circuit would have to deal with mains. Therefore, I would like to ask for experts advice for my attached schematic or spot out any serious mistake. After all, I believe it would be a nice learning experience for me.

Imagepicture upload

Re: Control Light Switches using ESP-12F

PostPosted: Tue Oct 04, 2016 2:25 pm
by jankop
1. Add pullup resistor to GPIO2 and pulldown resistor to GPIO15.
2. Protective diodes for Q1

Re: Control Light Switches using ESP-12F

PostPosted: Tue Oct 04, 2016 3:52 pm
by ygrignon
Recommended value for pull-up resistor on the 18B20 data line is 4,7k.
Base resistor for the switching transistors should be (3,3v-Vbe)/((load current*3/hfe). If we assume Vbe to be 0,7v, hfe to be 100 and load current to be 50 ma, the base resistor should be 1 733 ohms. The standard value of 1,5k would work fine.
It may be a good idea to put a 0,1mf cap across Vcc and Grd of the ESP.

Re: Control Light Switches using ESP-12F

PostPosted: Tue Oct 04, 2016 8:05 pm
by polyfaces
jankop wrote:1. Add pullup resistor to GPIO2 and pulldown resistor to GPIO15.
2. Protective diodes for Q1


Thanks a lot :D

1. Oh, that's a trivial mistake for me ...
2. Just to confirm, the protective diode for Q1 prevents the back EMF from the relay coil damaging the transistor, therefore those for SSR is not needed, right?


Can I use LED as a protective diode for Q1?
I plan to use 0402 surface mount for all 10k resistor, will there be an issue? (despite it requires sophisticated hand soldering technique) Current = 3.3v / 10000 ohm = 0.33mA, I guess the power dissipation (0.001089W) for the resistor should be fine.