View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi

Learn how to convert an old wireless keyboard into a modern rechargeable one by reusing components and 3D printing a compartment for a lithium battery, saving money and giving it a new lease of life.

Related Content
Transcript

[0:00] I’ve had my wireless keyboard for almost 10 years now.
[0:03] One thing that has always annoyed me is that it uses double AA batteries.
[0:06] I have switched over to rechargeable batteries, but I always forget to have a charged spare
[0:11] set ready and the ones I have are now quite old and don’t last very long.
[0:16] I could upgrade to a new keyboard from Apple - but honestly, I don’t want to spend £100
[0:20] when I’ve got a perfectly good working keyboard.
[0:24] I’m currently waiting on some components so that I can solder up the latest batch of
[0:27] PCBs from PCBWay - this time I got PCBWay to send me a stencil along with the PCBs and
[0:33] we’re going to try and a bit of SMD reflow soldering with either a hot plate or hot air
[0:38] gun.
[0:39] All the bits should arrive in the next couple of weeks - so don’t forget to subscribe!
[0:42] In the meantime, I thought we’d do a bit of DIY on my old keyboard and bring it kicking
[0:47] and screaming into the modern world.
[0:49] I’ve seen a few hacks where people have stuffed things into the battery compartment - these
[0:53] are definitely interesting and I could 3D print something to do the same job.
[0:57] But if we look at the bottom of my keyboard there is a small plastic window that can be
[1:01] popped off with a bit of brute force.
[1:04] With this removed we can see the connections coming in from the battery.
[1:08] I’ve got a couple of fairly flat batteries installed at the moment, so the voltage is
[1:11] pretty low.
[1:12] But if I had a couple of fresh batteries then we’d be measuring around 3 volts.
[1:17] With my soldering iron cranked up to maximum blast, I was able to reflow a couple of wires
[1:22] onto these terminals.
[1:23] This gives us an easy way to inject power into the system.
[1:26] I’ve also cut out a small bit of the plastic cover so we can route the wires to the outside
[1:30] world.
[1:32] I’m planning on powering the keyboard from a rechargeable lithium battery, I found these
[1:36] nice USB charging modules on AliExpress.
[1:40] The modules use a TP4056 chip and also include a DW01A battery protection IC along with a
[1:49] dual MOSFET.
[1:50] The schematic for both the charging and battery protection circuits is pretty much an exact
[1:54] match for what we see on their respective datasheets.
[1:58] On the charging side of things, we have the two LED indicators for charging and fully
[2:02] charged and we have the resistor for programming the charging current.
[2:06] My PCB has a 1.2K resistor which according to the datasheet will give us a charge current
[2:11] of 1A.
[2:13] The cells I’m currently using only have a capacity of 1000mAh so this charging current
[2:18] is possibly slightly too high and we should be using around 500mA.
[2:23] But I do have some much larger capacity cells on order which will be fine with this higher
[2:27] charging current.
[2:29] The battery protection circuit follows the datasheet exactly.
[2:32] This battery protection is probably unnecessary as it’s quite unusual to get cells that don’t
[2:37] have built-in protection - most cells that you buy will have a protection PCB built-in,
[2:42] though you never know what you might end up with so I’m quite happy to have it.
[2:47] When the battery is fully charged we get around 4.2 volts from it.
[2:50] This is quite a bit higher than what we’d get from two AA batteries.
[2:54] From reading around I suspect that the keyboard’s circuitry could probably handle this voltage
[2:58] without any problems, but I really don’t want to risk it up so I’m going to reduce the voltage
[3:02] a bit.
[3:03] There are a few options for us here.
[3:05] We could just put a couple of diodes in series with the battery supply.
[3:09] This would drop the voltage by around 1.4 volts.
[3:12] Alternatively, we could use a linear regulator and drop the voltage.
[3:17] Both of these options would work, but they would also waste a bit of power.
[3:20] Instead of these two options, I’ve decided to use a cheap DC to DC converter module.
[3:25] This PCB is configured to output 3.3volts - it’s a bit higher than the 3v from 2 AA
[3:31] batteries, but I think it’s low enough that the keyboard will survive.
[3:34] The PCB is pretty interesting as it’s actually a step up and step down DC converter, so it
[3:40] will output 3.3 volts even if our battery is outputting a lower voltage.
[3:44] It’s using an SDB628 chip in a Single-ended primary-inductor converter configuration.
[3:51] This is pretty interesting as the only configuration shown in the datasheet is a boost converter.
[3:55] Here’s the schematic for what’s on the PCB.
[3:59] The SBD628 tries to keep the feedback voltage at 0.6v and will adjust its duty cycle to
[4:04] try and achieve this.
[4:06] It’s quite a nice little circuit on a very compact PCB - I’ve put a link to a video that
[4:11] describes how a SEPIC converter works - it’s pretty interesting.
[4:17] Connecting things up is pretty simple.
[4:19] We take the output from the charging PCB and connect this to the inputs of the DC converter
[4:24] and then just solder the battery onto the charging PCB.
[4:28] When we are charging we get 4.2 volts on the output from the charging PCB and we get a
[4:33] nice sensible 3.3v from the DC converter.
[4:36] If we disconnect the power supply then we still get 3.3v from our DC to DC converter.
[4:42] I’ve connected this all up to the keyboard and it works nicely.
[4:45] I’ll be interested to see how long the battery actually lasts before it needs to be charged
[4:50] again.
[4:51] I’ve 3D printed a nice little compartment to hold the components and I’ve fixed the
[4:55] charging PCB in place with some hot glue.
[4:57] For now, I’m just temporarily taping the compartment in place.
[5:01] When my new high capacity cell arrives I’ll need to reprint this and do it again with
[5:05] a more permanent solution.
[5:06] It is quite nice, we can see the charging LED glowing through the 3D printed wall, and
[5:11] when it’s fully charged the colour changes.
[5:13] There are a couple of things that I think could be improved.
[5:16] I would quite like to make the output voltage exactly 3 volts - I’ll probably desolder the
[5:21] current resistor divider and replace it with some more suitable values.
[5:25] The other issue is that I now have no way of knowing when the battery is going flat.
[5:30] The boost converter will always output 3.3 volts so I’ll always see the battery reported
[5:35] as 100% by the mac.
[5:37] The only indication I’ll have that it’s gone flat is that the keyboard won’t power on anymore.
[5:42] I’m quite tempted to build my own custom PCB with everything combined into one board along
[5:47] with some battery monitoring so I can see when the battery needs to be recharged.
[5:51] For now, I’m pretty happy.
[5:53] I’ve saved myself a bit of money and I now have a nice rechargeable keyboard.


HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts