Opto-isolator (MOC3031M) and Triac (BT136-600D) not working

Hello,

I am trying to use an optoisolator (MOC3031M) and a TRIAC (BT136-600D) to switch a light on using the ESP-01.

The load doesn't seem to want to come on and I can't work out why as far as I can tell I have the circuit correct so I'm a bit stumped.

GPIO on the Fritzing is connected to a pin of the ESP-01 and GND is connected to a 3.3V ground. What I haven't put on the Fritzing is that there is an IRM-02-3.3 PSU linking the 240V to the 3.3V side.

The LED comes on and off as it should do with the GPIO going HIGH/LOW so I can only assume that means the optoisolator is turning on too however no light connected to the load lights up. When I first put 240V to the circuit, the load flashes on and then off so this suggests to me that the load wiring should be correct and maybe that the TRIAC isn't working?

MOC3031M Datasheet: http://www.mouser.com/ds/2/149/MOC3031M-195882.pdf
BT136-600D Datasheet: https://docs-emea.rs-online.com/webdocs/13d1/0900766b813d1a05.pdf

Pin 1 on the opto-isolator isn't connected to anything...

The opto-isolator and LED should have separate current-limiting resistors.

...I'm still trying to convert your Fritzing diagram to a schematic in my head so I might come-back with something else...

DVDdoug:
Pin 1 on the opto-isolator isn't connected to anything...

The opto-isolator and LED should have separate current-limiting resistors.

...I'm still trying to convert your Fritzing diagram to a schematic in my head so I might come-back with something else...

Oops. Was cause I moved the MOC chip in Fritzing. Pin 1 is connected to the GPIO. I've corrected that in the original post and added a schematic below.

Schematic attached

Okay I'm an idiot! Just worked out why it wasn't working. I'd stupidly connected another resistor between the optoisolator and GND and hadn't noticed I'd done it so the total resistance was meaning there wasn't enough current to turn it on! DOH!