Another Easy ESP8266 Hack - LED Strip Driver
Well, I say ESP8266. In fact this one uses the ESP8285, which is basically an ESP8266 with 1MB of flash built in, so no need for an external flash chip. That makes it even cheaper to manufacture, and hence for you and I to buy.
As you can see there's not a whole lot to this board. ESP8285 on the left, with its support components, 3.3V switching regulator in the middle, and a bank of N-channel MOSFETs on the right to switch the LED strips. But it does have a couple of little surprises up its sleeve.
Let's take a look at those MOSFETs for a start:
That looks very much like there's room for four MOSFETs. This particular board is sold as a 3-channel system for RGB strips. There's an RGBW variant for more money if you want it. It looks, to me, like the only difference is that the RGBW one has an extra MOSFET fitted in that left hand position, and a 5-pin connector soldered on. Upgrading this to RGBW will be an absolute doddle. Just slap in another MOSFET and two resistors (they used a 5.1kΩ pulldown and a 200Ω inline resistor. The actual values don't matter that much. 10kΩ pulldown and 100Ω inline would do fine). I'm going to use the TSM2314CX just because I happen to have them, and they're rated at 4.9A. I have no idea what the ones on the board already are.
Another little surprise is a connection point on one side. This looks very much like it is designed to take an infra-red receiver module. I guess there's an IR controlled version of this unit available too. That connector could be useful.
Now, as far as actually hacking goes, you may have noticed that there doesn't seem to be much in the way of connections for the UART. But that's because I haven't shown them to you yet. It's almost as if these manufacturers want us to hack these devices. They have stopped trying to even pretend they're not hackable. Take a look at the underside of the board:
I mean, do I really need to say anything more? There's the 5 pads you need clearly labelled right there. I don't even need to load up Gimp and put some extra labels on there to make it clear which is which.
You can treat the ESP8285 the same as an ESP8266 with 1MB flash. I used these settings and it worked perfectly:
- CPU Frequency = 80
- Crystal Frequency = 26
- Flash Frequency = 40
- Flash Mode = dout
- Flash Size = 1M (No SPIFFS)
Now as far as the IO pin assignments go that is very easy:
Note that there is a bug in earlier versions of the ESP8266 core for Arduino.
analogWrite() likes to randomly lock the system up. That has been fixed in version 2.4.2 of the core, so make sure you are using that - otherwise you will have all sorts of issues.