WebSerial: Browser Based Development For Your Boards And Electronic Badges

For years, one of the most accessible and simplest-to-implement methods of talking to a dev board has been to give it a serial port. Almost everything has serial in some form, so all that’s needed is to fire up a terminal. But even with that simplicity, there are still moments when the end user might find a terminal interface a little daunting. Think of a board aimed at kids for example, or an event badge which must be accessible to as many people as possible.

We’ve seen a very convenient solution to this problem in the form of WebUSB, but for devices without the appropriate USB hardware there’s WebSerial, an in-browser API for communicating with serial ports including USB-to-serial chips. [Tom Clement] argues that this could serve as the way forward for event badges. Best of all it can be a retro-fit to enable in-browser development for older badges or dev boards with a serial port.

The boards on which he demonstrates the technique are the series of event badges running the badge.team firmware platform including his own i-Pane from CampZone 2019 and going right back to the SHA 2017 badge, but there’s no reason why the same technique can’t be extended to other boards.

There’s a snag with all this though, sadly only browsers in the Chrome family support it at the time of writing, with no plans from Mozilla and apple, and silence from Microsoft. So things look likely to stay that way. It is however inevitable that in time there will be commercial products taking advantage of it via the use of cheap USB to serial chips, so perhaps the case to incorporate it will make itself.

Header: Mobius, Public domain.

It’s Not A Computer If It Doesn’t Have A Cartridge Slot

For viewers of sci-fi TV and films from the 1960s onwards, the miniaturisation of computer hardware has been something of a disappointment. Yes, it’s amazing that we can get 1.21 Jigabytes onto a memory card that fits comfortably under a postage stamp, but we were promised a different future. One of satisfyingly chunky data modules that activated everything from starships to handheld data recorders to malevolent rogue supercomputers, and one that has so far only materialised in the form of cartridges for game consoles.

Our colleague [Tom Nardi] has the solution for his cyberdeck though, in the form of 3D-printed cartridge shells that hide regular USB hardware and mate with a concealed USB socket in the slot. So far he’s designed cartridges for Flash drives, WiFi and Bluetooth adapters, a Wemos D1 Mini, a receptacle, and a parametric reference design.

It’s a bit of pleasing retro fun, but behind it all could be a surprisingly practical and useful expansion system. Each cartridge contains enough space for a lot of extra electronics, so it’s almost the ideal format for building a USB-driven project inside. Best of all since the interface is USB, it still works with conventional USB plugs and sockets. We like the idea, and it’s one that would be a good addition to any cyberdeck project.

We’re far more used to seeing home-made cartridges on game consoles.

Continue reading “It’s Not A Computer If It Doesn’t Have A Cartridge Slot”

Audio Out Over A UART With An FTDI USB-To-TRS Cable

What is the easiest way to get audio from a WAV file into a line-level format, ready to be plugged into the amplifier of a HiFi audio set (or portable speaker)? As [Konrad Beckmann] demonstrated on Twitter, all you really need is a UART, a cable and a TRS phono plug. In this case a USB-TTL adapter based around the FTDI FT232R IC: the TTL-232R-3V3-AJ adapter with 12 Mbps USB on one end, and a 3 Mbps UART on the other end.

[Konrad] has made the C-based code available on GitHub. Essentially what happens underneath the hood is that it takes in a PCM-encoded file (e.g. WAV). As a demonstration project, it requires the input PCM files to be a specific sample rate, as listed in the README, which matches the samples to the baud rate of the UART. After this it’s a matter of encoding the audio file, and compiling the uart-sound binary.

The output file is the raw audio data, which is encoded in PDM, or Pulse-Density Modulation. Unlike Pulse-Code Modulation (PCM), this encoding method does not encode the absolute sample value, but uses binary pulses, the density of which corresponds to the signal level. By sending PDM data down the UART’s TX line, the other side will receive these bits. If said receiving device happens to be an audio receiver with an ADC, it will happily receive and play back the PDM signal as audio. As one can hear in the video embedded in the tweet, the end result is pretty good.

 

If we look at at the datasheet for the TTL-232R-3V3-AJ adapter cable, we can see how it is wired up:

When we compare this to the wiring of a standard audio TRS jack, we can see that the grounds match in both wirings, and TX (RX on the receiving device) would match up with the left channel, with the right channel unused. A note of caution here is also required: this is the 3.3V adapter version, and it lists its typical output high voltage as 2.8V, which is within tolerances for line-level inputs. Not all inputs will be equally tolerant of higher voltages, however.

Plugging random TRS-equipped devices into one’s HiFi set, phone or boombox is best done only after ascertaining that no damage is likely to result.¬† Be safe, and enjoy the music.

Your NES Classic Mini Controller, On Your Desktop Computer

The NES Classic Mini was one of the earlier releases in what became a wider trend for tiny versions of classic retro consoles to be released. Everybody wanted one but numbers were limited, so only the lucky few gained this chance to relive their childhood through the medium of Donkey Kong or Mario Brothers on real Nintendo hardware. Evidently [Albert Gonzalez] was one of them, because he’s produced a USB adapter for the Mini controller to allow it to be used as a PC peripheral.

On the small protoboard is the Nintendo connector at one end, an ATtiny85 microcontroller, and a micro-USB connector at the other. The I2C interface from the controller is mapped to USB on the ATtiny through the magic of the V-USB library, appearing to the latter as a generic gamepad. It’s thought that the same interface is likely to also work with the later SNES Classic Mini controller. For the curious all the code and other resources can be found in a GitHub repository, so should you have been lucky enough to lay your hands on a NES Classic Mini then you too can join the PC fun.

The mini consoles were popular, but didn’t excite our community as much as could be expected. Our colleague Lewin Day tool a look at the phenomenon last summer.

Heavy Raspberry Pi User? Keep An HDMI-to-USB Capture Device Around

Here’s a simple tip from [Andy], whose Raspberry Pi projects often travel with him outside the workshop: he suggests adding a small HDMI-to-USB video capture device to one’s¬†Raspberry Pi utility belt. As long as there is a computer around, it provides a simple and configuration-free way to view a Raspberry Pi’s display that doesn’t involve the local network, nor does it require carrying around a spare HDMI display and power supply.

Raspberry Pi’s display, viewed on a Mac as if it were a USB webcam. No configuration required.

The usual way to see a Pi’s screen is to either plug in an HDMI display or to connect remotely, but [Andy] found that he didn’t always have details about the network where he was working (assuming a network was even available) and configuring the Pi with a location’s network details was a hassle in any case. Carrying around an HMDI display and power supply was also something he felt he could do without. Throwing a small HDMI-to-USB adapter into his toolkit, on the other hand, has paid off for him big time.

The way it works is simple: the device turns an HDMI video source into something that acts just like a USB webcam’s video stream, which is trivial to view on just about any desktop or laptop. As long as [Andy] has access to some kind of computer, he can be viewing the Pi’s display in no time.

Many of his projects (like this automated cloud camera timelapse) use the Pi camera modules, so a quick way to see the screen is useful to check focus, preview video, and so on. Doing it this way hit a real sweet spot for him. We can’t help but think that one of these little boards could be a tempting thing to embed into a custom cyberdeck build.

Adding USB To A Keyboard The Way It Used To Be Done

The world of custom keyboards has over the years developed its work into an art form, as mechanical key switches meet USB-HID capable microcontrollers for a plethora of designs as individual as their creators. This was however not always the case, and from the days of 8-bit home computers onwards making a custom keyboard often meant taking a surplus one from elsewhere and adapting its matrix to suit whatever controller interface was at hand. [Julian Calaby]’s USB conversion of an Apple Extended keyboard may be unusual in this day and age and was probably a late example even 15 years ago when he made it, but it remains a glorious piece of bodge-wire hardware hacking at its finest.

The task at hand with this type of conversion is to cut the matrix PCB tracks and replace them with soldered wires to create the new matrix required. This can then be wired to the controller, which in [Julian]’s case came from a cheap USB keyboard. He added a small USB hub to allow for a pair of USB sockets where Apple had put an ADB socket, making for quite a decent older keyboard with an unexpected USB interface.

Now older and wiser, he has plans to revisit his old keyboard with a modern microcontroller board, and needs to revisit the matrix again and give the peripheral new life. We still like the original though, as it captures a moment in time when keyboard matrix hacking made sense, and reminds us of our own youthful hardware follies.

Paging through Hackaday past it’s a testament to the old-school nature of this board that all we can find are microcontroller-based conversions. That’s not to say that cutting up old ‘boards is out of the question though.

True Networked KVM Without Breaking The Bank

For administering many computers at once, an IP KVM is an invaluable piece of equipment that makes it possible to get the job done over the network without having to haul a keyboard, monitor, and mouse around to each computer. The only downside is that they can get pricey, unless of course you can roll one out based on the Raspberry Pi and the PiKVM image for little more than the cost of the Pi itself.

The video linked below shows how to set all of this up, which involves flashing the image and then setting up the necessary hardware. The build shows an option for using HDMI over USB, but another option using the CSI bus would allow for control over options like video resolution and color that a USB HDMI dongle doesn’t allow for. It also makes it possible to restart the computer and do things like configure BIOS or boot from removable media, which is something that would be impossible with a remote desktop solution like VNC.

The creator of PiKVM was mentioned in a previous post about the creation of the CSI bus capture card, and a Pi hat based on this build will be available soon which would include options for ATX controls as well. Right now, though, it’s possible to build all of this on your own without the hat, and is part of what makes the Pi-KVM impressive, as well as its very low cost.

Continue reading “True Networked KVM Without Breaking The Bank”