Posted on Leave a comment

DIY Arduino-Based Bike Computer

The inspiration for this project came from trying to repair the bike computer that I had originally. I lost the base for it, and figured I could print a new base, and given that there were only 2 contact points for the magnetic sensor, I figured that it had to be a reed switch.
So I held the 2 leads of a reed switch to the 2 contact points, while moving it over a magnet, and sure enough, my assumption was correct. At this point, I knew what I had to do to fix the bike computer I had now, but there were still a few things I didn’t like about it – current speed was not available, and it had too many other metrics that I don’t care about.
The only logical solution was to build my own custom bike computer. Breadboarding the circuit with an Arduino, an OLED, and a reed swith connected to an external interrupt capable pin (D2 or D3 on the Uno, Nano) of the Arduino was simple. Figuring out the proper calculation to get from number of rotations per millisecond to kilometers per hour was a little trickier than expected. I did easily find one online, but wanted to see if I could come up with the same result.

With the basic circuit and programming complete, I started to design an enclosure for it in Fusion 360. The enclosure mounts to the bike through a separate piece which is zip-tied to the handlebars. The reed switch is will be permanently mounted to the bike (again with zip ties) to the fork. To connect the permanently mounted reed switch and the removable Arduino parts, I used an XT-60 connector. It’s only electrical purpose is to pass the signal from the reed switch to the Arduino, but it also holds the removable part in place. I could have accomplished the same thing with some dupont-style 2.54mm pin headers and designed a clip on to the model, but I went the route of XT-60 connectors because I felt it was easier.

In the removable part of the bike computer, I had to fit an Arduino nano, an OLED, a sliding power switch, 4 push buttons for menu navigation, the XT-60 connector, as well as a li-ion battery, a TP4056 charge and protection board, and a 5V boost converter. It was a tight fit, but I managed to get everything in.

The battery I used for this build is not the typical 18650 that I have in so many other projects, as that would have required the enclosure to be a lot bigger. For this project, I took a cell from an old cell phone that I got from an electronics recycling, removed the plastic casing and protection circuit, tested the voltage (it was around 2.7V), and charged it up. The cell was rated at 895mAh, and the TP4056 modules are pre-set to charge at 1A, which would be just over 1C for this cell, I decided to change the charging resistor on the TP4056 board. I could have done this with a soldering iron and a fine tip, but given that I recently got a hot air rework station, I figured now would be a good time to use it. Typically, Li-ion cells can be charged at 1C, but given that this cell was used and sitting at under 3V for a few years, I decided to go for a 0.5C (roughly 500ma) charge rate.

The appropriate resistor for that would be around 2.5K ohm, but the closest bigger resistor that I had was 3.3K, which worked out to roughly a 350mA charge rate. I replaced the resistor, and charged it up without issue. The battery got connected directly to the BAT+ and BAT- pads of the TP4056 module. The OUT+ of the TP4056 gets connected to one side of the power switch, while the other side is connected to IN+ of the boost converter. OUT- of the TP4056 is connected directly to IN- of the boost converter. The boost converter output was originally a USB type A port, which I removed, and soldered wires directly to the 5V and GND pads on the PCB (the outer 2 pins of the USB connector). They are not labelled, but the GND pad is directly connected to IN-, so I got my multimeter out to check continuity. Once I had that figured out, I connected the wires to 5V and GND on the Arduino. All the buttons got connected one side to GND and the other side to a digital pin, declared as INPUT_PULLUP in the code.

It was a very tight fit getting the Arduino into the enclosure. While putting it in the first time, I dislodged one of the SMD capacitors on the back of the board. I soldered it back without issue, but then it would not accept uploading a program to it. Most likely, I also damaged some of the traces going to the capacitor, but I’m not sure. I replaced the Arduino, and got everything properly mounted in the enclosure. I soldered the OLED to the Arduino before screwing it in to the enclosure with 4 M3 screws. Then the Nano went it next, secured with friction for now. I put the XT-60 connectors in both parts of the mount, and secured them with two-component adhesive, which I also used to secure the Arduino at this point, and the power switch. After soldering the 4 push buttons for menu navigation to the Arduino, they got glued in with a generous amount of hot glue. The TP4056 module went in directly on top of the Arduino, the boost converter slid in behind the switches, and the battery fit over top of everything. I’m sure I could have made the wiring more elegant, but it would have taken much more time.

Overall, this accomplished exactly what I wanted it to do – get me information on current speed, and distance travelled while riding my bike. I also added in some functionality to track trips, and save up to 10 of them in EEPROM memory.


Project By: Micah Black

Written By: Micah Black

Posted on Leave a comment

100W LED Flashlight in a PVC Pipe

Back for round 2 of my 100W LED flashlights. I enjoyed the first one such much and used it enough that I decided to build another that solved a few of the annoying problems with that one (terrible battery life, constantly monitoring battery voltage, battery outside the main casing).
I’ve been thinking of building this for a few months now, and from the time finally decided to go ahead and make it, it took me around 8 hours of work on it to complete it. That includes making the custom battery, testing all the parts, and choosing resistor values.

Let’s start out with the choice of parts. I mounted everything inside a 4″ PVC pipe because I had seen it done before (link), and it is much sturdier than the MDF I used for the original.
As for a heatsink, I had to find one that fit inside the 4″ pipe. A stock Intel CPU cooler is perfect for this. For the control circuitry, I used pretty much the same parts as the last one – a 150W boost converter, an XL6009 Buck Boost converter, 2 potentiometer, and I also added an extra switch and USB buck converter to have a USB charging port.
The batteries I used are 12 Grey Panasonic NCR18650 from old laptops, all around 2800mAh. The BMS is a 4S 30A BMS from aliexpress, and works perfectly, as far as I can tell. I added a voltage monitor to the back of the flashlight as well.
And of course, we cannot forget the 100W LED, and accompanying lens.
I used M3 nut and bolts for all the attachments, as I have plenty of them lying around, and they are very common.

Starting with the control circuitry, I used a rotary tool to cut out a circle of MDF slightly smaller than the inner diameter of the PVC pipe to mount all the electronics to.
The boost converter is being used to boost the voltage of the battery pack up to a maximum of 32V for the LED. Anything higher than that, and the LED will start to draw too much current, heat up, and possibly explode due in incorrectly matched diodes. If you want to find out more about why this happens, check out BigClives’s video on it. Always be sure to know what you are doing when playing around with high power chinese LEDs.
The original potentiometer on the boost converter is a 10K trimpot, but that obviously had to come off if we were going to be able to adjust the brightness form the outside of the case. I started out with a 10K potentiometer, and figured out what resistance caused a maximum voltage of 32V, which turned out to be around 9K. I used a 5K potentiometer in series with a 4K of resistors to max out the voltage at 32V, but still have an adjustable voltage.
I also wanted to be able to control the fan speed, so I did the same procedure for the XL6009 buck boost converter, max voltage of 14V to overvolt the 12V cooling fan to give maximum cooling performance. I feared that the small intel heatsink would not be enough to properly cool the 100W LED at full brightness for very long. It turns out that the stock Intel fan has a built-in speed controller, so this turned out to be useless, but I did fry one fan while figring this out.
While testing the buck boost converter for the fan a potentiometer failed, and created infinite resistance between the wiper and the edges. This triggered the buck boost converter to boost to its maximum voltage which turned out to be over 60V. This let the magic smoke of the stock Intel fan, so I had to grab another from my bin, but I didn’t put it back in circuit until I had replace the potentiometer and tested the voltage numerous times on the output. I was surprised that the buck boost converter went up to such a high voltage, since its max adjustable output voltage is around 35V, the same as the capacitors are rated for. I’m glad (and surprised) I didn’t blow any of the capacitors, pushing 25V over their limit through them. Just another example of chinese engineering. If I had not caught this before I mounted it, the capacitors would have been taking that 60V for a much longer time before I realized what had happened, and most likely would have blown.

The USB Buck converter was also added with its own switch, and required no special wiring. Interestingly, there are no markings on the board to mark input polarity, so I got out my multimeter and testing for continuity between an input pad and the grounded USB shroud.

One quick note – controlling these LEDs with a voltage limit is not the proper way to do it. A current limiting circuit is much better, and will prevent the LEDs from burning no matter what the voltage is. They are much more expensive though, so I am sticking to voltage control, but limiting it below the max voltage. These LEDs can take up to a maximum of 36 volts (I believe) if properly controlled with a current-limiting device. I would highly recommend not driving chinese LEDs at their maximum specs, as that increases the chances of danger (again, see Big Clive’s video that explains much better why this is dangerous). I tested my LEDs, to make sure that they were not too far out of balance with each other. As you can see from the picture below, mine were matched fairly well – much better than the ones shown in Big Clive’s video. I am driving my LEDs at a max of roughly 33V.

To attach the LED and lens to the heatsink, I drilled 8 holes around the center, one set of 4 to fit the LED and the other set of 4 to fit the lens mounting points. I used M3 screws, and they tapped themselves into the aluminum very well. Before screwing the LED down, I put a blob of thermal compound in the middle of the heatsink. Same procedure as CPU mounting CPU coolers to a CPU.

Once I got all the control electronics figured out, I went on to cutting the PVC pipe and mounting everything to it. I drilled holes for the potentiometers, switches, and screws, then went outside to use a rotary tool to cut out the ventilation holes, cut the tube to length, and enlarge some of the drilled holes. It is very important to do this is a well ventilated area, and ideally use a face mask to avoid breathing in the PVC dust.

Using some 6-32 screws, washers, and some galvanized strapping, I created a mount for the MDF control board, and then mounted it in the pipe. After soldering the LED to the output and verifying that it worked, I put that inside the pipe as well, and drilled 2 holes through the plastic fan mount in order to attach it to the PVC pipe with some M3 screws.

Next I worked on building and mounting the custom battery. As I mentioned earlier, the battery is a 4S3P configuration, made up of Panasonic NCR18650 cells from old laptops, all around 2800mAh. Each cell is individually fused on the positive end with a 3A fuse, and the negative ends were soldered together with nickel strips.

The BMS output is connected to the input of the boost converter for the LED, and the buck converter for the USB port. I also added an extra XT-60 connector to the main terminals of the battery, as well as a balancing harness in order to be able to charge the battery with a hobby charger. I put a piece of foam in the back end of the flashlight to cover all the screw heads on the MDF board, wrapped the battery in 2 layers of foam, then put the battery in and another piece of foam on top. Packing the battery with foam is definitely not the best for heat, but I do not anticipate it to be a problem. These battries can supply a max of roughyl 15A, and I will only be drawing about 4A. To keep it from falling out the back, I added another piece of foam, and put an 80mm fan grill on top. I cut out part of the fan grill in order to put a 4S voltage monitor and a switch to have a rough idea of the battery level without any hassle. The screw holes in the fan grill were bent downwards and pushed around the outside of the foam so that 4 computer fan screws could be screwed in to PVC where I had previously drilled holes, and hold the fan grill in place.

All the was left to do was add a handle, so I cut a rough shape out of a piece of 1×4 with a jigsaw, then sanded it down with a rotary tool, and drilled a hole in either end of the flashlight and the handle to mount it securely. I added a layer of clear gloss acrylic spray paint to the handle to give it a bit of protection against moisture.

With that, my second 100W LED flashlight was complete! If you want to see the first one, you can check it out here. I like this one much better, as it is all in one self-contained unit, therefore is much easier to use and handle than the previous one.

Posted on Leave a comment

First Step Towards a DIY Powerwall

For the past few weeks, I have been designing, printing, redesigning, and thinking about cells holders for a DIY powerwall. I decided to go with 8P packs, as those will allow for easy replacement of faulty cells, and if one cells fails, I only have to replace a pack of 8. Each cell will be individually fused at 4A. As for spot welding vs soldering, I go with soldering – especially for the fuse wires, it is much easier, and does not damage the cells. I use a 60W soldering iron with a big tip, and have never had any problems.

I finally started getting the packs put together, and realized that the 350ish cells I was planning on using is much more than I originally thought. I am only using cells over 2000mAh, and each cell has ben tested in my 18650 testing station, according to my process here. I may need to find and strip down a bunch more laptop batteries.

7S will be the configuration for this wall, and I will start out with 6 or 7 packs of 8 cells in each parallel group (7S 48 or 56P). This 7S is ideal for a 24V system. Unlike 12V systems, 24V systems allow the use of common 24V inverters, and DC-DC Buck converters can be used to achieve different voltages. If I had gone with a 12V system, then it would be the classic debate of 3S (9V-12.6V) vs 4S (12V-16.8V). Most 12V inverters have a low voltage cutoff of around 10.5V and a high voltage cutoff around 14V. With either option, over half your battery  remains unused. Going with 7S, we can use a 24V inverter. The voltage range of a 24V lead acid system and 7S Li-ion pack are almost perfectly matched, so all the power in the batteries can be used.

I will eventually be building some solar panels to charge this, but for now, I will stick to charging it with a 930W server power supply that I bought on eBay for $25, paired with a 600W converter from Aliexpress. I will also use some high power TP4056 modules or an iMax B6 to top off individual cells when required. The best solution for cell monitoring would be a Batrium BMS system, but those are expensive. Instead, there will be a small voltage monitor attached to each cell with a switch to monitor voltages while charging and discharging, but does not draw power when sitting idle if the switch is turned off.

The whole thing will take up roughly a 1x3ft area, weigh about 30kg, will be able to store around 2.5kWh of energy.

Another idea that might come in the future to complement the solar charging I will be adding to this – attaching a generator/car alternator to a stationary bike in order to charge the power wall whenever you want.

Stay tuned for more updates on my powerwall coming soon!

Project by: Micah Black

Written by: Micah Black


Posted on Leave a comment

Designing my own BMS Module

When I saw Julian Ilett’s video about voltage protection ICs being used improperly on supercapacitor protection boards, I decided I would use them correctly to build my own basic BMS. In no way do I believe that this is better than the options currently available, but it was a fun project.

The main inspiration for this build was the XC61C low voltage detection ICs. These can turn off their output when the voltage falls below a certain threshold – depends on the model you get. I used 3.0V to ensure that my cells do not get over-discharged. It would probably have been a better idea to use the 2.7V versions, as that would allow for more usable capacity and still not discharge to an unsafe level. The cells would probably recover back to around 3.0V anyways once the load is disconnected.

There are 2 main parts for this board – the cell detection side, and the output control side. Both sides are separated with optocouplers in order to isolate them from each other, as the ground reference is not the same for the low voltage detection ICs and the rest of the board.

On the cell detection side, I used the XC61C low voltage detectors across each cell. They are attached to a the input side of PC817 optocouplers, in series with a 470 ohm resistors. Optocouplers are not ideal for this, as they do use a fair bit of power just to drive the IR LEDs (around 10ma). After leaving it connected to some lights in the shed for a week or so, the output would no longer turn on – I’m glad that the BMS did its job. However, voltage on the top cell was below 2V, so too much current is being drawn by the Optocouplers. It was a fun project, and did what it was supposed to do, but with some potentially damaging effects on the battery – overdischarging the cells through the IR LEDs in the optocouplers.


Project by: Micah Black

Written by: Micah Black

Posted on Leave a comment

Another Flashing LED Sign

I recently built another flashing LED sign and wanted to post some pictures of it, so here they are.

Building this one followed a very similar process to the rest (linked below), but this time it worked on the first test!

Check out the original builds and instructions here.

Posted on Leave a comment

Adding LED Lighting to Outdoor Shed

When we need to get something out or put something into our shed when it’s dark, it’s always more of a hassle than it should be. It starts off with trying to find a flashlight, then only having one hand to carry stuff out and put it in the right spot is not easy. Solution: put some lights in the shed!

Let’s start off with the easiest part of this project, the LED lighting itself. I used some very simple 12V LED strips with 5630 or 5730 LEDs for the lighting. 2 strips of them worked well because the shed is fairly deep, and allows much more even lighting. In total, there are 2m of LED strips. Current draw is roughly around 1.5A. Now to find a suitable way to power them.

As this is outside, running AC power to it and using a small power supply was impractical. I have lots of 18650 lithium-ion batteries lying around, waiting for me to do something with them (a power wall is in the works right now), so I made a 4S 4P pack inside a 4×5 cell holder to allow for extra room to hold a BMS circuit and DC-DC buck converter to get 12V for the LEDs from the battery pack’s fully charged 16.8V. I chose 4S because I wanted to use the BMS circuit that I designed (more details coming soon) to prevent over-discharging the batteries. The BMS will cut all power  going to and from the batteries if the voltage of any cell goes under 3.0V (accomplished with XC61C low voltage detection ICs). The buck converter I used is a 5A buck converter that has lots of headroom to drive the LEDs. I set the voltage to around 10.8V so that the LEDs are more efficient – less voltage drop across the series resistors, and thus less power lost to heat in those resistors. Some of these LED strips have been known to get fairly warm, so undervolting them is a good trick to keep them cool and prolong their lifetime.

Mounting everything to the shed took some screws, some scraps of wood, and some 3D printed clips. The adhesive on the LED strips did not stick to the wooden shed, so I designed some LED strip clips that I also used to tidy up the cables. The files are available on thingiverse here. I might eventually add a PIR motion sensor and RTC to this setup to make it turn on as you approach, but not during the daytime. One problem that will come up with this is the cold weather in the winter. Discharging the batteries over in -30 degrees Celsius temperature is not good for them – it will reduce capacity, and increase the internal resistance, resulting in a lower operating time and lower possible discharge rates. These batteries are not getting pushed to their limits at all, but I’m not too sure if I want them being used out in the cold. At the very least, they will be charged more often and kept inside as much as possible. I might make 2 more to switch out so that each battery spends as little time outside as possible.


Posted on Leave a comment

Upgrading a cordless drill from NiCD to Li-ion Batteries

So a few years ago, I bought a set of Ryobi tools off Kijiji for $30 or so. It was a great deal, but I knew the batteries were pretty much dead, but I could deal with that. A few charges later, the batteries were completely dead. Fast forward a year and I finally replaced the old NiCD batteries with new Li-ion ones.

When opening the old packs, I realized I should have done this a long time ago. The batteries were corroded and clearly dead. So I ripped them all out and soldered an XT-60 connector to the main power wires in order to accommodate a Li-ion battery.

In case anyone is wondering, the other component in that picture is a thermal fuse. Being used to tearing apart lithium-ion battery packs, I was surprised to see that this was  the only protection feature on that old NiCad pack.

Now comes the hard part – finding the right batteries to replace them with. I have seen lots of guides online using old laptop batteries for this that were not even tested – DO NOT do that. Most laptop batteries, even if brand new, were only designed to handle 2A of current draw, which gets lower as they age. That being said, I did use batteries that I got from a laptop battery, but I tested them and they were pretty much new. I used some Samsung 26C cells that are rated at 2600mAh and 5.2A discharge rate. Using my 18650 battery testing station, I verified that they still had around 2550mAh of capacity left, so for all intents and purposes, they are brand new batteries. If you are going to do a similar upgrade, make sure to get new cells to ensure that they can handle the current that the drill will use.

To test the current used by the drill, I used a DC clamp meter and the old lawnmower battery that I fixed here. I attached alligator clips to the 10S battery over 5 cells to get roughly 18V, similar to the original NiCD battery. There were spikes of up to around 10A, but continuous was around 4A – be sure to get cells that can handle these rates.

I assembled 5 18650 cells in series to make a 5S1P pack. Ideally, I would have gone with 2P, but there was not enough room to fit 10 cells in the old battery case. As for charging the battery, I left all the balance connectors inside the case, and will have to open the battery case to charge it. I don’t expect to be using this every day, so that will not be too much of an inconvenience.

The converted battery weighs almost half as much as the old battery does, and has over twice the capacity that it had even when new. Quite an improvement I’ll say!

Posted on Leave a comment

Building a DIY Arduino on a PCB and some Tips for Beginners

This is meant as a guide to anyone soldering their own Arduino from a kit, available here. It contains many tips and tricks in order to build it successfully. You will also learn about what all the different components do.

Mini USB Connector

The first part to solder is the mini USB connector. This  will provide power to your arduino when completed, but an RS232 / USB to Serial adapter will be needed for programming it. The mini USB socket goes in first so that you can put it in, flip the board over so that the pins are facing upwards, then put it down on the table. Before putting it in, bend the mini set of 2 pins slightly towards the front of the board so that it will fit in the holes on the PCB nicely. The weight of the PCB will hold the connector in place, and you can solder it right there.

Pin Headers

Pin headers are the next pieces to go in. You should have female headers in 6pin x2, 8pin x2, and 10pin x1. A male header of 3×2 is also required for the ICSP (In Circuit Serial Programming) header. These all go around the outside of the board, and will fit perfectly in their proper places. Solder them in with the same method as the USB socket, doing one header at a time. The headers should all be perfectly perpendicular to the PCB. To achieve this, solder only one pin of the header, then while holding the header in with your hand, melt the solder again and reposition the header to its perpendicular position. Make sure that it also sits flush against the board for the entire length. Hold it in position until the solder hardens, then continue soldering the rest of the pins.

Quick tip for soldering the rest of the components:

All the component leads can be placed through the board first, then bent to the side so that the components will stay in the board when flipping it over. This will make it much easier to solder as the components will hold themselves in place.


IC Socket

Start by placing the 28pin IC socket. Make sure to line up the divot at one end with the drawing on the PCB. This lets you know which way to insert the AtMega328P microcontroller. Even though the pins on this socket are shorter than resistors or capacitors, they can still be bent over to hold the component in place while you are soldering it.


The 3 resistors can go next. It does not matter which way they are placed – resistors are not polarized. There are 2 1K ohm resistors as current-limiting resistors for the LEDs, and a 10K ohm resistors as a pull-up resistor on the reset line. 1K ohm resistors were chosen for the LED instead of the common 220 ohm ones so that the LEDs will have a lower current passing through them, thus acting more as indicators than a flashlight.


There are 2 LEDs, one as a power indicator, and the other on pin 13 of the Arduino. The longer leg on the LEDs marks the positive side (anode). Make sure to put the longer leg in the side marked + in the PCB. The negative lead of as LED is also flattened at the side, so that you can still decipher positive (anode) and negative (cathode) leads if they were cut.


Next up is the crystal oscillator and the 2 22pF ceramic capacitors. It does not matter which way any of these get put in – ceramic capacitors and crystal oscillators are not polarized. These components will give the Arduino a 16MHz external clock signal. The arduino can produce an 8MHz internal clock, so these components are not strictly necessary, but let it operate at full speed.

Reset Switch

The reset switch can go next. The legs on the switch do not have to be bent, it should hold itself in the slot.

Ceramic Capacitors

4 100nF (nano Farad) ceramic capacitors can go next. C3 and C9 help smooth out small voltage spikes on the 3.3V and 5V lines to deliver clean power to the Arduino. C7 is in series with the external reset line to allow an external device (USB to Serial Converter) to reset the Arduino at the right time in order to program it. C4 is on the Arduino’s AREF (Analog Reference) pin and GND to ensure that the Arduino measures accurate analog values on it’s analog inputs. Without C4, AREF would be considered ‘floating’ (not connect to power or ground), and will cause inaccuracies in analog readings because a floating pin will take on whatever voltage is around it, including the small AC signals in your body that have come from the wiring around you. Again, ceramic capacitors are not polarized, so it does not matter which way you put them in.

PTC Fuse

Now you can install the PTC (positive temperature coefficient) fuse. The PTC fuse is not polarized, so can be put in either way. This goes right behind the USB socket. If your circuit tries to draw more than 500mA of current, this PTC fuse will start to heat up and increase resistance. This increase in resistance will lower the current, and protect the USB port. This protection is only in circuit when the Arduino is being powered over USB, so when powering the Arduino via the DC jack or by external power, be sure that your circuit is correct. Make sure to pull the legs all the way through the holes, even past the bends. A pair of pliers will be helpful here.

Electrolytic Capacitors

The 3 47uF (microFarad) electrolytic capacitors can be put in next. The longer leg on these is the positive leg, but the more common identification is the coloring of the casing on the side of the negative leg. Ensure that when you put them in, the positive leg goes towards the + mark on the board. These capacitors smooth out the bigger irregularities of the input voltage, as well as the 5V and 3.3V lines, so that your Arduino gets a steady 5V/3.3V instead of a fluctuating voltage.

DC Jack

Next up is the DC input jack. Same deal as all the other components, put it in and flip the board over on top of it to make it stay in place while you solder it. Bending the legs may be a little difficult, as they are thick, so you can always keep this one in place the same way as the mini USB connector that was soldered earlier. This one will only go in one way – with the jack facing the outside of the board.

Voltage Regulators

Now the two voltage regulators. Make sure to put them in the right spots. They are both labelled, so just match the writing on the board with the writing on the regulators. The 3.3V regulator is an LM1117T-3.3 and the 5V regulator is an LM7805. Both of these are linear voltage regulators, meaning the input current and the output current will be the same. Say the input voltage is 9V, and the output voltage is 5V, both at 100mA of current. The difference in the input and output voltages will be dissipated as heat by the regulator. In this situation, (9V-4V) x 0.1A = 0.4W of heat to be dissipated by the regulator. If you find that the regulator gets hot during use, that is normal, but if drawing a large current and there is a big voltage difference, then a heatsink on the regulator might be necessary. Now to solder them onto the board, the metal tab on one side should go towards the side on the board that has a double line. To secure them in place until you solder them, bend one leg on one way and the other two the other way. Once soldered in place, bend the 5V regulator towards the outside of the board and the 3.3V regulator towards the inside of the board.

Inserting the AtMega328P IC

The final part is to put the microcontroller in its socket. Line up the divots in the socket and on the IC, then line up all the pins. Once in place, you can push it down. It will take a bit more force than you might expect, so be sure to apply pressure evenly so that you don’t bend any of the pins.

A few notes of caution with your Arduino:

  • NEVER connect USB power and external power to the Arduino at the same time. Although these may both be rated at 5V, they are often not exactly 5V. The small voltage difference between the two power sources causes a short circuit through your board.
  • NEVER draw more than 20mA of current from any output pin (D0-D13, A0-A5). This will fry the microcontroller.
  • NEVER draw more than 800mA from the 3.3V regulator, or more than 1A from the 5V regulator. If you need more power, use an external power adapter (a USB power bank works well for 5V). Most Arduinos generate their 3.3V power from the USB to Serial chip on board. These are only capable of a 200mA output, so if you use a different Arduino, make sure that you’re not drawing more than 200mA from the 3.3V pin.
  • NEVER put more that 16V in the DC jack. The electrolytic capacitors used are rated for only 16V.


A few tips / interesting facts:

  • If you find that your project needs lots of pins, the analog input pins can also be used as digital output pins. A0 = D14, up to A5 = D19.
  • The analogWrite() command is actually a PWM signal, not an analog voltage.
  • PWM signals are available on pins 3, 5, 6, 9, 10, and 11. These are useful for controlling the brightness of an LED, controlling motors, or generating sounds.
  • To get an audio signal on the PWM output pins, use the tone() function.
  • Digital pins 0 and 1 are the TX and RX signals for the AtMega328 IC. If possible, do not use them in your programs, but if you must, you might need to unplug the parts from those pins while programming the Arduino.
  • SDA and SCL pins for i2c communication are actually pins A4 and A5 respectively. If using an i2c communication, pins A4 and A5 cannot be used for other purposes.


Instructions for programming your board:

First unplug any external power to avoid shorting out 2 different power supplies. Now attach a USB to Serial adapter to the header just behind the mini USB power. Connect it up according the following:


Arduino    USB to Serial adapter

GND        GND    (ground)

VCC        VCC    (power)

DTR        DTR    (reset pin)

TX        RX    (data)

RX        TX    (data)


Yes, the TX and RX pins do get flipped. TX is the transmitting pin, and RX is the receiving pin, so if you had 2 transmit pins connected together, not much would happen. This is one of the most common pitfalls for beginners.


Make sure the jumper on the USB to Serial adapter is set to 5V.


Plug the USB to Serial adapter into the computer, select the appropriate COM port (will depend on your computer) and Board (Arduino UNO) in the Tools menu of the Arduino IDE (downloaded from, then compile and upload your program.


Testing the board

The first thing you should do is to blink an LED. This will familiarize you with the Arduino IDE and programming language, and ensure that your board is working properly. Go to the examples, find the Blink example, then compile and upload to the Arduino board to make sure that everything works. You should see the LED attached to pin 13 start to blink on and off at intervals of 1 second.


Project by: Micah Black

Written By: Micah Black

Posted on Leave a comment

Cheap DIY Flashing LED Wooden Signs

This idea came from a few different places. I saw a wooden sign with LEDs on it at a craft sale, and thought it looked amazing, and simple to make. A few weeks later, I found Julian Ilett’s videos on ring oscillators. Putting the two together seemed to make sense, so I did. Over the next few days, the first sign started to come together.

I know its not quite the time of year for signs like this, but it sure does feel like winter again – in April 2018 – so I’ll post this now.

You can see a video of it in action here.

Assembling the Wood

The wood needed for these signs is pretty simple. A few pieces of wood, all the same length, get lined up beside each other. Then get 2 more pieces of wood, the same length as the width of the other boards, and hot glue the widthwise across the back to hold everything together. Then put 2 screws into each of the longer boards, 1 through each of the shorter boards along the back. If you flip the boards over, you should have a flat surface of multiple boards lined together. Sanding it is possible, but not necessary. It would make it look better, but unless you have a belt sander, I would not bother with it. As for the size of the sign, the Ho Ho Ho one is probably around 50 x 30cm, while the Joy To the World one is roughly 30 x 20cm.

Painting your Design

Regular acrylic paint from a dollar store is the easiest way to paint the wood. A clear acrylic spray sealant will go over it once finished, so that the paint will not chip either. I start with a solid color for the background, then add all the details. All the ones in the pictures, I painted by hand, and they didn’t turn out to bad – I definitely would not consider myself an artist.

Drill holes for LEDs and gluing them in

Next up is drilling the holes for the LEDs. I used 5mm white LEDs, so I used a 5mm drill bit to make holes for them. One of the special things about a ring oscillator (the circuit we will be using to flash them), we need an odd number of LEDs, so make sure to drill an odd number of holes. Also, make sure to avoid the braces on the back or else you’ll have a hard time soldering wires to the legs of the LEDs. Once the holes were drilled, I countersunk them from the front to be able to see that LEDs a little better, then repainted the holes. The LEDs went in from the back and were glued in place with some hot glue.

Soldering the Circuits on the LEDs

For every LED on the sign, a 2N3904 transistor, a 5-10uF capacitor, a 1K resistor (for current limiting the LEDs), and a 100K resistor (for passing the signal from one LED to the other) is also needed. An extra 100K resistor is also needed to make the LEDs flash a little more randomly. This extra resistor will go from one OUT from one LED circuit, to an IN connection on another LED an odd number of steps away. Connect the circuit as shown in the pictures below.

Powering Your Sign

First off, the LEDs need roughly  2.5V to shine, so we must supply it with greater than 2.5V. The other consideration is the higher the voltage, the faster the LEDs will flash, but you cannot have a voltage that will give too much of a current through the LEDs. With a 1K current limiting resistors, don’t put more than 9V across the circuit. This can be powered with a USB power bank, but I think 3AA batteries is the best. Just be sure to add a switch in the circuit as well. For the main power wires, I run 2 wires all along the outside of the circuit, and strip them where they need to be connected. Insulated wire is harder to work with here, but is better because it will prevent shorts – sometimes you do have to cross the wires.

Final Touches

I finished them up by covering them with a  layer of clear acrylic spray paint so that the paint would not chip or come off.


Project by: Micah Black

Written By: Micah Black

Posted on Leave a comment

How I Process and Test my 18650 Cells

Old laptop batteries are a great source of Li-ion batteries, as long as you know how to properly test them to make sure they are safe to use.

In a typical laptop battery, there are 6pcs of 18650 lithium-ion cells. An 18650 cell is just a cylindrical cell with a diameter of 18mm and height of 65mm (approximately). If the laptop battery no longer works, there is usually just 1 group of cells that died, and the other 4 are still perfect, but you have to reliably test them all to make sure they work.

All my cells are tested with my 18650 testing station shown here.

Removing the Cells

To get the cells out of the laptop battery, all you need to do is break off the plastic casing. There are various methods that work here. Make sure to wear gloves and safety glasses – parts of the plastic casing can fly off, and are pretty sharp. The nickel tabs connecting the cells together are very sharp and can cut you very easily, as I have found out too many times.

1 – If you can twist the plastic casing and break it apart, then that is the best way to do it. This does not work on all batteries, and I am usually only able to do it on 3 cell Dell packs.

2 – Get a durable pair of wire cutters and/or pliers and try to break the corners off, or split it at the seam.

3 – Hitting the pack against the ground is a pretty good way to get the cells out. You might damage some of the cells, but this is one of the quickest methods of removing the cells.

Once the cells are freed from the plastic casing, you can get to work separating them into individual cells. They are usually spot-welded together in a 3S2P configuration (for a 6 cell pack). Cut all the wires going to the PCB one at a time to avoid shorts. The best way to get the spot-welded nickel tabs off the cells is to twist them off. Grab it with a pair of pliers or flush cutters,  and sort of roll it up. Be careful not to make any short circuits with the metal tools – the entire casing of the battery is the negative terminal, so if the heatshrink around it is broken, it can be easier to create a short circuit.

Initial Voltage Check

The first thing I do when all the cells are freed, is to do a quick voltage test. If the cells are over 2V, then they can go straight to charging in TP4056 chargers, or Liitokala Lii-500 testers. If the cells are under 2V, I mark them with a ‘V’, then charge them up with TP4056 chargers.

Self Discharge Test

Once the cells are fully charged, I let them sit for 24h, then measure the voltage again. If any cells discharge themselves just by sitting there, they will be weeded out here. Some people would recommend a week, others up to a month before testing them again, but for me, 24h is a fairly good amount of time. If any of the cells are under 4V at this point, then they are considered self-discharging, and are discarded.

Capacity Test

Any cells that passed the first two tests are now tested for capacity in Liitokala Lii-500 testers. OPUS BTC3100 are another common tester, but are more expensive than the Liitokala Lii-500, with the same functionality. They are charged, then discharged while measuring the capacity, and finally charged back up again. I write the capacity on the cells, and then sort them based on capacity. Under 1000mAh are discarded, and the rest are separated into 1000-1600mAh, 1600-1800mAh, 1800mAh-2000mAh, 2000-2200mAh, and 2200mAh+. I would recommend only using cells over 1800mAh in final projects, and using discarded cells as practice for soldering.

Sometimes IR Test

The last thing to determine the health of a cell is the Internal resistance. The Liitokala Lii-500 tests the internal resistance of a battery each time you put it in, but I sometimes do another test with my homemade Arduino IR Tester. This test is not really that important if you are using cells in low power applications (<1A per cell), but in higher power applications (1A+ draw per cell) it is more important. The higher the internal resistance of your cells, the more they will heat up as you charge or discharge them. The extreme cases can be caught just by monitoring temperature during the charge and discharge processes.


Throughout all these tests (particularly charging and discharging), I monitor the temperature of the cells. If any cells get over 40 degrees Celsius, they are marked as with an ‘H’, as heaters, and are brought back to the computer recyclers. Red Sanyo cells have a high tendency to heat up.

I have recovered over 2000 cells following these guidelines, and have been fairly successful in determining which ones are good. One word of caution though – Any cells that do no come from a reputable manufacturer – Samsung, LG, Panasonic, Sanyo – are more likely to fail even if they test good. Of all the cells I have used, only a handful of knockoff Chinese brands – SZN, CJ – have failed.

Have a look at my battery testing station here.

This method is by no means the best, most complete and accurate way of testing 18650 Li-ion cells, but it is just my take on it.

If you want to see more resources or other similar ways of testing cells, check out these links:



Project by: Micah Black

Written By: Micah Black