Learn how to create your own wireless LEDs by reverse engineering the circuit and using simple components. Understand the cost comparison between Aliexpress and DIY version to see if it's worth building your own.
[0:00] In the last video, I showed off these wireless LEDs and I said that it would be really easy
[0:05] to make your own.
[0:06] So let’s give that a go.
[0:08] We’ll reverse engineer the LEDs and create our own versions from discrete components.
[0:13] We’ll then reverse engineer the driver circuit and build our own version of that
[0:16] and then we’ll see how well it works
[0:19] Finally, we’ll do a cost comparison to see if it was even worth it.
[0:22] We should end up with a complete working DIY equivalent that you can easily build at home.
[0:28] Let’s take a look at the LEDs.
[0:31] The actual operation is very simple, they are just a resonant Inductor and Capacitor
[0:35] circuit with an LED across it.
[0:37] The circuit is tuned to the frequency that is being output by the driver coil.
[0:42] In the previous video I wired up a couple of wires on each side of the LED and hooked
[0:47] it up my oscilloscope, and we saw that the circuit is picking up a signal of 217kH.
[0:53] The inductor is marked on the bottom 222 that corresponds to a 2.2mH inductor.
[1:00] Using this inductor value and the frequency the circuit is resonating at we can work out
[1:04] what the capacitor value should be.
[1:06] Plugging the values of the frequency and inductor into the calculator we get a capacitor value
[1:11] of 244pf - 220pf is the closest standard value.
[1:17] This will give us a resonant frequency of 228kHz which is not a perfect match to the
[1:24] 217kHz but is close enough.
[1:26] For the inductor, I’ve got a couple of options - I have these bare inductors and I have these
[1:31] heat shrink covered wire-wound inductors.
[1:34] If you peel off the heat shrink of a spare inductor you can see that they really are
[1:38] very similar to the bare inductors - the only difference is the heat shrink.
[1:42] It does look like there is less wire, but it’s hard to really tell without taking it
[1:46] completely apart.
[1:47] It’s important that you get unshielded wire-wound inductors for this project - it’s the coils
[1:53] of wire that will be picking up the transmitted power and if you don’t have coils or your
[1:58] inductor is shielded, nothing will be picked up!
[2:01] Soldering the capacitor across the inductor wires is pretty simple, I found it easiest
[2:05] to wrap the thinner capacitor leads around the quite thick inductor legs and then solder
[2:10] the joint.
[2:11] I’ve done this for both the inductor options and if we put them inside the coil we can
[2:15] measure the induced voltage.
[2:17] The yellow trace is the bare inductor and the blue trace is the heat shrink wrapped
[2:23] There’s not a lot of difference and any difference we are seeing could just be due to component
[2:29] With both inductors, we are getting a peak to peak induced voltage of around 160 volts.
[2:33] Obviously, this falls off quite quickly as we move the inductors away from the driver coil.
[2:39] Now, of course, you can use other inductor values - just make sure you calculate the
[2:43] appropriate capacitor value - I suspect that larger inductors may have more turns which
[2:48] may give you longer ranger due to the higher induced voltage - but they may also just use
[2:52] different core materials and there may be other tradeoffs in terms of parasitic resistance
[2:57] which will use up some of the energy.
[3:00] Talking of energy - how much current are we getting?
[3:03] I’ve placed a 1k resistor across the circuit and measured the voltage across it.
[3:07] The peak positive voltage is just over 2 volts and the negative voltage is around 3volts
[3:13] - positive and negative is just determined by which way up the inductor is.
[3:17] The asymmetry of the signal is interesting and is probably due to how the power coil
[3:21] is being driven - more on that later.
[3:25] Given we have a 1k load we have a maximum of 2-3mA - which is more than enough to drive
[3:30] an LED.
[3:31] The version that I bought from Aliexpress only has one LED, so it’s only really using
[3:37] half of the energy that is being induced in the circuit.
[3:40] So I’m going to solder two LEDs in opposite directions across the circuit which in theory
[3:44] should give me double the brightness.
[3:47] I’ve made a bunch of different colours and they all work great - the different LEDs will
[3:52] all have different ranges due to the varying forward voltage requirements of each colour.
[3:58] So that’s the LED side of things - what about the driver circuit and coil?
[4:04] Do your projects look like this?
[4:06] Are you tired of dodgy connections causing gremlins and bugs in your circuits?
[4:11] Maybe you should get a PCB from PCBWay!
[4:14] Check out the link in the description.
[4:17] I’ve got a photo of the PCB and I’ve marked up the traces - in the previous video I wasn’t
[4:22] really sure what this chip was - turns out that I was being a bit slow, it’s the XKT001
[4:27] - as marked on the PCB.
[4:30] The large chip is simply a MOSFET.
[4:33] Here’s the reverse-engineered schematic - it’s pretty simple.
[4:37] The XKT001 is outputting 217kHz on pin 2 and switching the MOSFET on and off.
[4:44] The mark to space ratio is about 40%.
[4:47] The coil and capacitor of the transmitter are connected between the power rail and the
[4:51] drain of this MOSFET and is simply being switched to ground.
[4:55] Here’s a trace of the voltage at the drain of the MOSFET along with the signal being
[4:59] applied to the gate.
[5:01] Recreating this circuit is pretty simple.
[5:03] We need an oscillator, a power MOSFET, a gate driver, a coil of wire and a suitable capacitor.
[5:10] One thing to make sure of when you build this circuit is that you use a logic level MOSFET
[5:15] as the circuit will be running at 5v from a USB supply.
[5:18] You want your MOSFET to be fully turned on when 5v is applied to the gate.
[5:24] You’ll also need a gate driver to make sure the MOSFET turns on and off quickly - if you
[5:29] try and drive it directly from your MCU then it probably won’t turn fully on in time.
[5:34] Power MOSFETs have quite a high gate capacitance so if you try and drive them directly the
[5:38] switching time can be too slow.
[5:41] You’ll also find that a lot of logic level MOSFETs won’t fully turn on when using 3.3v
[5:47] logic - so a gate driver is essential.
[5:50] Great Scott has an excellent video on MOSFET drivers that is definitely worth a watch.
[5:54] For my coil, I’m making one that has the same number of turns and is approximately the same
[5:59] size as the commercial coil.
[6:02] Measuring the inductance of my coil I get around 5.4uH.
[6:06] The coil from Aliexpress comes in at 5.1uH.
[6:11] With the homemade coils, it’s quite variable and you’ll probably end up with anything between
[6:15] 4 and 6 micro henrys.
[6:18] Plugging my 5.4uH value into the calculator with a 228kHz resonant frequency it wants
[6:25] a 90nF so a 68nF or 100nF would be suitable.
[6:31] I’ve ended up using a 68nF in my circuit after a bit of testing.
[6:36] You could of course try and construct the exact required value - but given I’m building
[6:40] this on breadboard just being in the right ballpark will be good enough.
[6:44] How much current is actually going through our coil and MOSFET - the current is limited
[6:48] by a couple of things - the first is simply the resistance of the wire making up the coil.
[6:53] and any parasitic resistances in the components
[6:56] I measured my homemade coil at between 0.5 and 1 ohms.
[7:00] If the inductor is fully saturated then we could have between 5-10 amps flowing through the
[7:05] circuit as the only limit will be the resistance of the coil wire.
[7:09] This makes the pull-down resistor on the MOSFET gate pretty important - if we leave the gate
[7:13] floating it could easily allow current to flow and we could cook our circuit!
[7:18] Provided we turn the MOSFET off before the inductor is fully saturated we’ll get a lot less current flowing
[7:24] We can use this formula to work out the current flowing in the inductor after it has been turned on.
[7:30] Assuming we have a 5uH coil, a 40% mark to space ratio at 228kHz and our coil and parasitic
[7:40] resistances in the circuit are 1 ohm the maximum current through our coil should be just under 1.5 amps.
[7:46] Bear in mind, this is just the peak amps - it’s not drawing this continuously the current
[7:51] ramps up to this value while the MOSFET is switched on.
[7:54] Also, the MOSFET will be turned off 60% of the time.
[7:57] Regular viewers of the channel will know that I have a lot of ESP32s lying around.
[8:01] I’m going to use one of these as my oscillator - it has a PWM output and you can easily adjust
[8:07] the mark to space ratio on it to tweak the power consumption.
[8:10] It is however a 3.3v part so definitely needs a gate driver.
[8:15] Here’s the circuit we’re going to build, I’ve added a 20uF capacitor across the power supply
[8:21] to match the circuit from Aliexpress, this helps keep the supply stable when the MOSFET
[8:25] is switched on and when the inductor starts to draw a large current.
[8:29] I’ve put this together on a breadboard - I’ve got my ESP32 module and the gate driver chip
[8:34] - I’m using a TC4469 but any suitable gate driver chip will do.
[8:40] This is controlling the gate of my power MOSFET.
[8:42] We’ve got the coil and capacitor across the drain and the power supply.
[8:47] If we turn it on our homemade LEDs all turn on.
[8:50] What’s more, the LEDs from Aliexpress also turn on.
[8:54] The homemade version seems to have a performance that matches the professional version.
[8:57] All in all a pretty good result.
[8:59] At the end of the day, it is a pretty simple circuit so we should really expect it to work
[9:04] well - but it’s nice to confirm it.
[9:06] So, let’s do a price comparison of my DIY LEDs vs the Aliexpress version
[9:13] From Aliexpress, I received 18 wired up LEDs along with two driver circuits and coils.
[9:19] To build our DIY LEDs - we need an inductor a capacitor and an LED.
[9:25] You can get 600 LEDs on Amazon for around $12, so for 18 LEDs, it would cost 36 cents.
[9:33] Inductors are a bit more expensive, I found a pack of 50 for around $10, so for 18, we
[9:38] need to spend $3.60.
[9:41] You can pick up a box of 840 capacitors for under $20 so the bill for our capacitors is
[9:47] about 50 cents.
[9:48] The total cost of the LED portion of our project comes in at about $4.50 with the inductors
[9:55] being the majority of the cost.
[9:57] For the driver we need a power Mosfet, these come in at about $1.20 and we need a gate
[10:03] driver - I’m using a fairly expensive chip the TC4469 which comes in at around $5
[10:10] but there’s alternative driver ICs that cost around $1.
[10:13] I’m going to assume you have a handy MCU to provide the oscillator.
[10:17] So long as it can do 220kHz or so you should be ok
[10:22] If you want to build an oscillator yourself, that’s probably an extra a couple of dollars on top
[10:27] To make the two driver circuits you need to double the components, so we’re looking at about
[10:32] So I think the total cost of this project is around $8-$10 to build it yourself depending
[10:36] on how cheaply you can source components and what you have already lying around.
[10:40] The cost from Aliexpress was $19.38 once taxes and shipping was added on total was $28.83.
[10:48] The Aliexpress does come with quite nice compact LEDs that might be quite hard to recreate in a home workshop.
[10:55] And you get a couple of nice coils and driver circuits.
[10:58] Let me know what you think in the comments.