Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Joe Job
#52187
Barnabybear wrote:Hi,
So with the relay you use the AC in would go to 1 and AC out would go to 2?

Correct.
Is it possible to do this on a breadboard I am not working on PCB's yet?

The SSR (Soild State Relay) will fit on bread board but personaly I never would and you shouldn't! Just solder some wire onto the SSR leads then cover any exposed jounts. You'll only have 3.3V on the breadboard and that won't kill you.


Hi sorry one last question on this, well a couple actually ;)

So when the AC in goes onto the circuit can you use normal jumper wire to run to the input of the SSR ? Same question also applies to the blue wire as well for the light.

If I am correct the blue and the brown wires are connected to the dc module inputs (is there any particular order for these two inputs), the brown is then connected to 1 of the SSR and the blue is connected to the blue wire of the second terminal via an additional jumper wire, then brown on the second terminal is connected to 2 of the SSR using a jumper wire.

Lastly are the terminals necessary or can the inputs and outputs be directly soldered to the circuit.

Thanks in advance mate.
User avatar
By Joe Job
#52882
Barnabybear wrote:Hi, if you just want to switch an AC light which you hadn't stated before. you might be as well using an opto coupled relay to save on extra components. I've used these without a problem. 3 + goes to 3.3V, 4 - goes to your GPIO and AC is switched on 1 & 2, nothing else needed other than a 6mm gap between high an low voltages. The output is inverted so you just have to reflect this in your code. Depending on which GPIOs you use the may flicker at startup or reset, in total you can have 4 on an ESP8266-01 if you set the Tx & Rx pins to function as GPIOs.
Link to post


Hi this is not working I have completed the circuit and tested and is receiving the command via mqtt to turn but digitalwrite s not switching the switch at all have tried digitWrite(0) and digitalWrite(1) but nothing any ideas mate.
User avatar
By trackerj
#52884 If you don't want to use a Relay then the easiest way to switch MAINS is with a Triac.

For a quick test setup you can do a wiring like in the WIFI Web Power Switch for MAINS post.

Add your PIR Motion sensor detection as in this "ghetto-style" example and that's it, you have a fully functional MAINS power switch with motion detection.

If you want a more elegant and compact board you can do a similar one as the one described in the MPSMv2 post :

Image

For the MPSMv2 they are even bare PCB's available directly from DirtyPCBs.com.

For a ready made MPSMv2 module or some bare PCBs but with delivery from EU, you can contact me directly.
User avatar
By Joe Job
#52885 Thanks I do want to use a relay though I have just bought all the parts but the switch is not switching at the moment, I have got it all sorted apart from this OTA is sorted so I am programming the device over the air but digitalWrite is not triggering it.

Thanks I will try yours out soon for now I need to get this finished. Will be in contact got a few projects to do first.