0
\$\begingroup\$

I am a software developer, sorry if my question may sound dumb.

I want to make my home smart by controlling lights through a centralized smart home web page. So rather than buying ready-made wireless unit I want to make it by myself (it will be a fun and satisfying).

A centralized Web page will contain buttons for lights in my hall/kitten/bedroom. So while search for this I come know about ESP8266 wifi module which works on STA mode. Also, I may need a relay which will take signal from wifi module and on/off the light but as I am a novice in this I have some questions:

  1. Which ESP module need to be selected? there are two variants I see on net one is NodeMcu and another is ESP-01, which one I should go with?

  2. If I want to control 2 lights from a light switch panel, then is it possible control it by using 1 wifi module and 2 channel relay module or I have to buy 2 wifi module (no. of lights in a panel = no. wifi module) one for each light?

  3. Both relay and wifi module works on 5v, What should I use to pull 5v from the 250v power supplier? On net I've seen switching power supplys but these are all bulky and contain transformers. I was hoping that there was a smaller solution.

\$\endgroup\$
1
\$\begingroup\$

p.s.: From the level of your questions I assume you are starting with electronics, and I should say this is not recommended as a first project because mains voltages can kill or severely harm you either due to direct shock or fire, etc. Please consider doing a similar project controlling lower voltages first (12VDC for example).

1.NodeMCU will give you much more GPIO and is arguably easier to develop on due to the onboard USB to serial converter. It is also easier to plug into breadboards.

2.You can control 2 relays with 2 outputs from the same microcontroller (with the appropriate driving circuitry, unless you are using modules like this or similar, which already contain the driving circuitry). No need for one ESP for each relay.

3.You can probably use a 5V phone power supply ("charger"), provided it can supply enough current for all the relays you are using.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Hey! what a quick reply. what is mean by "with the appropriate driving circuitry" do I need to do something special, as I am novice in this I'd like to know. Sorry if this sounds dump. and in case #3 you mean to say two chargers one for ESP and one for relay switch? \$\endgroup\$ – Amogh Oct 29 '17 at 7:15
  • \$\begingroup\$ While searching I have found this power supply module, is this enough for both ESP and relay? \$\endgroup\$ – Amogh Oct 29 '17 at 7:24
  • \$\begingroup\$ Many relay modules will come with appropriate drivers (i.e. a small transistor and protecting diode) embedded. If you are making your own, you can follow the schematic I provided, there are many similar examples online. The 220V AC to 5V DC converter can be a phone USB supply such as this. Your NodeMCU and relay will probably draw a few hundred mA each at worst case, so 1Amp will be enough for them, unless you use too many relays. The power supply module you linked is not enough, it only converts up to 9~12VDC to 5VDC. \$\endgroup\$ – Wesley Lee Oct 29 '17 at 7:29
  • \$\begingroup\$ Thanks for answers and p.s as you said I will first do with LEDs by this I will more idea. \$\endgroup\$ – Amogh Oct 29 '17 at 7:39
  • \$\begingroup\$ Both -01 and -12 ESP8266 modules you mentioned above are based on the same "pcb-built-in-antenna", which differently from those which allow external antennas, for certain cases this will a bit restrict the place to deploy the system, as for example within a socket slot or anything else. therefore you have to be aware of the range aspect. \$\endgroup\$ – aluis.rcastro Oct 29 '17 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.