ZRAM Boosts Raspberry Pi Performance

Linux is a two-edged sword. On the one hand, there’s so much you can configure. On the other hand, there’s so much you can configure. It is sometimes hard to know just what you should do to get the best performance, especially on a small platform like the Raspberry Pi. [Hayden James] has a suggestion: enable ZRAM and tweak the kernel to match.

Although the post focuses on the Raspberry Pi 4, it applies to any Linux system that has limited memory including older Pi boards. The idea is to use a portion of main memory as a swap file. At first, that might seem like a waste since you could use that memory to, you know, actually run programs. However, the swap devices are compressed, so you get more swap space and transfers from these compressed swap devices and main memory are lightning-fast compared to a hard drive or solid state disk drive.

Continue reading “ZRAM Boosts Raspberry Pi Performance”

Alexa, Shoot Me Some Chocolate

[Harrison] has been busy finding the sweeter side of quarantine by building a voice-controlled, face-tracking M&M launcher. Not only does this carefully-designed candy launcher have control over the angle, direction, and velocity of its ammunition, it also locates and locks on to targets by itself.

Here comes the science: [Harrison] tricked Alexa into thinking the Raspberry Pi inside the machine is a smart TV named [Chocolate]. He just tells an Echo to increase the volume by however many candy-colored projectiles he wants launched at his face. Simply knowing the secret language isn’t enough, though. Thanks to a little face-based security, you pretty much have to be [Harrison] or his doppelgänger to get any candy.

The Pi takes a picture, looks for faces, and rotates the turret base in that direction using three servos driven by Arduino Nanos. Then the Pi does facial landmark detection to find the target’s mouth hole before calculating the perfect parabola and firing. As [Harrison] notes in the excellent build video below, this machine uses a flywheel driven by a DC motor instead of being spring-loaded. M&Ms travel a short distance from the chute and hit a flexible, spinning disc that flings them like a pitching machine.

We would understand if you didn’t want your face involved in a build with Alexa. It’s okay — you can still have a voice-controlled candy cannon.

Continue reading “Alexa, Shoot Me Some Chocolate”

A More Open Raspberry Pi Camera Stack With Libcamera

As open as the Raspberry Pi Foundation has been about their beloved products, they would be the first to admit there’s always more work to be done: Getting a Pi up and running still requires many closed proprietary components. But the foundation works to chip away at it bit by bit, and one of the latest steps is the release of a camera stack built on libcamera.

Most Linux applications interact with the camera via V4L2 or a similar API. These established interfaces were designed back when camera control was limited and consisted of a few simple hardware settings. Today we have far more sophisticated computational techniques for digital photography and video. Algorithms have outgrown dedicated hardware, transforming into software modules that take advantage of CPU and/or GPU processing. In practice, this trend meant bigger and bigger opaque monolithic pieces of proprietary code. Every one a mix of “secret sauce” algorithms commingling with common overhead code wastefully duplicated for each new blob.

We expect camera makers will continue to devise proprietary specialties as they seek a competitive advantage. Fortunately, some of them see benefit in an open-source framework to help break up those monoliths into more manageable pieces, letting them focus on just their own specialized parts. Leveraging something like libcamera for the remainder can reduce their software development workload, leading to faster time to market, lower support cost, and associated benefits to the bottom line that motivates adoption by corporations.

But like every new interface design borne of a grandiose vision, there’s a chicken-and-egg problem. Application developers won’t consume it if there’s no hardware, and hardware manufacturers won’t implement it if no applications use it. For the consumer side, libcamera has modules to interop with V4L2 and other popular interfaces. For the hardware side, it would be useful to have a company with wide reach who believes it is useful to open what they can and isolate the pieces they can’t. This is where the Raspberry Pi foundation found a fit.

The initial release doesn’t support their new High-Quality Camera Module though that is promised soon. In the short term, there is still a lot of work to be done, but we are excited about the long term possibilities. If libcamera can indeed lower the barrier to entry, it would encourage innovation and expanding the set of cameras beyond the officially supported list. We certainly have no shortage of offbeat camera sensor ideas around here, from a 1-kilopixel camera sensor to a decapped DRAM chip.

[via Hackster.io]

Turn An Unused Pi Zero Into A Parts Bin WiFi Extender

We know a lot of you are sitting on an unused Raspberry Pi Zero W, maybe even several of them. The things are just too small and cheap not to buy in bulk when the opportunity presents itself. Unfortunately, the Zero isn’t exactly a powerhouse, and it can sometimes be tricky to find an application that really fits the hardware.

Which is why this tip from [Tejas Lotlikar] is worth taking a look at. Using the Pi Zero W, a cheap USB WiFi adapter, and some software trickery, you can put together a cheap extender for your wireless network. The Pi should even have a few cycles left over to run ad-blocking software like Pi-hole while it shuffles your packets around the tubes.

[Tejas] explains every step of the process, from putting the Raspbian image onto an SD card to convincing wpa_supplicant to put the Pi’s WiFi radio into Access Point mode. Incidentally, this means that you don’t need to be very selective about the make and model of the USB wireless adapter. Something with an external antenna is preferable since it will be able to pull in the weak source signal, but you don’t have to worry about it supporting Soft AP.

With the software configured, all you need to finish this project off is an enclosure. A custom 3D printed case large enough to hold both the Pi and the external WiFi adapter would be a nice touch.

Lego Microscope Does Research

We’ve seen a lot of practical machines built using Lego. Why not? The bricks are cheap and plentiful, so if they can get the job done, who cares if they look like a child’s toy? Apparently, not [Yuksel Temiz]. He’s an engineer for IBM whose job involves taking pictures of microscopic fluidic circuits. When he wasn’t satisfied with the high-power $10,000 microscopes he had, he built his own. Using Lego. How are the pictures? Good enough to appear in many scientific journals.

Clearly, the microscope doesn’t just contain Lego, but it still came in at under $300. According to an interview from Futurism, the target devices are reflective which makes photographing them straight-on difficult. After experimenting with cameras on tripods, [Yuksel] decided he could build his own specialized device. You can see a video of the devices in question and some of the photographs below.

Continue reading “Lego Microscope Does Research”

Break Time Is Calling On The Rainbow Connection

Like some of us, [Mister M] is prone to staying glued to his seat too long in this new era of working from home. And you know what they say about a body at desk — it tends to stay at desk until it absolutely must rise up to find food or use the restroom.

Thanks to this nifty new break time reminder, [Mister M] has a third call to answer that demands he get up. Every hour, the NeoPixel ring in this old dial-deficient phone fills up completely and switches over to an attention-getting rainbow animation. If [Mister M] stays seated, playtime is over. All the lights start flashing red, and the phone starts beeping incessantly until he walks across the room and either pushes the momentary button or lifts the handset to reset the timer.

We love that [Mister M] incorporated all of the phone’s original inputs and outputs into this project, because it’s such a cool old dog and bone. No need to drop a dime, just whistle at the break button to check out the build video.

This grille-faced phone was probably part of an intercom system. Incidentally, you can make an intercom system with two standard-style phones of this vintage.

Continue reading “Break Time Is Calling On The Rainbow Connection”

New Part Day: Raspberry Pi Camera Gets Serious With 12 Megapixels & Proper Lenses

The Raspberry Pi Foundation have slipped out a new product, a $50 camera module with a larger sensor that increases the resolution from the 8 megapixels of its predecessor to a Sony IMX477R stacked, back-illuminated 12.3 megapixel sensor, and most interestingly adds a mounting ring for a C mount lens (the kind used with CCTV equipment) in place of the tiny fixed focus lenses of past Pi cameras. In addition there is a standard threaded tripod mount on the module, and an adapter ring for CS mount lens types. The camera cannot be used without a lens, but there are a few options available when ordering, like 16mm telephoto or 6mm wide angle lenses, if you do not already have a suitable lens on hand.

It’s an exciting move for photography experimenters, because for the first time it offers an affordable way into building custom cameras with both a higher quality sensor and a comprehensive selection of interchangeable lenses. We can imagine that the astronomers and microscopists among us will be enthusiastic about this development, as will those building automated wildlife cameras. For us though the excitement comes in the prospect of building decent quality cameras with custom form factors that break away from the conventional, because aside from a period when consumer digital cameras were in their infancy they have stuck rigidly to the same form factor dictated by a 35mm film canister. It’s clear that this module will be made into many different projects, and we are looking forward to featuring them.

At the time of writing the camera is sold out from all the usual suppliers, which follows the trend for Raspberry Pi products on their launch day. We didn’t manage to snag one, but perhaps with such an expensive module it’s best to step back for a moment and consider the project it will become part of rather than risking it joining the unfinished pile. While waiting for stock then perhaps the next best thing is to 3D print a C mount adapter for your existing Pi camera, or maybe even hook it up to a full-sized SLR lens.