0
\$\begingroup\$

Being super original I've made a DIY Thermostat with an ESP8266. Being a bit of a novice (I'm learning). I've run in to some sticky bits with my kit. For the most part it works fine, but when turning on a 3v Relay to make a connection between AC Live and the Boiler (To turn it on) do I run in to an issue... The power from the transformer just,.. goes and then recovers a split second later. But this causes the ESP8266 module (and relay) to lose power causing a reset.

This isnt the ESP8266 shutting off, I have a cheap oscilloscope and I've monitored the V+ line and I can see when the relay goes on occasionally the power fails from the transformer.

Circuit (A Battery symbolises 3.3v input, sorry):

schematic

simulate this circuit – Schematic created using CircuitLab

The transformer is very similar to this:

https://www.ebay.co.uk/i/182200000506?chn=ps&adgroupid=13585920426&rlsatarget=aud-295856144804%3Apla-142405595586&abcId=&adtype=pla&merchantid=113593976&poi=&googleloc=9045866&device=c&campaignid=207297426&crdt=0

The only thing I haven't tried is shutting off the WiFi every time there is a relay change, I've heard the current draw from both could be enough to cause a problem. Its annoying its intermittent, it used to be a lot worse. But its still far too regular. All help is much appreciated, Thanks in advance.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Off the top of my head the power module cannot keep up with the surge current of the relay plus esp draw. That 470uF may not be enough. \$\endgroup\$
    – Passerby
    Commented Dec 8, 2017 at 1:06
  • \$\begingroup\$ Even though there's two of them in parallel? C1 + C2? \$\endgroup\$ Commented Dec 8, 2017 at 11:16

2 Answers 2

1
\$\begingroup\$

The relay will draw about 132 mA steady state. V = IR, so I = V/R = 3.3/25 = 132 mA. The ESP8266 can draw up to 170 mA, on an intermittent basis. The radio goes in and out of sleep mode, thus you may have intermittent issues if your 3.3V supply is not able to provide sufficient current.

It looks like the supply you chose is rated for 700mA, so that should not be a problem. The issue may be related to the inductance of the wiring. I see that you have a capacitor, C2, in the schematic for that purpose, but you need to be sure it is very close the the module leads of the ESP module or it will not help. Also the inrush current of the relay can be much higher that the holding current, and it will draw more current when first turned on. Again a capacitor very close to the emitter of Q1 to ground will help.

Bottom line, your problem may very well be layout related, not schematic related.

\$\endgroup\$
2
  • \$\begingroup\$ The problem was far worse when the relay was sat (literally next to) the converter. The Relay is now situated on the other side of the junction box, so I think you're right. There is some form of interference. Any ideas on cap values between Q1 Ve & GND? \$\endgroup\$ Commented Dec 8, 2017 at 11:24
  • \$\begingroup\$ In that case you might find that a snubber circuit (RC) over your relay contact helps. Unfortunately for you don't know how to calculate what values you need. \$\endgroup\$
    – Oldfart
    Commented Dec 8, 2017 at 15:28
1
\$\begingroup\$

If max Coil current Ic=132mA = 3.3V/25ohm for an ideal switch and Base current Ib= (3.3-0.7)/1k=2.6mA With this current gain of 132/2.6=50 requires a special ultra-low Vce(sat) rated transistor. For the 2N3906, you can expect Vce>=1V which drops the coil current to <= 2.3V/25R = 92mA

You need to consider 10:1 to 20:1 ratio for a low voltage supply like 3.3V
Start with R1= 10 x 25R = 250 ohm

However if your supply dips, that must be fixed. Most 3V relays need at least 2/3V to guarantee run on.

For C=470uF and coil= 25R, RC=11.7ms which is not big enough to supply the surge current to switch the relay unless you have a supply that can deliver

Better design choices will fix the problem , using a DMM or scope ought to identify the problem quickly. WiFi peak current can be large, so your supply may be under-rated.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks Tony, where would I stick my probes if I use a DMM? What should I be looking for? I'd already noticed that the supply voltage sometimes goes to 0v when the relay is switched on (DMM on VCC/GND of ESP8266). During testing, turning the relay on/off in quick sucession would pretty much guarantee a brief blackout. \$\endgroup\$ Commented Dec 8, 2017 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.