Control SLA-05VDC-SL-C Relay with NodeMCU ESP8266

As the title says.

What hardware/parts will I need to do such thing?

How about this:

Paul__B:
How about this:

This looks good, but what about converting 240v to 5v for the ESP8266 itself?

Power the NodeMCU with a 5volt cellphone charger, connected to the USB socket.
And power the relay module from the VDDUSB (V-in) pin.
Leo..

Curious about your reference to 240 VAC. Is this your mains power?

Reference to 240 V suggests Australia.

Paul__B:
Reference to 240 V suggests Australia.

Lots of countries use 240V: UK, India, Malaysia, Kenya...

This page suggests both UK and Australia use 230V.

On this page it says

The voltage used throughout Europe (including the UK) has been harmonised since January 2003 at a nominal 230v 50 Hz (formerly 240V in UK, 220V in the rest of Europe) but this does not mean there has been a real change in the supply.

Instead, the new “harmonised voltage limits” in most of Europe (the former 220V nominal countries) are now:

230V -10% +6% (i.e. 207.0 V-243.8 V)

In the UK (former 240V nominal) they are:

230V -6% +10% (i.e. 216.2 V – 253.0 V)

This effectively means there is no real change of supply voltage, only a change in the “label”, with no incentive for electricity supply companies to actually change the supply voltage.

To cope with both sets of limits all modern equipment will therefore be able to accept 230V +/-10% i.e. 207-253V.

After Brexit, we will probably have to go back to horse and steam power...

Wawa:
Power the NodeMCU with a 5volt cellphone charger, connected to the USB socket.
And power the relay module from the VDDUSB (V-in) pin.
Leo…

I want to power it using the main power, the same that I will be using with the relay.