Arbitrary Wave Generator For The Raspberry Pi Pico

Once upon a time, if you wanted to generate some waveforms, you needed to buy an expensive off-the-shelf function generator or whip up a big pile of analog electronics. Not so today, when you can grab a fast microcontroller off the shelf and have it squirt out whatever fancy waves you might desire. That’s just what [rgco] did to build this nifty arbitrary wave generator.

The build improves on prior work by [rgco] with the Arduino Uno, with which they built a device that could output at 381 kilosamples per second, with each sample update taking 42 instruction cycles. Thanks to the Pi Pico’s faster clock speed and certain performance optimizations, they were able to up that to a mighty 125 megasamples per second, using the DMA and PIO subsystems to output a new sample every single clock cycle.

The result is a cheap function generator you can build with a Pi Pico and a handful of resistors, which will probably cost you the grand total of $12. It readily outperforms, at least in regards of speed, devices based on the AD9833 function generator chip, which only runs at 25 megasamples. Plus, that chip can only output sines, triangles, and squares!

Even a passable function generator can be a useful tool to have in the workshop, as we’ve seen before. Video after the break.

Continue reading “Arbitrary Wave Generator For The Raspberry Pi Pico”

Monitoring Energy Use And Saving Money

On the surface, the electric grid might seem like a solved piece of infrastructure. But there’s actually been a large amount of computerized modernization going in the background for the past decade or so. At a large scale this means automatic control of the grid, but for some electric utility customers like [Alex] this means the rates for electricity can change every hour based on demand. By keeping an eye on the current rate, you can extract the most value from these utilities.

[Alex] is located in the United Kingdom and has an energy provider whose rates can change every half hour. This information is freely available well enough in advance to download the data and display it visibly in with a NeoPixel LED ring around a clock. The colors displayed by the LEDs represent an increase or decrease in price for the corresponding time and allow him to better plan out the household’s energy use for the day. The clock uses a TinyPICO ESP32 module to gather the data and handle the clock display. A second wall-mounted device shows real-time energy readings for both gas and electricity using two old analog voltmeters modified to display kilowatt-hours.

While not everyone has a utility which allows this sort of granularity with energy pricing, having one can make a bit of a difference as electricity rates under this system can sometimes go negative. [Alex] estimates that using these two displays to coordinate his energy usage has saved around £50 a month. Even if your utility offers minimal or no price adjustments for time-of-use, it’s still a good idea to monitor energy use in your home. Here’s a fairly comprehensive project that does that without modifying any existing wiring.

Scope GUI Made Easier

Last time, I assembled a Python object representing a Rigol oscilloscope. Manipulating the object communicates with the scope over the network. But my original goal was to build a little GUI window to sit next to the scope’s web interface. Had I stuck with C++ or even C, I would probably have just defaulted to Qt or maybe FLTK. I’ve used WxWidgets, too, and other than how many “extra” things you want, these are all easy enough to use. However, I had written the code in Python, so I had to make a choice.

Granted, many of these toolkits have Python bindings — PyQt, PySide, and wxPython come to mind. However, the defacto GUI framework for Python is Tkinter, a wrapper around Tk that is relatively simple to use. So, I elected to go with that. I did consider PySimpleGUI, which is, as the name implies, simple. It is attractive because it wraps tkinter, Qt, WxPython, or Remi (another toolkit), so you don’t have to pick one immediately. However, I decided to stay conservative and stuck with Tkinter. PySimpleGUI does have a very sophisticated GUI designer, though.

About Tkinter

The Tkinter toolkit lets you create widgets (like buttons, for example) and give them a parent, such as a window or a frame. There is a top-level window that you’ll probably start with. Once you create a widget, you make it appear in the parent widget using one of three layout methods:

  1. Absolute or relative coordinates in the container
  2. “Pack” to the top, bottom, left, or right of the container
  3. Row and column coordinates, treating the container like a grid

The main window is available from the Tk() method:

import tkinter as tk
root=tk.Tk()
root.title('Example Program')
button=tk.Button(root, text="Goodbye!", command=root.destroy)
button.pack(side='left')
root.mainloop()

That’s about the simplest example. Make a button and close the program when you push it. The mainloop call handles the event loop common in GUI programs.

Continue reading “Scope GUI Made Easier”

CT Scanner Reveals The Difference Between Real And Fake AirPods

These days, you have to be careful what you buy. Counterfeit hardware is everywhere, especially when you’re purchasing things sight unseen over the Internet. [Jon Bruner] recently set out to look at a bunch of fake AirPod clones, and found that the similarities between the imposters and the real thing are only skin deep. A CT scan reveals all.

As you might expect, Apple’s AirPods are a fine example of miniaturization. They’re packed to the gills with hardware, with very little wasted space inside. Flexible PCBs hook up the electronics in an elegant and tidy fashion. Three tiny MEMS microphones are on board to capture the user’s voice and filter out noise. The battery that runs the show is a hefty lithium-ion coin cell which fills almost all the empty space behind the audio driver.

By contrast, the fakes look positively weedy inside. They cut out the bonus microphones, using just one to do the job. Wires link up the different components, with unimpressive blobby soldering visible that has splattered around the internal enclosure. Even the cases are lower-tech, with a weaker battery and a poorer charging solution. Hilariously, cheaping out on the tech makes the fakes lighter, so they compensate by adding weights to create a sense of heft for the user.

It’s amazing how much is revealed by a CT scan, that doesn’t even require opening the devices to tear them down. Fake hardware really is a scourge that many in the tech industry find themselves fighting against on a regular basis.

Ejector Seats: The Rocket Chairs That Save Lives

Once upon a time, escaping an aircraft was a tricky business. You had to unstrap yourself, fling open a heavy glass canopy, and try to wrench yourself out of a small opening without getting smacked by the tail or chopped up by the propeller. Many pilots failed this difficult task, to the tragic loss of their lives.

Eventually, the human cost was heavy enough and militaries grew strained at having to train new pilots to replace the experienced ones lost to accidents and enemy fire. The ejection seat was developed to make escaping a plane as simple as tucking yourself in and pulling a big red handle. Let’s dive in and learn how it came to be.

Continue reading “Ejector Seats: The Rocket Chairs That Save Lives”

Iowa Demolishes Its First 3D Printed House

It sounds like a headline from the future: the weekend before Thanksgiving, a bulldozer came for the first example of a printed home that was supposed to help the housing crisis in the city of Muscatine. Fortunately, it hadn’t been completed and sold yet.

Printing of this first house began in May 2023, and nine more were to be completed by the end of the year. Unfortunately, when tested for compressive strength, the cement mixture this first home was printed out of failed to meet the 5,000 PSI minimum required for the project. Rather than compromise on safety, the parties involved decided to knock it down and start over.

The goal now is to find out why the mixture, which met the strength requirements in laboratory testing, didn’t behave the same on-site. Currently, the plan is to start building the originally-planned second house in the spring, and begin construction on this first site after that.

The project is a collaborative effort between the Community Federation of Greater Muscatine (CFGM), Muscatine Community College, and Alquist 3D. Want to know more about the state of 3D printing when it comes to housing? Check out our handy guide.

Editors Note: The initial post initially indicated that the failed cement mixture contained hemp, but that has since found to be incorrect and the post has been edited accordingly.

Continue reading “Iowa Demolishes Its First 3D Printed House”

Resurrecting A Bricked Wii U With A Raspberry Pi Pico

There are reports that some Nintendo Wii U systems out in the wild are falling victim to mysterious failures. As is so often the case, certain error codes have been found in common across failed units out in the community, and [Voultar] decided to investigate to see if he could fix this problem with a little hacking.

[Voultar] wasn’t able to source a Wii U with the much-discussed NAND failure mode, but he was able to source a number of supposedly bricked Wii U systems displaying the error codes 160-0101 and 160-0103. The hack is achieved with an exploit in the Wii U’s USB Host Stack descriptor parsing module, developed by [GaryOderNichts]. It allows the injection of a payload that lets one run unsigned code on the Wii U, achieved via a Raspberry Pi Pico. The Pico is ultimately used to boot off an SD card running a recovery program for the Wii U. By resetting the Wii U’s “coldboot title ID”, it solves the error and gets the console booting properly, as per normal.

[Voultar] was able to fix five consoles displaying the common error messages, which we’d call a win. It’s not going to be a fix for every failed Wii U out there, but if you’ve got the dreaded 160-0101 or -0103 errors, it might be worth a shot.

Continue reading “Resurrecting A Bricked Wii U With A Raspberry Pi Pico”