Learn ARM Assembly With The Raspberry Pi

We live in a time when you don’t have to know assembly language to successfully work with embedded computers. The typical processor these days has resources that would shame early PCs and some of the larger ones are getting close to what was a powerful desktop machine only a few years ago. Even so, there are some cases where you really want to use assembly language. Maybe you need more speed. Or maybe you need very precise control over timing. Maybe you just like the challenge. [Robert G. Plantz] from Sonoma State University has an excellent book online titled “Introduction to Computer Organization: ARM Assembly Langauge Using the Raspberry Pi.” If you are interested in serious ARM assembly language, you really need to check out this book.

If you are more interested in x86-64 assembly and Linux [Plantz] has you covered there, too. Both books are free to read on the Internet, and you can pick up a printed version of the Linux book for a small payment if you want.

Continue reading “Learn ARM Assembly With The Raspberry Pi”

Raspberry Pi Projection Mapping Crash Course

Projection mapping might not be a term you’re familiar with, but you’ve certainly seen the effect before. It’s when images are projected onto an object, usually one that has an interesting or unusual shape, to create an augmented reality display. Software is used to map the image or video to the physical shape it’s being projected on, often to surreal effect. Imagine an office building suddenly being “painted” another color for the Holidays, and you’ll get the idea.

This might seem like one of those things that’s difficult to pull off at the hobbyist level, but as it turns out, there’s a number of options to do your own projection mapping with the lowly Raspberry Pi. [Cornelius], an avid VJ with a penchant for projection mapping, has done the legwork and put together a thorough list of different packages available for the Pi in case you want to try your hand at the futuristic art form. Many of them are even open source software, which of course we love around these parts.

[Cornelius] starts by saying he’s had Pis running projection installations for as long as three years, and while he doesn’t promise the reader it’s always the best solution, he says its worth getting started on at least. Why not? If the software’s free and you’ve already got a Raspberry Pi laying around (we know you do), you just need a projector to get into the game.

There’s a lot of detail given in the write-up, including handy pro and con lists for each option, so you should take a close look at the linked page if you’re thinking of trying your hand at it. But the short version is that [Cornelius] found the paid package, miniMAD, to be the easiest to get up and running. The open source options, ofxPiMapper and PocketVJ, have a steeper learning curve but certainly nothing beyond the readers of Hackaday.

To make things easier, [Cornelius] even goes on to give the reader a brief guide on setting up ofxPiMapper, which he says shouldn’t take more than 30 minutes or so using its mouse and keyboard interface. It would be interesting to see somebody combine this with the Raspberry Pi integrated projector we saw a couple years back to make a highly portable mapping setup.

Adding 3D Printer Power And Light Control To OctoPrint

OctoPrint is a great way to monitor your printer, especially with the addition of a webcam. Using a tablet or mobile phone, you can keep an eye on what the printer is doing from anywhere in the house (or world, if you take the proper precautions), saving you from having to sit with the printer as if it’s an infant. But simply watching your printer do its thing is only a small slice of the functionality offered by OctoPrint’s vast plugin community.

As [Jeremy S Cook] demonstrates, it’s fairly easy to add power control for the printer and auxiliary lighting to your OctoPrint setup. Being able to flick the lights on over the print bed is obviously a big help when monitoring it via webcam, and the ability to turn the printer off can provide some peace of mind after the print has completed. If you’re particularly brave it also means you could power on the printer and start a print completely remotely, but good luck if that first layer doesn’t go down perfectly.

In terms of hardware, you only need some 3.3V relays for the Raspberry Pi running OctoPrint to trigger, and an enclosure to put the wiring in. [Jeremy] uses only one relay in this setup to power the printer and lights at once, but with some adjustment to the software, you could get independent control if that’s something you’re after.

On the software side [Jeremy] is using an OctoPrint plugin called “PSU Control”, which is actually intended for controlling an ATX PSU from the Pi’s GPIO pins, but the principle is close enough to throw a relay. Other plugins exist which allow for controlling a wider away of devices and GPIO pins if you want to make a fully remote controlled enclosure. Plus you can always whip up your own OctoPrint plugin if you don’t find anything that quite meets your switching needs.

[Jeremy] previously documented his unique mount to keep his Raspberry Pi and camera pointed at his printer, which is naturally important if you want to create some cool videos with Octolapse.

Continue reading “Adding 3D Printer Power And Light Control To OctoPrint”

No Signal For Your Radio-Controlled Watch? Just Make Your Own Transmitter

You can win any argument about the time when you have a radio controlled watch. Or, at least, you can if there’s any signal. [Henner Zeller] lives in a place where there is no reception of the DCF77 signal that his European wristwatch expects to receive. Consequently, he decided to make his own tiny transmitter, which emulates the DCF77 signal and allows the watch to synchronise.

A Raspberry Pi Zero W is the heart of the transmitter, and [Henner] manages to coax it into generating 77500.003Hz on a GPIO pin – close enough to the 77.5kHz carrier that DCF77 uses. The signal is AM, and transmits one bit/s, repeating every minute. A second GPIO performs the required attenuation, and a few loops of wire are sufficient for an antenna which only needs to work over a few inches. The Raspberry Pi syncs with NTP Stratum 1 servers, which gives the system time an accuracy of about ±50ms. The whole thing sits in a slick 3D printed case, which provides a stand for the watch to rest on at night; this means that every morning it’s synchronised and ready to go.

[Henner] also kindly took the time to implement the protocols for WWVB (US), MSF (UK) and JJY (Japan). This might be just as well, given that we recently wrote about the possibility of WWVB being switched off. Be sure to check the rules in your area before giving this a try.

We’ve seen WWVB emulators before, like this ATtiny45 build, but we love that this solution is an easy command line tool which supports many geographical locations.

Don’t Look Now, But Your Necklace Is Listening

There was a time when the average person was worried about the government or big corporations listening in on their every word. It was a quaint era, full of whimsy and superstition. Today, a good deal of us are paying for the privilege to have constantly listening microphones in multiple rooms of our house, largely so we can avoid having to use our hands to turn the lights on and off. Amazing what a couple years and a strong advertising push can do.

So if we’re going to be funneling everything we say to one or more of our corporate overlords anyway, why not make it fun? For example, check out this speech-to-image necklace developed by [Stephanie Nemeth]. As you speak, the necklace listens in and finds (usually) relevant images to display. Conceptually this could be used as an assistive communication technology, but we’re cool with it being a meme display device for now.

Hardware wise, the necklace is just a Raspberry Pi 3, a USB microphone, and a HyperPixel 4.0 touch screen. The Pi Zero would arguably be the better choice for hanging around your neck, but [Stephanie] notes that there’s some compatibility issues with Node.js on the Zero’s ARM6 processor. She details a workaround, but says there’s no guarantee it will work with her code.

The JavaScript software records audio from the microphone with SoX, and then runs that through the Google Cloud Speech-to-Text service to figure out what the wearer is saying. Finally it does a Google image search on the captured words using the custom search JSON API to find pictures to show on the display. There’s a user-supplied list of words to ignore so it doesn’t try looking up images for function words (such as “and” or “however”), though presumably it can also be used to blacklist certain imagery you might not want popping up on your chest in mixed company.

We’d be interested in seeing somebody implement this software on a Raspberry Pi powered digital frame to display artwork that changes based on what the people in the room are talking about. Like in Antitrust, but without Tim Robbins offing anyone.

Raspberry Pi As 433 MHz To MQTT Gateway

Many low-cost wireless temperature and humidity sensors use a 433 MHz transmitter to send data back to their base stations. This is a great choice for the manufacturer of said devices because it’s simple and the radios are cheap, but it does limit what we as the consumer can do with it a bit. Generally speaking, you won’t be reading data from these sensors on your computer unless you’ve got an SDR device and some experience with GNU Radio and reading the Nexus protocol.

But [Aquaticus] has developed a very comprehensive piece of software that should make integrating these type of sensors into your home automation system much easier, as long as you’ve got a spare Raspberry Pi lying around. Called nexus433, it uses a cheap 433 MHz receiver connected to the Pi’s GPIO pins to receive data from environmental sensors using the popular Nexus communication protocol. A few known compatible sensors are listed in the project documentation, one of which can be had for as little as $5 USD shipped.

In addition to publishing the temperature, humidity, and battery level values from the sensors to MQTT, it even tracks connection quality for each individual sensor and when they go on and offline. To be sure, this is no simple hack. In nexus433, [Aquaticus] has created a mature Linux service with enough flexibility that you shouldn’t have any problems working it into your automation setup, whether it’s Home Assistant or something you’ve put together yourself.

We’ve seen a number of home automation hacks using these ubiquitous 433 MHz radios,  from controlling them with an ESP8266 to hacking a popular TP-LINK router into a low-cost home automation hub.

PiPod: A Raspberry Pi Zero Portable Music Player

[Bram] wasn’t satisfied with the portable music playback devices that were currently available. He craved an offline music player that had a large storage capacity but found that this was only available in high-end, off-the-shelf options, which were far too expensive. [Bram] decided to make his own, powered by a Raspberry Pi zero. After building an initial prototype, the design was iterated a few times, with the latest version featuring a BOM cost of roughly €80.

The whole project is open source, with hardware and software files available on the project GitHub. A 2.2″ TFT displays the UI, which is of course completely customisable. Everything is squashed into a 3D printed case, which has the smallest form factor possible whilst retaining a decent amount of battery life. The electronics are what you’d expect: a boost converter to produce 5 V for the Pi from the 3.7V battery, a charge controller and a battery protection circuit. As a bonus, the battery voltage is monitored with a 12-bit ADC which reports to the Pi, enabling it to do a safe shutdown at low voltage, and display battery level on the UI.

Since the whole purpose of the device is to play audio, onboard filtered PWM wasn’t going to cut it, so instead a 24-bit DAC talks to the Pi via I2S. The audio player backend is VLC, so there’s support for plenty of different file types. A disc image of the whole system is available with everything pre-configured, and you can even buy the assembled PCB from Tindie.

Want to keep the look and feel of your old iPod? We covered an impressive restoration of a 6th gen model, upgrading the storage and battery significantly.