Electronic – Please review design for a wifi controllable led driver

esp8266mosfet

I'm trying to dabble a bit in circuit design. As a starting project, I've taken it upon myself to create little wifi controllable led drivers for a couple of (very cheap) light strings I own. The idea is simple: have a power source (usb charger), hook it up with a DC jack to the circuit, power an ESP-01, have the ESP-01 control a mosfet which allows a current through the leds. I've mapped this circuit out in Kicad. I've built a variation of it in real life, and that currently works well enough, but I'd like some pointers about what I designed, so I can learn from it 🙂

Current state of the circuit

Update:

I've switched the mosfet out for a BS170, and added an output capacitor as specified in the datasheet.

After first revision

Best Answer

Three things,

  • The 2N7000 is only good for 200mA (0.2A) so is probably getting hot. The Vgs(th) or voltage gate-to-source threshold, is a maximum of 3.0v for this device. That means, putting 3.0 volts on the gate may (at least) allow 1mA to flow from the drain. 3.3v might allow only 50mA to flow (it would have to be measured and would vary from MOSFET to MOSFET). It can take a gate voltage of +/-20v however, so the higher this goes, the more conductive it will become. If you could put 5v on the gate, even better. Careful handling these out of circuit though; static electricity can easily zap the sensitive gate lead and render them useless.
  • If the 3.3v rail measures low (such as 3.1v) consider using two AMS1117's and power the ESP from a dedicated one. It will help to place a "decoupling capacitor" right next to the AMS1117's output lead. Always read the component datasheets! "The circuit design used in the AMS1117 series requires the use of an output capacitor as part of the device frequency compensation. The addition of 22µF solid tantalum on the output will ensure stability for all operating conditions."
  • Some white LEDs may have a forward voltage of near 3.2v, so they happily glow brightly when powered from 3.3v. But LEDs are diodes, which means that after the voltage point where they start glowing is passed, they draw exponentially more current per voltage increase. As such, they cannot safely be powered from a constant voltage supply alone. A series resistor is needed for each LED such that if the voltage were to rise, the resistor would safely dissipate the extra power. There are dozens of posts here about LEDs and calculating resistor values.