Battery Testing with Raspberry Pi

Recently I purchased a portable phone battery on clearance. I want to use it to modify my defunct Pokemon Go Gotcha band, which no longer holds a charge, to run off the battery pack. I realized that a battery pack could also be useful for powering other small electronics, such as the Raspberry Pi.

The problem is, I wanted to get an idea of how long the battery would last powering the Raspberry Pi. Figuring this out isn’t really all that hard. The tricky part is that I can’t stand over the Pi and watch it until it dies.

So instead I set up a simple cronjob task to do the job for me. I had a spare SD card, so I threw a basic fresh install of Raspbian on the card. I configured SSH and WiFi, then did a quick run of “crontab -e”, then droped the following at the end.

*/5 * * * * date >> /home/pi/date.txt


Every 5 minutes, the Pi will now write the Date and Time to the file “date.txt”. It will do this until it can’t which would be after the battery dies, killing the Pi.

After charging the battery pack over night, I stuck the Pi on it and left it.

After checking back periodically, when I found the Pi was dead, I plugged it into a regular power source to retrieve the data. The result were both better than I had hoped, and not as great as I had hoped. The Pi started spitting out Time Stamps again after I plugged it back in, so I ended up having to skim through the file to find the time gap. I went ahead and truncated the data down to hour stamps until I came across the time jump from when the Pi had died and when I had plugged it back in.

So it turns out that the Battery pack will drive power for the Pi for around 12 hours. I also want to test this under a bit of a load and test how long it will power an Arduino writing to a remote database.

A Pile of Used Tech

I recently had an idea occur to me that I might be able to pick up used Raspberry Pis off of eBay more affordably than buying them new. I didn’t really find a ton of savings, but I did pick up an auction for a lot of various parts for fairly cheap.

I am not sure what I’m going to do with all of this, but it seemed like a deal for around $50. I was worried that it wouldn’t all be included, but it was. Not everything is what I had hoped though. Two of the three Raspberry Pi 2s seem to be dead. I’ve tried several trouble shooting methods so far. They turn on, but don’t seem to real SD cards at all.

The arduino is a genuine Arduino, which is nice, but its a fairly older model. Not a huge issue, but it is what it is. The screens were a nice bonus. I’ve been looking into getting a screen of some sort of my Pis, possibly for a RetroPi handheld build. I have not tested the larger screen yet, it seems to work off of a funky daisy chain of an extra board and some cables. I did get the smaller screen working… ish.

It’s a nice little touch screen that fits nicely on top of the Pi. I have not had a chance to properly troubleshoot it, but the touch works kind of funky on it. For one, it seems to function more like a track pad than a straight touch. Two, the mouse cursor only wants to move along a diagonal axis across the screen.

This all kind of feels like a configuration issue however, so there is some hope. Plus I am not sure I really need a touch interface for a RetroPi handheld build.

There’s some other fun stuff that I have not had a chance to mess with yet. There were a ton of ultra sonic sensors. I’m not sure what exactly these could be useful for, but I am wondering if they would be able to do 3D imaging of an object or a space.

There’s some funky board with a digital display on it that seems to be some sort of power board. I am not sure I’m going to have a use for this at all.

Lastly, there is a Raspberry Pi camera module. I have not had a chance to test it out yet, but like the screen, this was something I’ve been wanting to try out.

Fixing my New 3DS …

So, the title there says New 3DS, which is is the “New 3DS” but it’s also New, in the sense that I bought it at the start of January.  It’s like 3 or 4 weeks old.  Then I broke it on accident.  It’s taken me years to get around to saving the money to buy one of these, not so much because I don’t have the money, but because I wanted to know it was at a point in it’s console life cycle that it was worth buying.  If it has been say, $50 cheaper, I’d have bought one years ago.  Also, unlike all of my previous Nintendo based hand helds, I wanted to wait to get the “improved version”.  I have a Game Boy, a Game Boy Advanced, a Nintendo DS, but they were all the first gen models.  I didn’t care for the 3D gimmick, so I passed on the 3DS.  Well now they have the horribly branded “New 3DS” and in my case, it’s the XL version, because I like having a big honking screen.

I’ve played it pretty regularly since buying it.  This is kind of the problem with my argument of “waiting for the right moment”.  My track record with Nintendo hand helds has always been amazing.  I measure this by one real metric, how many games do I finish on them?  I’m pretty sure I’ve completed every game I own for Nintendo’s handhelds since the Game Boy, and I own a lot.  Contrast this with say, Steam, where I’ve beaten like 20% of my 1000+ game Steam Library.

On a side note story, that’s related here, the water out of the faucet at work is awful, there’s crap floating in it and it’s scummy and possibly not healthy (probably is for legal reasons though).  So in order to make my coffee each morning, I carry a metal water bottle with water from home, usually in my lunch box.

Anyway, a week or so ago, I put my 3DS in my bag I carry and went off to work.  On this particular day, I didn’t bring a lunch, so I just had my laptop bag and no lunch box.  I stuck my water bottle in the side pocket of my bag and drove off to work.  Upon arrival I found the bottom of my bag was wet and the top of the water bottle was not fully attached.  Incidentally, the water bottle was also empty.

I headed into the office to assess the damage here.  Headphones, some notes, the bottom of the bag and my 3DS were all wet.  Bummer.  I took everything that was damp and strung it around to dry out for a while and went about my day.  Later, as things were drying I tested the 3DS.  This was my fatal mistake, it turned on, but the cursor on the bottom of the screen was flipping constantly (due to water inside making an electrical contact) and when I tried to turn if off I got a cryptic message flashed up about “There is some kind of problem something something) before it turned off, for good.

I set it out to dry some more, hoping this would correct the issue.  It still didn’t turn on some time later, so I set about opening it up.  I’d already removed the back cover and battery, now it was time to crack open the case.  It turns out it’s a pretty simple task thankfully, there’s maybe 8 small screws holding the case shut. You’ll also need to remove any SD cards.

Side not to anyone trying to do this, there are two small ribbon cables along the top edge of the system that come off with the back cover.  These operate the shoulder buttons.  To actually remove the cover, you must lift the top edge gently a bit, so they the whole thing can slide down and over the headphone jack, then the cover rolls/flips towards the upper side of the 3DS, minding these cables along the way.  The cables can be removed and may even pop off, this is ok so long as they don’t get damaged.  They ultimately need to be removed anyway, using some small pliers or a screw driver, to remove the black square from the main part of the 3DS.  These connectors are designed to be removed and reinserted easily.

After removing the cover, I had a nice view of the inside of the 3DS.

On the plus side, once inside, things were not as bad as they might seem.  The way the handheld sits in my bag, only one end of it got any sort of water (the left end shown above).  On the minus side, there was a lot of water, like I had to get paper towels and dry it up all over inside, including removing the face buttons.  To get to the underside water, I had to also remove that board on the left side, it has 5 screws, 4 in the central area, and one near the bottom ribbon cable.

Once everything was dried, I reassemble it and tried to turn it on again, with no success.  So I opened it up again for a deeper inspection.  This was when I found what I should have noticed originally, the painfully obvious blown out components on the board.

Nothing else inside seemed to be damaged at all and all of the moisture was on this end of the console.  So I figured I’d look into replacing this power board (the batter connects to this board).  I figure spending $50 on a new board would be better than $200 on a new 3DS.  Fortunately, these boards can be found all over online, and even more fortunately, it only cost me around $15 to order one, a real deal non knockoff one too.

A week later, I had the new power board, time to swap.  It’s pretty straight forward as well, I removed all of the screws first.  Next there are two small ribbon cables that attach to the board, the one broad orange one and another smaller one at the top for the secondary nubbin that is on the New 3DS models.  The large orange one was simple, since the new board came with a new ribbon cable, potentially damaging the old one wasn’t a problem.  I was still careful to slide it out of the end on the main part of the 3DS.  After removing it, the gray bar is able to flip up so the new cable can be slid in and aligned, then the gray bar snaps back down to secure it.

The second smaller cable was a bit trickier, but due to it’s small size, I was able to flip the bar piece holding it down up using a small screw driver.  Once these cables were swapped, the new board gets screwed in.  Carefully reattach the two cables on the case cover for the ribbon cables, there is a natural orientation to these when the cover is attached, though it’s slightly twisted around with it removed.  Once everything was reassembled and screwed down, I reinserted the battery for the moment of truth of powering the system back on.

Which was successful!

I’m not saying this will fix any broken 3DS, there’s all sorts of other issues that could come up, especially with water.  This is more just how I was troubleshooting and fixed mine.



Building a Better Dance Pad

So a while ago, I designed and built my own Dance Dance Revolution Dance Pad.  I’m not going to go too much into the details behind that, but for a variety of reasons, I’ve actually used it considerably less than I’d hoped.  I also found recently that the arrows don’t detect properly anymore since they are connected to the Directional Pad which reads as analogue not digital.

So, I fixed it.  While I was fixing it, I finally added the button box I’d been meaning to add.


The button presses of a Playstation Controller are simply the creation of an electrical contact.  This can be replicated on any similar button by soldering wires to either side of the PVC board’s pads inside the controller.

Anyway,  the first task was to rewire the pad’s “buttons” to the shoulder buttons of the controller board.  Simple enough.  Now they show up as “buttons” and not analog pulls in the PC.

Step two was to make the box removable from the pad for easy storage.  This also allowed me to replace the ball of wire that I’d ended up with when building it the first time.

IMGP5406 This mess becomes a network cable and a network jack.IMGP5405 The network cable is the one used for the new connections tot he shoulder buttons.

Next is the box, which I wired to the four face buttons of the controller.  It really doesn’t matter if I use the “start” and “select” buttons since in the end, the Playstation shell is tossed out and I simply map the buttons to whatever I want in game (I have yet to see how this will affect it if i use it on the Playstation).


The end result is much cleaner and much more reliable all around.  I will probably add some stickers or something to the box to make it look prettier.