This is my second project i made. Though the first project was from a relay module that was already set up. Now i've tried to do some research and set up things like they are showing now.
I am going to connect a 12v adapter on this circuit.
I'm not sure about the amount/type of capacitors and the usage of the optocoupler.
The idea behind the optocoupler was to seperate the ESP from the relay possible voltage spikes. But in the end they share the same ground which could still potentionally damage the ESP. For this I added the diode at the ground for the ESP.
Oh and yes, the ESP is sending a signal over the RX pin. If i use other pins it will get stuck on boot.
Is there anything else I should add or remove from this circuit?
What this project will be doing is after receiving a MQTT request, open a garage door (which is a button that closes a 24v circuit) The relay will be connected in paralel so the door can still be opened by the button and be opened with this system. This will also close the door again.
I can monitor the status of the door because of a doorcontact i've installed on this garage door.
So if the door didnt close i can make an automation to handle that or inform me.
Please - post a proper schematic if you want feedback. Fritzing pictures are particularly useless for circuit design reviews.
There are obvious errors in what is shown but we don’t know if it is because of the crappiness of Friztings in general or if you really do have things wrong like shorted capacitors and incorrect transistor connections. Everything starts with a proper schematic.
Ah, so all the mistakes are in the schematic. Unfortunately the new forum software prevents me from seeing your post why I type my reply.
There are simply too many things wrong and corrections cannot be easily described. Virtually every component connection point is wrong.
I would start over by deleting all connections, leaving all components and then start reconnection, verifying each sub-circuit like the caps and regulators by looking for online examples.
You do not need/want the optocoupler, it does nothing when the common of the relay supply is common to the esp module.
Here is a good starting point. It is missing the required bypass capacitors for the voltage regulator. Look up the datasheet for the regulator if you’re unsure of values and placement.
GPIO2 - as well as GPIO0 - must be pulled HIGH to boot, this circuit pulls it LOW. You need to use a PNP transistor to control the relay which will have its emitter connected to 5 V. But then the 3.3 V HIGH output of the ESP wodul turn it on anyway, so you would want to add a red LED in series with the 1k resistor to the transistor base to drop the excess voltage.
It would work but better to use a ready-made opto-isolated "active LOW" relay module.
And far more practical to just use a support module for the ESP-01 like this:
Thank you both very much!
I've been looking at lots of video's. Even then, seeing so much eventuelly confused me.
So thanks to give me a visual of how it suppsed to start looking.
I've taken both of you advices, took a peek at the datasheet of the voltage regulators and below is what i've made out of it.
@Paul_B I do have such programmer! And indeed what you say is correct about the pull up part. I'll try to set things up as you suggest, hopefully I can just simply use GPIO2 instead RX pin.
I would like to present you the result. It aint the prettiest work. But what it does, is pretty nice
I've looked around a lot about PCB soldering, sadly I wasnt able to manage to get some wire to make the connections. The wire I had was not a solid core either. So I went with the solderingbridge approach. That is actually harder then it looks! So I also ended up abusing the legs of the components to save some time.
Not sure what solder you are using.
A tip with these sort of boards, because the copper is not tinned, the copper will tarnish.
I usually give the board a scrub with soapy water, or a mildly abrasive cream cleaner before soldering.
Give it a good dry with some heat.
You will find the solder will take to the pads better.
Thats a very good and helpfull tip!
I just tried this and I didnt expect the board itself would be that dirty! Those pads realy gotten a shine now. I tried a bit of soldering on it half way and it does seem to stick better, atleast i feel less of creating "cold joints" on it now and could just focus on getting the pads connecting to eachother.
The solder is leadfree and im currently using it from Felder, 0,75 size wire with 3.5% flux in it.
I detest lead-free, at my work I only use lead solder, to give quick and reliable joints.
A lot of our repairs have been to lead-free solder under mechanical stress, also a dry joint is not as easy to see.
If you are wary of lead solder, then use an exhaust fan to suck the smoke etc away.
I am happy I have a stash of “real” solder that right now looks like it might last, if not the rest of my life, at least as long as I have any interest in or need to solder.
Breath deep, haha. OSHA probably not too happy with it, my ventilation consists in a long time habit of exhaling while producing noxious fumes.
Wire-wrapping still has a place in my toolkit. If it was good enough for IBM, it's good enough for me.
Some of the pins that were made by Vero are sill available, but the Tefzel wire costs a fortune, though a small original outlay does go a long way and some of my reels are 40-years old.
Cheap male header pins are made with steel, are square and actually quite good for wrapping.
I use FR4 pad boards for more finished projects, and the coloured Tefzel makes for easier tracing.
For higher current traces, solid wire from domestic mains cable is good and for in-between stuff, stranded alarm cable cores is a useful source of multi-coloured wire, as is CAT5e.
The board shown might work, but personally, I like them to look reasonable as well.
For soldering, I use low-melting point solder and always a good flux like ChipQuik SMD.
On a good day, I can do TQ packages and small outline devices like the Atmel SMD versions.
Years ago, I did use a PCB design system linked to a robotic arm that did the etch resist and drilling, but I haven't had the time to relearn a new design system.
As TomGeorge says, bare copper boards will always need cleaning up, but gold flashed or tinned boards are always better.
Finally, a dip in an ultrasonic bath and an inspection under a well-lit magnifier reveals what you thought were good joints, but weren't