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.

ADC

The ADC makes more sense now. It turns out Professor Atkins has been waiting as we figured out that the weirdness we’ve run into is due to tremendous electromagnetic interference. My math GSI was incredibly kind and willing to spend about an hour helping me fix the statistics. I don’t know why the corruption I ran into was occurring, but we did establish that what GSL calls total sum of squares is actually variance. I’ve added a real TSS function, as well as an output of absolute value of residual. Here’s the best graphs we got previously, rendered with the latest graphing routine:

ADC3 with latest graphing.

ADC5 with latest graphing.

ADC6 with latest graphing.

I didn’t want to disrupt the servo guy’s work much, so I moved Gumstix over to the power supply and set it back up. I didn’t use the breadboard to ground the unused ADCs, and put them all in the same alligator clip instead. I thought I would calibrate two more channels so that we’d have a usable input for the gyro reference voltage. I was very surprised with the results:

Behold ADC2!

Behold ADC7!

This makes so much more sense for many reasons. As I pointed out yesterday, there was a consistent, significant distortion under 1v. This is nowhere to be found in the new line. It’s actually a line, and there is only a minuscule difference in counts for the same voltages between graphs. This is acceptable as imperfections in the voltages we fed it as in this respect our power supply is… abstract. This line also goes up to 1024 at 2.5v, which is what it should actually do as it’s the maximum count at the maximum voltage. What I find amazing is how huge the effect of electromagnetic interference is! We got completely different information when using the breadboard, and even its imperfections were consistent! Professor Atkins revealed that she had let us spend hours on this fruitless calibration of electromagnetic interference so that we would thoroughly learn the importance of electromagnetically clean wiring. Lesson learned!