Arduino Battery Tester

Adruino controlled battery tester

Problem: Need to test Li-ion batteries inexpensively

Battery tester needs:

  • Ability to run tests over hundreds of cycles
  • Independent data logging, i.e. not tethered to a computer
  • Storage of test parameters in EEPROM
  • Flexibility in test options and battery sizes
  • Scalability so that many test units can be fabricated and operated
To address this problem, I designed and fabricated a distributed multi-cycle testing platform for long-term battery deep cycle testing. This test-rig was developed to cycle lithium-ion batteries over hundreds or thousands of cycles and logs data directly to a SD card in a csv format. The system is controlled using an Arduino microcontroller, and is programmed with all of the relevant test criteria. The test criteria is stored in EEPROM on the Arduino, so that the system will continue to operate normally in the event of power loss to the micocontroller. Otherwise, unplugging the system would reset the test parameters, cycle number etc… and would necessitate re-programming the micro and storing the incomplete test data. The system is designed to also fail in a safe condition in the event of power loss (i.e. the battery will not be shorted). The system is also designed to be used with LabView for real-time battery data monitoring. This allows for test parameters to be varied in real time while data is being displayed, which helps in determining system parameters for untested batteries. Bill Bradford greatly assisted in this project and did much of the work designing the PCB layout, parts selection, fabrication and debugging of the PCB.
Battery Tester 2
Adruino controlled battery tester

Adruino controlled battery tester
Adruino controlled battery tester

Parts list, and code files are available by request.

One-Handed Controller for Xbox One – Joystick Mods

Flightstick / Joystick being modified for Xbox One controller
Flightstick / Joystick being modified for Xbox One controller
The modifications have been made to the Xbox One controller, where most of the buttons and thumbstick controls were ran to IDC connectors on ribbon cable. Next up is to figure out how to wire the joystick buttons to the controller. The layout will be fairly simple. The main joystick will control the left thumbstick, which for most games is movement. The right thumbstick will be moved to the top of the joystick, which is how you will “look around” in most games. The tophat on top of the joystick will be wired to the thumbpad. A new 4-way contact switch will be used in place of the X-Y-A-B buttons. The right trigger will be moved to the joystick main trigger. And both bumpers and the left trigger will be moved to the contact switches located under the index, ring and pinkie fingers along the joystick body. There are a lot of individual wires to hook up here and the workspace is pretty tight. I won’t go into all of the details, but enough that somebody could figure it out pretty easily if they chose to.
Bottom of joystick Here is what the underside of the flight stick looked like with the case removed. Most of the wires will be re-used. The usb cable can be removed since that won’t be needed. I left the larger circuit board in place otherwise the buttons on the controller base fall out. I removed the small circuit board since I was going to use those button holes to run the ribbon cable from the upper joystick. The 6 wires running from the main joystick potentiometers will be used in place of the left thumbstick on the Xbox One controller. Many of the other wires shown here are running from the small circuit board which houses the buttons for the upper joystick controls shown in the following picture.
Upper Joystick Buttons This small circuit board is located on top of the joystick. It just holds all of the contact switches etc for the upper joystick buttons and tophat The wires run down into the joystick base where we can pick them up. All of these buttons are pulldown to common ground also, except the main trigger button, which for some reason had its own “ground”. I just wired the main button to common ground as the pulldown also. The ground will be the common ground run to one of the pins on the IDC connector in the Xbox controller previously. Now, basically, run down which button goes to which wire, track those wires to the base and label them.

One-Handed Controller for Xbox One

00 Projcet 01

A friend of the family suffered from a stroke which left him unable to use one side of his body. We went looking for a controller that would allow for one-handed operation of an Xbox One. He is a bit older so he never played any current video games, but if there ever was a time for learning anything new… I looked around at what was available for single-handed operation of Playstation or Xbox consoles, and was a little disappointed in the results. Probably the best overall is Ben Heck, who does engineer these units and sells them for a very modest price to help people with disabilities. In fact, much of Ben’s post was used to inspire and influence the design of this device. However, I don’t think that the design posted on Ben’s site is very user-friendly. A better design would be to graft the Xbox one logic onto a joystick. Basically replacing the left thumbstick with a joystick. I think that you will agree that this is a better design. I will be developing this as a I progress in the project.
01 Tools
First off we will need some parts / tools. I chose this Thrustmaster flight stick since it was cheap an had enough buttons etc too look like it would work. Also we will need a set of specialty drivers since the Xbox uses some funky tamper-resistant screws. The Macro Bit Set from IFixit has all of the necessary bits.

Partly disassembled Xbox One controller. Upper housing.

Remove the front and back covers. Back wing covers just snap off with a little coaxing. Then there are 5 security screws which allow removal of the rear shell and access to the boards.
Rumble motors attached to controller and wired to lower circuit board.
Remove rumble motors. These need to be detached before the boards can be removed from the shell. I am not re-using these so I just clipped the leads off at the board.
These few websites give a detailed explanation of the board layout, what buttons go where etc… Take a look to familiarize yourself with the info. I am not going to re-create this info since they already did such a good job of laying it out. The subsequent images will just be an overview of how I wired the system up. It should make sense if you have read / watched these links.
Separating Ribbon Cable into individual strands
Separate ribbon cable with a razor. Be careful not to nick the copper core, just go slow and work in small sections.The upper and lower boards were each wired to their own 16-pin ribbon cable. Make sure to purchase the corresponding IDC connectors for the particular cables you are using. These allow for easy assembly / disassembly of the controller after the mods are in place. Make sure to buy some extras, I broke a few while removing and repositioning ribbon cables during debug. Individual wires of similar gage can be press fit one at a time into the connector. I used a jig to do this which consisted of cutting the clips off of one of the latch elements which come with the connectors. If you are connecting the entire ribbon cable, you will want to use some pliars to get the IDC-connector to properly penetrate the insulation and make a good fit.
Soldered cable to Xbox One Controller lower board
Soldered cable to Xbox One Controller lower board
Here is the lower board all wired up. In the left image you can see where the hall sensor is connected to the 100-Ohm resistor. The hall sensor is the little black box in the lower third of the image wired to the grey cable and next to the red cable (which is my common ground contact for the entire assembly). For the other sensor remember that the hall sensor is mirrored and rotated so make sure you wire to the correct contact. I initially soldered to the wrong one and had to disassemble the controller during testing to fix it. All of the buttons are pull-down, meaning that they go to ground when they are “clicked”. This makes it easy, just use common ground for everything and you should be find. The hall sensors go to ground through a 100-Ohm resistor, probably to emulate the actual signal from the hall sensor when in the presence of the magnet in the trigger housing. It is not shown here, but all solder joints and wires were hot-glued in place after soldering to provide mechanical stability to the fragile wire-solder junctions during controller assembly and use.
Soldered ribbon cable to XBox One Controller upper circuit board
Upper board soldered. The bumper buttons are soldered to ribbon wires run under the board which you cannot see in this view. The bumpers are the contact switches shown on the top of the board in this view. There is another button (B-button) which is located on the lower board. I soldered a tag line to that button on the lower board and ran a cable-wire to the approximate location on the upper board. Then when the boards are reassembled in the controller’s plastic shell, I soldered and heat shrinked that single wire to pick up the “B” button on the upper board serial cable.

Onto the joystick mods in the next post

Harbor Freight Small 40.5×48″ Trailer


I wanted a small utility trailer to haul around general house / yard stuff as well as something that would work for camping in the mountains of Colorado in style. I’m taking up flyfishing and it just sounds like a nice change of pace to go fishing / camping on the weekends and try to get away from all the crazyness / monotony of the work world and unwind in a way that did not bust my ass in the process, i.e. climbing, biking etc… At any rate, I needed a small trailer that would work behind a Honda Accord (yes I own just about the most boring car there is, but the damn accord is hard to kill, more mods on the Honda will likely follow in the future). Standard sized trailers are great for hauling full sheets of plywood but an 11′ long trailer is a bit ridiculous for a car with a max towing capacity of 1000lbs. I found some pretty cool trailers at, but by the time you tricked it out it would cost ~$3K, which is ridiculous. So I went where any cheap-o would go, Harbor Freight. And yes, this trailer is true Harbor Freight material. For those who aren’t familiar, Harbor Freight is basically the Ikea in the world of tools. Yes, such a place exists, and they have franchises all over the world peddling dodgy shit as tools. Some things work as advertised, but generally it is a bit more of an engineering challenge, and mechano-electrical endeavor than even simply assembling Ikea furniture. In point of fact, this trailer needed to be welded rather than bolted together. Built square (obvious, but not detailed at all in instruction “manual”). Re-engineering of the trailer receiver. Design and fabrication of the trailer “cage”. And a little multimeter work to debug the ground fault in the wiring. Plus some soldering or crimp connector equipment. So all-in-all if you feel intimidated by assembling furniture, give up now. Ok, onto the build. I don’t have nearly as many pictures as I should to describe the process I will try to recall what I did from memory. Your results may vary. Also, my initial design was taken from Charles Trailer Build , his site may clear up some of the things I may have missed in this post.
    • First: Unloaded packaging materials and found out where everything went.
    • Second:Assemble most of the parts with the provided bolts. An impact drill works wonders for the nyloc bolts, just don’t tighten them down too much at this point.
    • Third: Mark the obvious top and bottom welds with Sharpie. Disassemble. Strip paint from weld locations. Reassemble. Square the frame. If you don’t know how to do this google it and you may want to reconsider if you are up to building this thing in the first place.
    • Fourth: clean / grind / paint welds.
    • Fifth: Attach the rest of the shit in the box to the frame.
    • Sixth: Deal with the bearings.
    Basically, your have to pull apart the hubs, fish out the bearings, clean everything, repack the bearings and reassemble the hubs. Don’t beleieve the hype, just buy a bearing packer to press the shit Chinese grease out of the bearings. Don’t bother with trying to “clean it out” or “just use the palm of your hand to repack the bearings”. The bearing packer costs about $25 and you will be glad you bought it. Also, to get the medial bearing out you will want to cut a small block of wood to knock it out. You will know which bearing when you get to it. If you fucked up and put a screwdriver under the lip of the bearing seal thinking you could pry it loose, you will need to replace a spring. I just bought oil seals of a similar size from AutoZone and swapped out the inner springs. Again, you will know when you have reached the part of the medial bearings. Then repack with the bearing packer and some decent grease from AutoZone or whatever auto parts dealer is closest. Wear gloves and make sure you don’t burn down the garage with greasy rags.
  • Seventh, Stick wheels onto axels. This is self explanatory.
  • Eighth, Admire work, drink beer, wire the thing up. 20140420_175258

Wooden Decking

The manual suggests using plywood. Plywood kinda sucks for a trailer for obvious reasons. It swells when wet. Actually it basically sucks outdoors. You can paint it, but it will get borked pretty soon regardless. Treated lumber is probably the best bet for decking etc in the trailer world. Home Depot now sells what looks like less poisonous treated lumber. Their sign says that it is safe for vegetables, even has a hand pulling out a bunch of beautiful carrots from fertile soil in the picture, but if you believe that this shit wont give you colon cancer than you are an idiot. But it will work for a trailer that I don’t intend to eat. All of the decking is 5/6″x6″x8′ redwood-color treated lumber from home depot. Since the trailer is pretty close to 4’x4′, 8′ long lumber is the obvious choice. I think it took around 12 or 14 boards total. The lower decking is 2×4 treated lumber.


I used all 1/4 inch bolts for all non-supplied hardware. Virtually all of the hardware was 1/4″ carriage bolts with cut washers and lock washers. This combo is cheap, more than enough strength and easy to work with. Since carriage bolts do not require washers, they grab the wood under them and sink in, resulting in smoother surface. If you are a masochist, you could try counter-sinking hex head bolts, but there are a lot of them and you will be sad if you tried. Also, non-countersunk hex heads would be a bad choice. Hinges are obvious type, same with gate latches

Deck base

The base of the deck was made from pressure-treated 2×4 boards laid across the three main horizontal members of the frame. They were bolted down on the edges and with 2x bolts in the middle of the frame. Cut out the obvious holes for the stakes. Attach with 1/4″ hardware in a manner that allows for clearance of 1/4″ hardware for decking above. This means leave space for the cut washer from the above decking so that it will fit between the bolt hole and the steel frame. Then add upper decking. Cut and install stakes. Cut and install fence rails. Build doors, install hardware. And you’re good to go. The pictures make it fairly obvious what to do given that you have done this sort of thing before. Trailer with stakes

Re-engineer the receiver

My receiver would not physically fit over my hitch ball. I think this was because I used an impact drill to fasten the nyloc bolts throughout the trailer, including the two bolts which hold on the receiver. I may have over-tightened them which caused the lip of the receiver to bind in the housing. To fix this I just took the receiver off and slipped a washer between the receiver and the trailer tow arm. Then the whole thing worked like a charm.

Finished Trailer

Trailer is ready for inspection and plating. After that I will have to build some stuff to allow the trailer to move with the back gate in a lowered state, since I want to be able to carry 2×4’s and such. The trailer will also need some plywood interior framing that is removable so I can carry dirt / mulch without it spilling all over the road. 20140427_161559


Additional Notes

One of the rear lights did not work for me initially. Turns out it was a ground fault. This is because the ground wiring for the trailer is the frame (which is pretty typical). However, since the frame is powder coated, if your nut does not scratch through enough paint during assembly of the rear lights, then the lights will not have a ground. The fix is to just scrape off some of the paint under the nut.