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

User avatar
By martinayotte
#49751 For the capacitor nearby the ESP, between GND and 3.3V, it is something such as 47uF or 100uF, doesn't matter, maybe along a small 0.1uF, all in parallel.

For the diode on relay's coil, it is simply that a coil is inductive and when turn off, it produce a spike, if not discharge by a diode, it will disturb the power supply of the coil. Here is a schematic (you can use a plain diode such 1N4001 or equivalent) :
Image
User avatar
By Joe Job
#49879 Thanks I added the capacitor and also connected the ESP8266 to power from the programmer and and the rely to power through an AVR programmer. So this leads me to next question if you don't mind helping on that not sure whether to start a new thread or not, in this exact example, what would be the best way to externally power it, the plan to get rid of the ATMEGA was to hopefully reduce the need for two power supplies, a 9V isn't strong enough and it seems to AA are not strong enough what be the best power option and expected life?
User avatar
By Joe Job
#49949 Well this has decided it no longer wants to work, noticed that it had stopped turning on and off from the MQTT, took it back to the stage where we removed the ESP, have tried 5 different mosfets and 5 different relays and no longer works, am giving up with the ESP as primary controller, the ATMEGA using ESP as data service seems the better option.
User avatar
By Joe Job
#49954 Well not able to admit defeat I spent some time over my lunch break and found out that in the case of the barebones version it was the pullup resistor, if I removed the resistor and connected the middle leg to 3.3v directly it worked.

Following this I reset up the ESP into the circuit and I now have strange issues, I cannot upload without GPIO2 connected directly to 3.3 without resistor and then the relay will not turn on without the 3.3 being removed, then after that I cannot reset without it connected.

It also keeps crashing serial monitor when the light is connected to the relay and I have to restart the computer.