Raspberry Pi Tools: Power (supply) Tools!

Pictured above is an Anker brand LiPo battery pack for use in charging USB devices. Although Anker is an Amazon phenomenon, their products stand out in that they aren’t garbage from Shenzhen. They’re actually very well engineered pieces of hardware. Qualcomm Quick Charge enabled, and with 2x DC outputs for prototyping stuff (as I do), this thing rocks. 2000mAh battery capacity too. Pretty beef for being small. I use it to do power supply experiments with development boards.

This is a Portapow brand (Amazon again) USB power monitor. They work very well, although I’ve received a few broken. I think that’s Amazon’s fault, though, not the company itself. Their charge cables are beefy and pretty well made. Their products just seem to work. Also it gives you it’s own specifications for it’s power drain so you can account for that in your experiment. Super slick. It’ll monitor up to 20v DC and 4A of current, although its more suited to 2A under constant load.

Then you’ll need a dev board to test, like the Raspberry Pi seen above. It’s got it’s IQaudio DAC onboard, but not enabled in software as we will be booting from scratch to take a measurement of how many mAh the unit takes to run an update process after first boot, with a DAC, of course. Why? Just for the hell of it.

I’ve cleared the memory on the USB power supply monitor, and written a fresh boot image to SD card for the Pi, which has serial terminal enabled in the /boot/config.txt file. That way we can see exactly how much energy the process of booting, running updates, and configuring the device to use the DAC takes us from the first miliamp of power used. This is very useful information: if you plan to go set up a Shairport-sync client at a friend’s house, and all you have is a USB battery, this test will tell you how big a battery will be suitable to the purpose. If you write python or develop ARM software from scratch, this same procedure can be used to see how much energy a newly minted product would be using to boot and get an Over The Air (OTA) update.

With the Pi plugged into the USB monitor and the monitor plugged into the battery, we’re ready to power up. I’m using an FTDI programmer and a cable I’ve prepared to use UART 1 for a serial comms terminal. I’ll be using Putty on my PC to talk to the Pi and monitor it’s progress during updates and I’ll also be configuring the DAC the same way.

As I run the apt-get process and update the firmware (after configuring wifi and country info, of course) I watch the amount of current bounce around in pulses as the microprocessor does it’s calculations and operations. Microprocessors tend to demand large pulses of current versus a smaller comparable amount of current over time at idle.

Usually the idle current is roughly .5A, but during updates for the software and firmware, the device pulls a peak of roughly .98A. Couldn’t get a photo cuz I was too slow on the draw. After 14 minutes of time (Gawd-Dayum!) the Pi is configured with the Fake KMS to run the DAC card, had all of it’s firmware updated, run all of it’s software updates, and is ready to rock out. This is considerably less time than the original Pi series took to run updates without 5G wireless and without the upclocked ICs (chips.) Less time to run updates translates to less power used overall (I have to test that! Cuz I don’t actually know that.) 148 mAh was used in total during all of the updates and reboot cycles. That includes the power needed to supply the DAC board.

I hope this mundane test cycle has helped you understand a little bit about one way to put a device under test for power supply requirements. This is not the most useful example. A better example would be for me to create a Linux image with my custom configurations and software on it, and to test that package for boot and update requirements. This can be a critical part of product design, wether it’s a product for you and your friends in a recording studio or a product Designed For Manufacture.

Raspberry Pi: Why you want a DAC

Raspi Model 3 B+ with 5G WiFi and a 64bit processor. With Prince Purple caseDogshow! I like the Raspberry pi’s form factor and cost, but WTF do I do with it? Once I’d read other pages on burning the SD card, setting up wifi, and the rest, I didn’t know what to make regular use of a pi for. Then I discovered Shairport Sync audio player by Mike Brady. Thanks Mike! You rock! It allows me to make my pi into a dedicated airplay device through my iPad or Macbook Pro or my hacked MacPro from 2009.The audio built into the pi isn’t really all that sexy. Pretty minimal. It works. I like the pHAT DAC from Pimoroni and the Pi-DAC Pro from IQuadio for my audio outputs. I don’t actually use the pHAT DAC anymore, as I gave both of them to my dad, who absolutely loves them. He uses one in the garage and one in the house, and the wifi keeps em both synced. But the pHAT DAC is a solid product, and the Pimoroni tutorial and “how to” page is brilliant, simple, and pretty impossible to screw up. Links and specs for both DACs at the end of the post!Anyhow, the reason you want a breakout board with a DAC if you like high quality sound conversion (from digital to analog, of course, in this case) is because it’s better resolution at a given rate. According to a very cursory google search, stackexchange says “Raspi has an approximate output of 11 bits with AGC(1).” AGC is Automatic Gain Control, used in casette decks. Awful stuff here. It essentially cranks up the soft signals and attenuates the loud signals. It’s used to compensate for mastering tapes and other media at different “line level” standards. 11 bits is better than casette tape, but it’s shite by today’s quality. pHAT DAC isI have built shairport devices using the Raspi 0 W, with 2G WiFi, and also with both model 3 B PCBs. I love the new Model 3 B+. Fast. Efficient. Sleek and sexy like an El Camino, as Archer would say. I digress. shairport-sync actually works remarkably well across all three models, and with either the pHAT DAC or the Pi-DAC Pro. I have done both hats on all three pieces of hardware. Winner, performance wise? Model 3 B+. Zero W and old Model 3 tied a close second- seemingly indistinguishable from one another performance wise. Probably attributable to the 2G WiFi on both platforms.
Pi-DAC Pro. Soldered up with (almost) every useful (to me) header pin. Except for the XLR audio output pins, which I haven’t done yet for this unit.Pi-DAC pro, atop a Pi3 B. XLR headers installed- they work a dream too. I run them though my Audio Technica AT1220 mixer and it bounces those meters proper.Differences between both DACsWhat a DAC is, why it’s better than the stock audioHow to install PI-DAC Pro on either model of Pi3Specs: Pi DAC ProSpecs: PHAT DacFootnote: (1.) https://raspberrypi.stackexchange.com/questions/9831/what-are-the-specifications-for-the-audio-output

Something Useful: Set up Pi-DAC Pro on Pi 3 Model B+

Hey y’all. You want to use the Pi-DAC Pro, right? I did when I saw it. If you are planning to use it with software that requires the “GL (Full KMS) open GL desktop driver with full KMS” option in the “Advanced” settings when running raspi-config, know now that I’ve only been able to make the PI-DAC Pro work with the “GL (Fake KMS)” option enabled instead. That’s just me, there may be ways around that, I haven’t looked into it.Another thing to note is that I run the Shairport-sync software from Mike Brady (big ups, Mike is the shit!) and I run it in command line, not on a desktop environment. I also disable my built in Pi Audio jack by adding the a comment to the /boot/config.txt file, in the audio section at the bottom where it says “dtparam=audio=on” so it readsĀ “#dtparam=audio=on.” I then add another line that says “audio-_pwm_mode=2.” The last thing to add is another line reading “dtoverlay=iqaudio-dacplus”. This ensures that after you run “sudo raspi-upgrade” and reboot, that the software will use the updated PWM audio drivers, and it will load a piece of “Device Tree Overlay” software that enables hardware to easily work without having to compile it yourself.Basically, just run raspi-config and go to the Advanced menu. Then go to GL Drivers. Enable Fake KMS, the second option down. Then reboot. If you’ve done the process properly, you should be able to run the command to list Alsa Player audio cards after login and getĀ “card0: IQaudIODAC” back from CLI with a bunch of stuff after that. There is no software to compile and install as the Device Tree Overlay takes care of that stuff when you add it. It’s a convenient way Pi has made certain common pieces of hardware easier to use for new users, by enabling the corresponding software when booted with the dtoverlay in place.

How do I like my Pi?

Everyone who makes hardware has preferences as to how they wire, bypass, interconnect, and power their instruments. The Raspberry Pi is no exception. In my case, there are things I like to do to them, and wether you agree or not, here they are. I’ll attempt to explain my reasoning, poor or not, as to what I do.I like to overclock Raspberry Pis, or at least I did, until the newest model upped the CPU speed slightly. When I used the Raspi 2 I overclocked the hell out of them, same with the Pi Zero W. Because I’ve done lots of this tinkering, I’ve found that it’s beneficial to heat sink the RAM. I overclock the RAM if I can get away with it too. Can’t help it. I like hot rod hardware. Anything pushed to it’s limit is interesting to me. In the photo I used a small Silicon pad to adhere the heatsink to the RAM.You can see the blue sink sitting under the rubber foot on the enclosure. I really like the Pi Coupe from Pimoroni. Its the highest quality case I’ve used for the cost, and it’s very flexible because of it’s low profile. I used to use Samsung EVO SD cards but I find the Sandisk A1 speed are the fastest and most reliable these days.On my most recent Pi 3 B+ I didn’t bother to heat sink the RAM, but it would be a good idea. Having to add stand off washers to the coupe enclosure is also a good way to provide ventilation while you provide heatsink clearance.Seen above is the heat sink, not touching the acrylic (barely!), and the three 4-40 standoff washers I added to clear the sink height. Structure of the enclosure does not seem to be compromised by the addition of the washers. I power my Pis through the power pins on the GPIO header to prevent the very real possibility that the usb power input could be damaged. The damn things are far more fragile and harder to service than the GPIO pins. I spliced Dupont crimps (I think that’s their OEM name, they’re the little square header wire crimps) onto the + and – of an old Radioshack 5v 3A supply I had in The Pile. I like this method as well because you can probe your power brick with a meter to see that it’s voltage is over 5.1~5.2v under load before you modify it; that way you don’t get “under voltage warnings” from the pi in serial terminal.The Pi above has a 1000uf/10v electrolytic bypass capacitor: Panasonic M Series 105*C rated. It’s to keep the power supply from sagging or browning out anything on the DAC board (Or the host Pi for that matter) when I might be simultaneously doing updates or compiling software and listening to music. There is also a bypass on the Red Pi above: a Panasonic M Series 100uF/16v 105*C. Same purpose.In the case of the Airplay client I use at home, seen above, I also made an enclosure with both sexes of XLR output for the DAC so that even if I were somewhere else where they had a different mixer or amp (with different sexes of XLR), I could still use the Pi.I like to communicate with Pi through serial terminal and a pre-prepared FTDI programmer. I’ll do a separate tutorial on a first time boot sequence with a minimal install of Raspbian, and I’ll include a demo of how I like to prepare FTDI programmers before I use them.

A Mobile Cluster Computer… in a bucket

Dr. Dogshow’s bucket of mothafuckin ARM cores. Ugh, sorry, I was channeling Samuel L. Jackson for a second there. This is Part I of what will be several posts detailing software and hardware configuration I had to do to make it run. That’s right 56 ARM cores, dawg. In my usual half baked pursuit of whatever I get excited about, I decided to go from building hardware for a while to building Apache Hadoop on an ARM v7 Cluster I built using Odroid XU4s, an Odroid MC-1, and an Odroid HC-1. I shoved 7x PCBs into a Rubbermaid Tub, complete with Ethernet switch, broken out USB 3 panel connectors, a power supply monitor, and some kick ass Noctua fans. Why? Great question. Cram it with walnuts, mister questions. The answer is simple: “Why? Why for kicks, my good man!” Actually, the answers are many:

1.) Nobody I’d seen do tutorials on line had ever done a cluster that worked with wifi and had a local ethernet packet forwarding scheme. Several people said it couldn’t be done cuz blah blah something dogshow whatever. Bullshit. I did it, and I am actually pretty inept when it comes to software and computing in the modern Single Board Computer scene. Here’s my lit up wifi USB3 card from Odroid’s website:2.) I wanted to see what I could do. Simple. You can’t explore the sonic tapestry of the transistorverse using a synthesizer if you don’t have a synthesizer to explore with. So I wanted to build a tool to explore cluster computing.

3.) I wanted to see if I could do it, as a coworker postulated that I would fail. I succeeded, then got bored instead. Also as my girlfriend suffered a psychotic break last year, it was good to have something I could do while keeping an eye on her that didn’t involve anything sharp or hot.I’ve used Raspi, like soooo many, but Odroid was sexier. Expense be damned, I could be using the same chipset running my mad ass Samsung? Sign me up… Like 8 times.

I use an HC-1 as a media server full time for my smart TV, and the other 7x boards are in the cluster: 2 XU4s, 1 HC-1, 1 MC-1(4x smaller HC-1s with no SSD slot.). The work like Pi. I run Ubuntu Xenial Armbian. Software stuff later!I like to have hard access to the terminal on the head node all the time. Thus, I installed an orange cable and one Odroid serial to USB adaptor using the Silicon Labs chipset, not FTDI (although those work with a few mods!) Heat shrinked, for her pleasure. Actually, it’s cuz you might touch it to a supply rail on the top and ruin your day or you might let it fall inside where it is a DOGSHOW of a rat’s nest.First I had to build the physical beast, cool it, power it, monitor it, and make it work just to boot the PCBs. Then I can configure everything in the software. Here’s what I came up with after gettin good and loaded and just diving in. I had a vague idea of where to put everything. For Christs’ sake, I have to stop building stuff with that attitude. It kills me every time.

I bought the USB panel breakout and the DROK brand (oh God Shenzhen special lol) current and voltage meter on Amazon. Both work. It was my only, really, criteria. I believe them both to be of poor quality. Thanks, Jeff Bezos. The current meter has a shunt associated with it that carries most (but not all) of the 5v load in the system. It omits the panel LEDs and I believe that’s it. The 120v input to the 5v 30 amp switching supply from Meanwell also gets split and goes inside on the enclosure to power the wall wart that runs the 9v for the Ethernet Switch, which is literally taped to the back of the switch itself, and the pair mounted inside, vertically.Visible on the lower left is the switch, coming up the side of the enclosure (tub)Behind the wire-wall and knots of cable ties, you can barely make out the HC-1 and MC-1 stack on top. Please excuse the awkward photo angles- I can’t take the lid off while the unit is on, so I just moved it outta the way. I kinda farmed the construction. I just went at it, tooth and nail. It works, but it shows that I was just trying to finish the damn thing: screws too long, a terminal block left unused, a hole with no function and a rubber stopper to plug it, and extra un filled screw holes- which really really make you look pro.Hole unfilled again, and another pair of really absurdly long screws.And my favorite: Square holes, totally farmed on every side, for the Noctua fans.And another missing and mis-aligned screw hole. Bravo, dogshow. However, sarcasm about appearance aside, the unit functions as intended. I’ll be listing my components, making a block diagram for the power supply, and posting some links to the blog that taught me (mostly) how to run a MapReduce job with Apache Hadoop after configuring the hardware with cluster software. This cluster has a literal TON of work associated with it, so I’ll try to be thorough documenting what was done to make it work.Here are some photos of the build from the top down, with the lid removed completely. Another though was that I could really clean up the wiring: make things the proper length, crimp wires together at the ends to avoid stacking multiple spade lugs on the terminals of the power supply, and route them inside of the enclosure using zip ties and cable restraints. No Matter. The first build is always an ugmo, aesthetically speaking.The white goop is silicon to seal the panel meter for airflow. This thing heats like an oven when running Hadoop.Next Cluster post will be more technical, and I’ll be enumerating the hardware I chose as far as SD cards, USB flash, fans, heat sinks, ethernet routing, serial and ssh terminal details, and I’ll start getting into how I set up the software.