Solar Charger

A black box with a red lid that is secured by a screw. The lid has "Power by Steve" written on it in cursive. There's a barrel connector and a USB C connector plugged into the box.

I made a 10 Ah solar powered charger! It uses an Adafruit solar/DC battery charger board and a 5V booster. The case is 3D-printed in two parts – the lower shell and the lid. As is visible, the lid screws down into the shell. Both boards that things plug into are screwed down as well for better stability. My Apple devices wouldn’t charge from it at first, and I learned that they need specific voltages on the data lines (or, presumably, USB PD, but that’s way harder) to determine how many mA is safe to draw.

I’ve been keeping it by my south-facing window plugged into a 20W solar panel and using it to charge my devices, but there are cheaper still-6V options if lower wattages work for your use case.

If you’re interested – more details:

I needed to add a thermistor to the battery to safely charge at higher than 1A, which seemed especially important given that I wanted to output 1A and the solar board will not draw more than the maximum charge rate from its sources. Then I was able to cut the 1.0A selector and solder the 1.5A, as is visible on the board.

The resistors you can barely see in the middle upper part of the board was for an ill-fated LED to show whether it was charging. It was too bright, broke off, and was redundant when you can look in through the gap around the USB in and see the LEDs on the solar board anyway if you really want to. The existing red charging LED even makes the lid glow in dim enough light. I had made holes for what was going to be external counterparts to the red and green status LEDs and that was very, very unnecessary.

Early on aligning the holes correctly was difficult, so for more than one case I ended up ripping the wall apart until things were situated correctly. The data line voltages I made with voltage dividers and this handy Adafruit diagram:

Lacking those exact resistor values, I found values with the same ratios that were close enough: 100k on the D+ line, 47k + 10k on the D-, and after two 47k + 22k.

Parts, as sold by Adafruit:

Together with:

  • an estimated $1.85 of PLA
  • JST XH header and plug for the thermistor (and tape to tape it to the battery)
  • three M2.5×5 (the solar board can accommodate up to 10mm length; I don’t remember why I did that)
  • M3x35, and an M3x10 if you want the breadboard to be very secure, though in my experience screwing down the boards is more than enough
  • the resistors

The breakdown totals to $162.85, so let’s say you can build this solar powered charger box thing for maybe $170 or so! (Depending on how much of the incidentals you already have of course.) It’s the opposite of a deal, but it’s fun! The battery is held in place with sheer tightness of fit and yet does not rattle, which I’m proud of. It does mean that you need some kind of hook to coax it up and out, which I’ve been using curved tweezers for (with the soft plastic tip cover left on), and that is preferable to adhesive in my book. The files for the case:

Power Supplies

Not for computers – for other electronics. I’d glossed over the “it can supply 600mA peak” part for my microcontroller board’s 3.3V regulator, and assumed I wouldn’t hit it. Then I spent a great deal of time trying to diagnose strange nondeterministic behavior. The OLED display would quickly go blank. The SCD40 CO2 sensor would quickly stop providing data. These problems all immediately stopped when I used an external power supply capable of higher amperage. Go figure.

Published
Categorized as Hardware

Feit Electric LED Strip Light Pinout

Tested on Costco item #1528979, which is in a black box. They’re still selling one in a white box online. (On further inspection its pinout seems the same.)

  • +: GND
  • B: D-
  • R: D+
  • G: VBUS
  • W: CC2, SBU1, CC1, SBU2
Published
Categorized as Hardware

Maker Stuff!

It turns out that it’s pretty dang gratifying to build embedded systems. Don’t like the power LED that’s always on? It’s your code that turns it on! You can turn it off!

I have three projects that are functional so far. One logs temperature to a MicroSD card, which helped convince the leasing office that my fridge was not cooling well enough to be food safe. Another displays CO2 sensor readings. The third sends door close/open events over MQTT.

Currently I’m working on giving a kitchen scale the MQTT treatment so I can make detailed cat food consumption graphs over time instead of manually weighing for two inconsistently timed data points per day. Next will probably be designing and printing a case for the CO2 thing, which is currently just a bunch of components taped to a power bank, and is very flimsy.

Headphone Recovery

I moved my computer, and with a new setup comes new hazards. My headphone cable was wrapped around my foot when I tried to get up, and it ripped the headphones out of the jack. Both the jack and the plug were damaged – the jack was no longer in one piece, and pieces of plastic had flown off its housing, and the plug was bent but still in one piece. We were able to bend the plug back into shape with a vice, but the damaged jack would only provide audio to the left ear. Enter jack retasking in the Realtek Audio Console:

I was able to use the remaining front panel jack, and made sure to run the headphone cable with less slack to try to prevent a repeat performance. There’s a bug here, too: even though I’ve requested separate playback devices for the front and rear panel, it only gives me two if the normally-output jack is set to output. Close enough, and if I really wanted to work around it I could probably rewire the remaining jack to appear as the output one by moving cables in the front panel connector.

Published
Categorized as Hardware

Indoor Air Sensors

I got a Metriful indoor air sensor, and wrote some code to expose it as JSON. It’s definitely not much:

Firefox renders JSON nicely

Looking again at the website, I see that 8 days ago they added what is hopefully a much better version of what I started. Yay!

EDIT: Yep, it’s way better:

Here you can see the light levels as the sun set, followed by turning on a lamp in that room for about an hour.

Published
Categorized as Hardware

CPU Upgrade!

I was having trouble hitting framerate in Beat Saber, especially with spectator view smoothing on in Koto. Upgrading the CPU helped a lot:

Ryzen 7 1700 with wider and higher frame time distribution.
Ryzen 7 3700X with narrower and lower CPU time more in line with GPU time.
Published
Categorized as Hardware

Announcing Raspberry Launchpad

I’ve been working towards this for several months, but today I finally wrote initial software for the thing:

It’s small; the screen is about 2″ diagonally.

The intent is that this provide useful information as you’re getting ready to go out the door. What’s displayed in the image above are easier, proof-of-concept things:

  • Sunrise and sunset times (this still required dealing with Daylight Savings Time, as if I needed another reason for it to annoy me)
  • Day and date
  • System uptime

As it is now I have it refreshing on the hour.

This is just the beginning, though! I hope to add support for configuration files, and weather and bus information too. It’d be nice to know what sort of temperatures to expect that day, and whether I’m likely to need an umbrella. And when to leave for the bus. (I have USB speakers so it could chime.) The e-ink display (PaPiRus Zero) I’m using has some tiny switches on it, but they’re not easy to use at all, so I’m hoping to figure out how to use a handful of keyboard keys. 3D printing will likely be very helpful with that.

It’ll involve more hardware work, but I’m also hoping to have this thing provide a UI for measuring the weight of my cat’s food and water bowls. Currently I’m doing it manually, and I only get a start and end measurement for each day at varying times, so there’s a lot of slack to it. If I automate it, every few minutes will be no problem, and I can get an idea of his consumption rate. Graphs! This seems likely to require more soldering, as I haven’t been able to find a USB scale that operates in grams, but I have been able to find someone else with the same problem who solved it by soldering things.

You can find the code here.

Published
Categorized as Hardware

Hard Drives

It’s not a question of if, but when. Hard drive failure has been a large part of my life recently: this server, my desktop, my roommate’s laptop – and all I can easily do is keep an eye on smartctl. More realistically, I should likely configure smartd to do it for me, but that’s for another day. Resizing an encrypted partition is rather…. manual. Apparently the way to extend a partition in fdisk is to delete it and recreate one with the same type and starting position but farther endpoint. Nerve-wracking. At least I have yet to lose data to hard drive failure. Part of it’s being careful – backups; checking drive health – and part of it’s luck. My roommate’s laptop hard drive died completely and without warning. Storage is fragile.

Published
Categorized as Hardware

Problem Types

I find that among my least favorite types of problems are those that I’m unable to learn from. My main system drive was spontaneously remounted read-only, and upon Alt-Sysreq-reisub’ing, the OS didn’t come up and I got “error: partition not found” and a grub rescue> prompt that couldn’t do anything; not even “help.” I pushed in all the SATA cables and it came up, but upon reboot the drives were out of correct boot order. Bizarre. The part about this that scares me is that I’m for the most part unable to learn anything from this, and I wasn’t able to do anything to stop it from happening again because I don’t know why it happened. The same thing applies to the mysterious times this machine goes completely unresponsive while idle or suddenly doesn’t have video on boot, then spontaneously regains it. The former has happened a few times, the latter only one.

From programming in assembly, I finally realize how segmentation faults are really nice compared to the alternative. Data and instruction separation is a luxury. Miss a bounds check and suddenly you’re executing things not intended to be instructions and you get really weird opcodes and the whole thing dies. It can get really frustrating.

I realized the only reasons my server has gone down at dad’s are due to external forces: either the power has gone out at the power outage or circuit breaker level, or cables have been unplugged by unwitting family members. I wonder how much better colos are. ChunkHost was really nice, and I’d have likely continued once my “free beta” ended (I have my suspicions it’s a marketing thing for “free trial”) if I had more disposable income to the point where I felt I could justify a monthly fee.

EDIT: I had forgotten the time it went down as I was upgrading from Debian Lenny to Squeeze. I had set up a virtual machine for fallback, but I didn’t end up using it: in restoring the VM from backup I unknowingly uncovered a configuration problem with one of the hosted sites that showed up a few days later on the main server. Whoops.