I’ve been occasionally doing backups of critical files to an external hard drive (in addition to cloud of course :). However, my nice portable drive was only 500 GB and lately I’ve pushed over 600 GB with my Nikon D7200 RAW files. Time for a new drive! Instead of boring mechanical, I noticed that the very nice NVME SSD with Adata XPG SX8200 Pro with 1 TB capacity was available nearby for just 140€ (ca. $150)!
Commercial alternatives like Samsung T5 cost around 230€ here, so I thought I’d get one of those M.2 enclosures. Unfortunately, the ones with NVME support started from 50€ up in Finnish web stores.
Ugreen to the rescue
When you have something like M.2 enclosure, you know every manufacturer actually puts Chinese electronics inside. Thus, AliExpress seemed like an obvious destination to check out. I’m bit doubtful to order actual NVME drive (there were some cheap flash drives in the past that did not actually have the reported capacity), the enclosure should be fine.
Enter Ugreen, my favorite in AliExpress store. I’ve purchased several chargers from them, many having QuickCharge functionality, and the packaging, quality and everything are always top notch. Therefore I was more than happy to find a range of NVME enclosures from them for just $15-30:
Time to order one! Fast forward 2½ weeks of anxious wait…
Unpacking and installing SSD to M.2 enclosure
I got the NVME model which promised up to 10 Gbit/s data rates, and chose the option with extra USB cable as I don’t have USB-C ports on my MB. The package arrived a bit faster than the promised 21-25 days. See the gallery below for glorious images of various stages of setup.
Note: The keyboard and keycaps in this article are bought by me and not a review sample. I have, however worked with KeyboardCo in the past and like them a lot in general. But just so you know!
A new keyboard in the house! Namely the Filco Majestouch-2 TK (MX Blue) Always an exciting happening in the family. After typing happily for a couple of years with superbly compact and slim Apple Magic Keyboard (works fine with Windows btw.) at home, and with my Topre Realforce 88UB at work, I thought it would be fun to get a keyboard with the classic clickly MX blues.
My main reason to get Cherries apart from the amazing blue clicky sound is the fact that one can get a wide selection of custom keycaps, very much unlike the Topre ones where you’re pretty much stuck with the keys they came with, or maybe some with Japanese characters.
After some consultation in Geekhack, I decided that out of the options I had available (in Finland pretty much zero apart from some gaming keyboards), Filco would be a good choice. Knowing they stock it, I headed straight to The Keyboard Company website and after some deliberation opted for one in Scandinavian layout — easier to swap here in Finland if I want to switch again. The Filcos are in no way inexpensive, but knowing the amount of time I spend typing, I considered the hourly cost to be quite reasonable.
Unboxing Filco Majestouch
The delivery from KeyboardCo arrived promptly as always, and I decided to shoot a classic unboxing video. Notice the great “Code and Life” logo in the thumbnail! There are no audio comments in the video, but you can hear the clickies quite well.
As an “out of the box” experience, here are my major plusses and minuses list:
Very solid build, the case will definitely last a lifetime
Great MX blue typing experience and satisfying sound
Compact layout, it doesn’t expand much outside the keys in any direction
It’s a “no frills” workhorse, not much more to be said!
Standard keycaps are quite high, making a wrist support pretty much a must
There’s nothing particularly exciting or special about they look
Custom Dolch Keycaps: Taking It to Another Level
Now that I got my keyboard, it was time to take step two: Finding proper retro styled keycaps. I wanted to avoid laser engraved ones in order to have the legends around as long as possible. Ideally I would’ve wanted PBT keycaps with very simple, centered legends, but turns out that ISO layout sets with these two attributes are *extremely* hard to find! So I made my peace with getting high quality double-shot ABS caps.
After long time browsing AliExpress and a dozen small suppliers in US (for some reason Europe has a limited vendor selection), plus some group buys, I settled on U.S. quality vendor PimpMyKeyboard and their DSA “Dolch” keyset. I got the red arrow keys and ISO kit as well, for a total of I-don’t-really-want-to-disclose after shipping and EU customs. Let’s just say the caps were more expensive than the keyboard. These baddies are worth their weight in silver.
Here’s a set of images for your drooling pleasure. Note also the nice Filco wooden wrist rest that works nicely and leaves the logo visible (it’s the smallest size I originally got for HHKB2. There’s also dedicated TK option but I just reach for cursor keys occasionally, so I don’t mind the narrower form factor.
As you can see, the keys look quite amazing! I especially like the font on these, and the color scheme reminds me of the old MSX computer my friend’s older brother had in the 80s. The red cursor and escape keys are a nice icing on the cake.
The PimpMyKeyboard caps are decidedly lower profile than the quite high originals, and the function keys even are a bit recessed into their deep settings. I think it’s a nice detail, but some might feel the caps a bit low for this Filco.
Main keys are good height and a pleasure to type on. For some reason, I had issues with the D key getting stuck down on my keyboard. I notified PMKB and they promptly sent me a replacement for no cost (and a fun “sorry!” sticker :), which was excellent service. The new D is a bit better, but it still sometimes gets held down, and I suspect my Filco may have its D switch some fractions of a millimeter off center, causing the issue with keycaps of slightly different dimensions. Nothing a quick swipe of a file won’t fix.
Plusses of PMKB Dolch
High quality doubleshot ABS caps
Excellent font, very legible and very vintage
Pleasant neutral color scheme reminiscent of the 70s and 80s
Written labels on special keys is very retro
Good selection of additional key kits including ISO, color highlights and gamer options
Fast shipping, great customer service
Darn expensive, cost more than a keyboard when shipped to Europe
High Filco original keycaps mean it’s an A- fit instead of straight A
No PBT option
I’ve now logged about five months of continuous use with the Filco Majestouch-2 TK and I can say I like the cherry MX blues well. They have a satisfying feel and sound, and there’s a certain feeling it imparts when you are using the keyboard. In mechanical switch realm I still think the Topre switches have a slight edge, but the difference is small and they lack the oldskool feel so I haven’t bothered hauling my Realforce from work over this time.
Main consideration with the MX blues compared to the browns for example is the sound level. The first four months I had the pleasure to type on my Filco while my wife was temporarily in Cambridge, and I could enjoy the clickies. Now that she’s back, the sound doesn’t probably bother her much (no complaints so far) but I am quite aware whenever I’m typing after midnight. In this regard, my previous Apple Magic Keyboard is more clandestine.
If you are on the lookout for a top notch mechanical keyboard, I can give a high recommendation to the Filco. A further recommendation for the MX blue option if you’re in an environment where the clicks won’t be a problem. And of course you can have another late night coding keyboard, so you get some refreshing variety in your life!
Also, thumbs up for the PMKB Dolch keyset, they are 98 % perfect fit for the Filco! I wanted a retro keyboard, and now I have it, and thanks for excellent build quality and good switches, it’s not just shiny exterior, but a pleasure to hack on as well.
I started writing another blog post about my new keyboard today, and when uploading the unboxing video to my YouTube channel, I realized they have no “auto white balance” option, not in their new or old video editor either. Shoot. After googling for free video editors, I settled on OpenShot.
And guess what? OpenShot doesn’t have a white balance setting either! The author himself said this on Reddit, asking for help to implement it. I was pretty shocked, as it seems like the first filter I would implement myself, and thought “surely it doesn’t take more than five minutes to implement one, right?”. So I did. Well, it took maybe 15 minutes, plus 45 fiddling with Jupyter notebooks to get PIL and numpy commands right.
The Python 3 code above basically loads an image (either local if you run it with Jupyter notebook locally, or over network), get a small subportion of it to act as a grey reference, and adjusts color channel balance with two alternate methods: RGB or YCbCr. More advanced versions should be easy to add as well.
You can view the above gist in Github or just copy-paste the code to your own / cloud based notebook to try it out:
Time for something completely different from my usual electronics projects. This morning I started to wonder (don’t ask why) a couple of fundamental questions:
If you’d convert the planet Mercury to a huge solar panel, would it cover the sun as viewed from earth?
How large portion of sun’s energy you’d get for the project if you started by covering the surface of Mercury with solar panels?
Assuming hyper advanced technology that could do this, would Venus or some other planet in our solar system perhaps be a better target?
The thought experiment initiated from some Science podcast, probably from Anatomy of Next scientist interviews (or BBC’s Tomorrow’s World), which talked about turning Mercury into solar panels or mirrors — essentially a Dyson Swarm.
Mercury is close to sun, so it’s a clear candidate, but I started thinking “If you were an alien (or future human race) with super advanced technology arriving to solar system, which planet would you pick?”. You could of course harvest gas giants for Helium-3 and use fusion energy to do stuff, or have some not-yet-invented energy source. But let’s focus on the giant fusion reactor in the center of our solar system, and look at some numbers.
Basic Data for Planets
If we think of sun as a perfect sphere putting out energy in form of solar radiation to pretty much uniformly to all directions, the amount of radiation reaching a certain planet is a simple function of the planet’s radius and it’s distance from sun (π*r^2 / d). Surely you can quickly google which planet gets the most radiation? Turns out most articles on the internet for laymen focus on energy per unit of area (square feet or meters), and leave out the size of the planet completely. Well, easy to fix! Let’s start with some basic data from NASA’s planetary factsheet:
Distance from Sun (10^6 km)
How Big Do Planets Look From The Sun?
Now as all planets are really far away from the sun compared to their radius and diameter, I’m just doing a shortcut and calculating their angle from sun as just the ratio of diameter and distance, owing to the fact that sin(x) ≈ x for very small values of x (second coefficient of Taylor series expansion is x^3/9 so with these numbers we’ll get about 20 significant digits correct). Calculating diameter/distance shows that even the largest planet from the sun, Jupiter, is just 184 microradians, that is 0.000184 radians wide when viewed from the sun! Full sky would be 3.14 radians, so there’s some way to go! Continue reading Solid Angles of Planets and Which Planet to Use to Build a Dyson Sphere?
You could get an excellent Bluetooth keyboard controller from Adafruit called Bluefruit EZ-Key which allowed super easy creation of projects that sent keyboard presses (for example a gamepad) just by connecting some switches to the pins. However, the EZ-Key cost $20 and is now discontinued. And in any case, Bluetooth-capable devboards are now available from AliExpress for a few dollars, so $20 today feels on the steep side. “Could it be done cheaper?” I wondered…
I have honestly about a dozen cheap wireless devboards lying around, many based on ESP8266 which only have Wi-Fi, but some also with ESP32 which includes Bluetooth. I spent some time trying to configure a Chinese ZS-040 serial Bluetooth module to function as a keyboard, but the AT command set was a very small subset of what the similar HC-05 / HC-06 modules have. After an evening of trying, I decided to give up on that. There are instructions how to flash HC-05 modules with RN-42 firmware to get Bluetooth HID capability, but it will require quite a few steps.
I also took a look at esp32_mouse_keyboard project, but for some reason or another, abandoned that avenue. Don’t recall if there were obstacles or the project was still incomplete a year ago, might also be that the ESP32 only had BT LE which technically didn’t support HID (Human Interface Device). Throw me a comment if you have that working!
Meanwhile, another idea dawned to me:
A Cheap Bluetooth Keyboard Must Contain A Bluetooth Module
Enter the wonders of AliExpress: While you cannot source an easy BT keyboard module from US under $20, you can get a full mini Bluetooth keyboard for $9.50 (at time of writing) including postage! This package ought to contain:
A fully compliant Bluetooth board that pairs with iOS, Android and PC devices
Full functioning keyboard and case
Presumably, a battery and a way to charge it
Sounds a too good deal to be true? Well, let’s find out! The keyboard has a solid metal backplate that is easily screwed open with micro cross head screwdriver. Once inside, it reveals a very professional layout with a flat ribbon cable (or “FCC cable”) coming from the mechanical part into the controller module, And a small (most likely LiPo) battery.
Taking the tape off and turning the board around reveals a bit spacious, but very professional looking PCB with clear markings. There are easily usable on/off switch and connect button on the PCB, a connector for the keyboard switches, and obviously some kind of microcontroller wired to the connector, as well as another smaller chip that is most likely a voltage regulator or charging chip.
I Googled around to find out if the “YC1026” MCU would have a datasheet to help me along the way, but unfortunately I only got Chinese web pages (most likely the manufacturer) without any documentation. Time to dig out my trusty Picotech 2000 scope and do some old-fashioned reverse engineering! Continue reading DIY Bluetooth Keyboard Breakout for $10
This project was born as a sidetrack of another one (I’m planning on building a $10 DIY Bluetooth page turning pedal for my piano and iPad sheet music app, similar to PageFlip Butterfly). I was looking if AliExpress would have bluetooth pedals, which they don’t — it seems Chinese vendors are REALLY good at copying products but there is little new product innovation combining something as simple as a bluetooth keyboard sending one or two keys with a pedal (two items that they do have)! But while searching, I found this inexpensive gadget (in case the product is removed, you might just search for “bluetooth remote” at AliExpress.com):
So what is it? It’s an $8 disc with multimedia buttons that pairs with your smartphone and you can use it for example in car to control your music. But maybe it would pair with my Raspberry Pi W which has integrated bluetooth as well? Well it costs about nothing to find out!
Fast forward about two weeks and it arrived. I did not try to use it for its intended purpose, but instead went straight to pair it with my Raspberry Pi Zero W. Turns out the pairing process was quite painless, you can follow for example LifeHacker’s tutorial for pairing quite easily. And it goes a little something like this (your MAC address might vary, just look for output after “scan on”):
Most electronics DIY projects I’ve worked in the past have involved digital communication protocols such as USB, UART or PS/2. Sometimes when first twiddling with a new protocols, everything works nicely. Other times, things don’t quite work the way they should. In the latter case, a logic analyzer is an invaluable tool, essentially a multi-channel logger of digital signals, which you can use to hopefully pinpoint where things are not going as they should. Nowadays most of these are connected to PC, so you can capture a piece of communications between two devices, and analyze what is happening with a dedicated software.
I started my logic analysis with the inexpensive Bus Pirate, but after a while also got Saleae Logic unit I used to view the PS/2 traffic in my knock sensor project. Later on, I have gotten the PicoScope 2208B which has both analog oscilloscope functionality, as well as digital logic analysis capabilities.
So when I was contacted by IKALOGIC, the makers of ScanaQuad series of logic analyzers, who offered to send me a unit to try out in return for a review, I though I was in a good position to give it a spin and also have previous experience to compare it against. I also had a project in mind to test drive the SQ200 unit I got: my recent MIDI-USB adapter, which is a combination of slow 32 KHz serial signals, and quite fast USB signalling.
Note: I received the review unit from Ikalogic without cost, but with freedom to form my own opinion about the device. I’m giving praise where it’s due, but not pulling any punches where something will nag me or compare unfavorably against the devices I’ve had first-hand experience in the past!
Unboxing the ScanaQuad SQ200
The unit arrived well packaged, and inside the plastic wrapping I uncovered a matte black cardboard box with the unit name. A grade above no-name Chinese vendors, but of course not an iPhone “unwrapping ceremony” kind of thing either. Inside, there was the unit, USB cord and logic probes neatly packed (click for larger images).
There’s nothing complicated in taking the unit into use: Just attach the USB cable, the probes, and you’re set. Build quality of the unit is very good, with grey matte surface with nice finishing, four screws and a product spec sticker on the backside, and logo, markings and a power/activity LED on top.
Size-wise, the SQ200 is slightly larger than the very compact Logic unit I have from Saleae (it’s an old model, don’t recall the exact model code), which I rate as the gold standard in product casing, with Apple-esque metal feel (aluminum?) and solid construction. The Saleae unit actually has 8 channels despite it’s smaller size. On the comparison image you can also see PicoScope 2208B with 16-channel MSO capability. Compared to that, both IKALOGIC and Saleae units are quity tiny (still, the palm-sized 2208B is extremely compact as well, given the 2 high frequency analog channels and waveform generator).
In my previous post I showed how to use Raspberry Pi to automatically record MIDI files from digital piano whenever you turn it on. However, if you sit down and play for an hour, and get one big MIDI file, it is not very useful. So what to do?
Pianoteq has a feature that splits your playing session based on breaks you take between playing notes. So I decided to mimick this feature with a simple Python script that:
Keeps tab on keys and pedals pressed
Whenever X seconds elapse without any keys or pedals down, a new MIDI file is started
Additionally, if user presses and releases sustain pedal several times in the end, filename for that MIDI is altered to “highlight” that file
I first thought to learn enough of MIDI file format to do everything from scratch, but there’s quite a bit of small details to handle, so in the end I decided to use an external toolkit from Craig Stuart Sapp called midifile to do the heavy lifting. You should be able to just clone the Git repo and make it with Raspberry Pi:
pi@raspberrypi:~ $ git clone https://github.com/craigsapp/midifile
pi@raspberrypi:~ $ cd midifile
pi@raspberrypi:~/midifile $ make
You should now have two useful commands in ~/midifile/bin: toascii to read a MIDI file and dump an ASCII (text) version of it, and tobinary to do the reverse. With Python’s Popen and smart piping, we can read and write the binary MIDI files as they were in this text format. You can check out how the format looks like with some MIDI file you have:
~/midifile/bin/toascii somemidi.mid | less
Here’s a sample of a MIDI file recorded by arecordmidi (I added the note in square brackets):
There’s some header data in the beginning, and each MIDI event is comprised of a deltatime field starting with ‘v’, and then fairly standard MIDI events in straightforward syntax. I hardcoded my program to expect single track which starts with tempo and speed data (ff 51 and ff 58 lines) which I use to calculate how many deltatime units is one second. I copy this header part to start of every MIDI file, and append the final “ff 2f v0” (END TRACK) event to the end. Here’s the full code: Continue reading Split MIDI Files with Python
During my summer holidays I got an interesting idea: Pianoteq has a very nice feature of “always on MIDI logging” that saves everything you play on your keyboard while Pianoteq was on. I’ve previously made some MIDI projects and had a great idea:
How about building a small device that records everything I play on my piano, and save it as MIDI files?
This would enable me to later grab a good performance, and eliminate the “recording anxiety” I get if I know I’m recording and should definitely not do any mistakes during the next 1000+ notes. Furthermore, even with easy MIDI recording to USB stick, it’s still several manual steps plugging the memory stick in, starting recording, stopping it, lugging it to a computer, etc.
My first idea was to use some WLAN-enabled embedded device, but MIDI IN would require optoisolators and some custom electronics, and more modern digital pianos often come with only USB MIDI, so it could easily become an exercise in communication protocols. Fast forward a couple of minutes to my next revelation:
Raspberry Pi Model 0 W already has USB and WLAN, and it’s small. Why not use that?
Turns out using a RaspPi as fully automated MIDI logger is really easy. Read on for instructions!
Turns out recording MIDI from a USB MIDI enabled device is really easy. When I plug in my Kawai CS-11 (sorry for the unsolicited link, I love my CS11 :) to the Pi (or just turn it on when it’s plugged in), dmesg shows that the Pi automatically notices the new MIDI device:
[ 587.887059] usb 1-1.5: new full-speed USB device number 4 using dwc_otg
[ 588.022788] usb 1-1.5: New USB device found, idVendor=0f54, idProduct=0101
[ 588.022800] usb 1-1.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 588.022807] usb 1-1.5: Product: USB-MIDI
[ 588.074579] usbcore: registered new interface driver snd-usb-audio
Once the USB MIDI device is found, you can use arecordmidi -l to list available MIDI ports:
pi@raspberrypi:~ $ arecordmidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0
20:0 USB-MIDI USB-MIDI MIDI 1
There are few tools that are essential for an electronics hobbyist. When I started, I had a soldering iron, a multimeter and some components, and that was about it. That got me quite far because you can do simple debugging even with a multimeter, but once you start to do any communications, you will either work in the dark or get a signal analyzer, oscilloscope, or both. I reached that point about 9 months into my hobby, and eventually decided to get an entry-level PicoScope from Picotech. You can read the whole story from my PicoScope 2204 review from four years ago.
Long story short, I was extremely happy with my Picoscope, and I’ve been using Picotech’s products ever since in variousprojects. In the past years, I’ve also been collaborating with Picotech, so I’ve had the chance to use also their higher end models, including the frighteningly powerful 4-channel, 200 MHz, 16 bit PicoScope 5444B, which is really great but maybe even too hefty for my use. So when I was offered the chance to try out Picotech’s latest generation of their entry-level 2000 series published just a month ago, I was immediately in.
Without further ado, let’s get reviewing!
PicoScope 2000 series overview
The new PicoScope 2000 series is divided into roughly two groups of equipment: The entry models 2204 and 2205 range in price from 139€ for the 10 MHz 2-channel 2204A to 419€ 2205A and 2405A which are 25 MHz and have MSO (mixed-signal oscilloscope, i.e. it has 16 channel digital part as well) capability and 4-channels, respectively. Don’t let the low bandwith confuse you, even these models have sampling rates ranging from 100 MS/s to 500 MS/s, so you will get quite a lot of measuring power out of them.
Biggest limitation with 2204 and 2205 models is the buffer size, which ranges from 8 kS to 48 kS, so for longer captures than a few waveforms, only option is the continuous capture over USB which worked at a steady rate of 1 MS/s the last time I used it. So you can do unlimited capturing of signals around 100 kHz, but above that it’s the normal oscilloscope triggering business — that’s the way scopes have always worked from their beginnings, so it gets the job done as well.