hardwareFirst problem coming up… ESP-01 programmed to accept MQTT and turn a light on and off – GPIO2.  Works a TREAT on the rig, time and time again.

Put it on a board with a Chinese 3v3 supply and a solid state relay (which does work just fine on 3v3) and… disaster – blue light on almost permanently – will NOT respond to any commands… I’ve tried a 330u cap across the power… it’s not having it (CH_PD is tied to power, all else open).

Oh dear. No idea whatsoever – except the RX pin is oscillating!!! Put it back in the test rig – no problem…


25 thoughts on “ESP-01

  1. Check ground wire. If it is not thick enough, you will have oscillations – it should be a really thick one..
    Explanation: when high current is flowing (for example in transmission), if the resistance of the ground wire is high, there will be a voltage building on it and the esp will therefore receive 3.3V MINUS the voltage on the ground wire. suffice it will go down to 2.9V and the esp will turn off – i.e. less current and less voldage dropout on gnd… This means nasty oscillations … :

  2. Increase the output capacitance.
    Apart from that power supply problem, you should ‘isolate’ the ESP power from the relay power. If you don’t do it the ESP may reset when the relay turns on.
    Normally I use a LC filter (for the microcontroller – not the relay), but Espressif recommends to not put any inductance in the ESP power supply. So the best way I see is to use an LC filter but with a big capacitance. Try to put a 10uH + 470uF or even more.

    I also ordered some crap power supplies like that one. Didn’t arrive yet. But I’m afraid they catch fire and burn the house. Probably I’m going to make my own power supplies or use some very good 5V supplies from old HP PDAs and add a 3.3V regulator.

  3. Well, I nearly beat you to burning the house down – my first attempt I wired the power supply the wrong way around – wiring the output straight to the mains – you can imagine there was a very loud bang before the breaker kicked in… the only thing that suffered was the supply fortunately. One down, one to go.

  4. It gets worse – if I disconnect the solid state relay – still no good – if I feed DC from a supply instead of the Chinese supply – works – if I then reconnect the solid state relay – it’s not working again. So it looks like I have TWO problems. This needs thorough understanding before starting to deploy these things around the house.

  5. I guess that you turn-on the system via mains.
    Just for curiosity, connect first the power supply and then the ESP and tell the result.

  6. hum… you’re using a solid state relay. What I said about ‘isolating’ the power supply because of the relay is for coil relays.

  7. I have my SSR arriving soon… first thing i’ll check is if the esp8266 can put enough current into it… there is a max output current in the esp8266 GPIO and a minimum input current in the SSR (not only minimum voltage). check your SSR specs… i think the think max output current of esp8266 is about 12 mA.

  8. I wonder about noise from the unshielded supply. Is the RX line pulled up/down? Does the breadboard setup work when a running (though unconnected) supply is in close proximity?

  9. The new power supply seems suspect, certainly.

    Do you know what ‘on’ drive current is required by the SSR? Also, try powering up the system with SSR disconnected from the GPIO2, confirm the ESP8266 boots up and is working, then, while still powered, connect the SSR to GPIO2. If the ESP8266 continues to work this time, including the SSR now, it suggests that the SSR is an unacceptable load during powerup (eg it momentarily pulls the GPIO one way or the other at boot, which apparently can be a problem). Transistor drive of the SSR would also avoid this, probably. 2N7000 is a nice small MosFET switch for such applications.

    Good luck

  10. not sure if its related, but i burned out two 3.3V supplies (500mA and 650mA) when simply trying to power an ESP-01. both worked fine before hand, and i’d been powering the ESP off a USB-FTDI dongle. when i connected them to the supplies, i smelled something and neither supply works now. the ESP is fine.

    • I think I’m going to give them a miss after this – if cost is an issue – and it is – I’m thinking a little board to mount the ESP – with a 3v3 linear reg and power THAT off a cheap 5v switched supply. Clearly they don’t like switched supplies directly – a real shame.

  11. used 220v AC to 5v DC connected to the coil relay – + (controlled with signal 3.3v from GPIO2). Used voltage regulator 5V to 3.3V for the ESP.

  12. Some switching power supplies require a minimum dc current to regulate properly, the circuit might not draw enough current to maintain a steady dc voltage for the ESp.

  13. I agree with Ken about the initial pulldown on GPIO2 at boot up. Even with current limited to 2mA to ground, my esp’s locked out. I still have to check that port under start up conditions to see if any drive delays need introducing. It maybe that active pulldown drive solves this issue.
    You could try reversing your ‘active’ state and connect +ssr to 3v3 and -ssr to the port, depending obviously on the current draw of the ssr.
    Really best to use a mosfet driven by the port though. Small 1.8v turn ons are a plenty nowadays. At minimum, take all higher current paths from the source rather than wiring through, in order to minimise v drops and glitches etc. Any relays should have reverse diodes across the coils, to prevent induced spikes which can cause resets. ( if the added turn off time can be tolerated – only tens of mS)
    Use 600V ssr’s on mains for greater reliability, and have plenty of current headroom.
    not related …..
    maybe of interest (or not as the case may be!)


  14. That link of yours I’m going to look at now – if you take a look at node-red – it does a spiffy job of translating from MQTT to other formats, though as a beginner I could not figure out how to get anything to go to HTTP other than a GET.. not too well documented. I’ll take a look at this.

    The OMRON G3MB-202P SSRs say load 240vAC – they don’t say what max voltage is.. time will tell and yes, clearly on real relays, ALWAYS use a diode. Perhaps some diagrams for real beginners might be in order – I just take this stuff for granted as I’m sure you do. Your active pull down suggestion – yes, probably right – need to solve the PSU problem first as the ESP will not even listen to messages while plugged into the 3v3 supply. I’m going to try next a similar 5v cheap shite Chinese power supply… but with a 3v3 linear in between. Results on the blog as they happen (or not as the case may be).

  15. Oh NO doubt about it node-red – that link you sent – looked great in the picture – but it’s all command line stuff- node-red is literally drag and drop – need to get way more familiar with that.

  16. Agree about the link … just there for reference interest really… the G3MB-202P is a 600V pk type, so that’s good. Zero cross over snubber type 2A. Resistive loads only really.
    Spec says 4 – 6 V .(5V nom.) Resistor input (440 Ohm in line with led). Possibly ok down at 3V3 but I wouldn’t like to rely on it.

  17. Right.. progress. Using the positive for reference rather than the negative – and with a suitable separate power supply and with a load of a 20w Compact Fluorescent – the SSR works perfectly. So that’s one down, one to go. I’m going to try some different loads before committing myself…. stay tuned.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s