Spying On The ESP32’s GPIO

The ESP32 has been a go-to microcontroller platform for a while now, thanks to its versatile capabilities, integrated Wi-Fi and Bluetooth connectivity, and low power consumption. It’s ideal for a wide range of projects especially those revolving around IoT, partially because of all of the libraries and tools available for it now. The latest tool from [The Last Outpost Workshop] adds a feature we didn’t know we wanted until now: a webserver showing real-time updates of what all of the GPIO pins are doing.

The live GPIO pin monitoring library sets up the ESP32 to stream information about what all of the pins are doing in real time to a webserver, which displays the information as a helpful graphic. The demonstration in the video below shows and example troubleshooting a situation where the code is correct but there’s a mistake in the wiring, helping to quickly identify the problem and hopefully eliminating a wild goose chase for a bug in the software. The library can be quickly installed using the Arduino IDE and only requires the use of one other library and a few lines of code to get everything up and running.

As far as a debugging tool goes, something like this could save a lot of us a significant amount of time, especially with how easy it is to set up. A real-time look into the pins and their behavior, including those set up for PWM, is invaluable for plenty of situations. Of course if you’re building something like a real-time operating system that needs responses within a very specific interval you may want to look at more in-depth strategies for probing the GPIO.

Thanks to [Bob] for the tip!

Continue reading “Spying On The ESP32’s GPIO”

A Deep Dive Into Quadcopter Controls

In the old days, building a quadcopter or drone required a lot of hacking together of various components from the motors to the batteries and even the control software. Not so much anymore, with quadcopters of all sizes ready to go literally out-of-the-box. While this has resulted in a number of knock-on effects such as FAA regulations for drone pilots, it’s also let us disconnect a little bit from the more interesting control systems these unique aircraft have. A group at Cornell wanted to take a closer look into the control systems for drones and built this one-dimensional quadcopter to experiment with.

The drone is only capable of flying in one dimension to allow the project to more easily fit into the four-week schedule of the class, so it’s restricted to travel along a vertical rod (which also improves the safety of the lab).  The drone knows its current position using an on-board IMU and can be commanded to move to a different position, but it first has to calculate the movements it needs to make as well as making use of a PID control system to make its movements as smooth as possible. The movements are translated into commands to the individual propellers which get their power from a circuit designed from scratch for this build.

All of the components of the project were built specifically for this drone, including the drone platform itself which was 3D printed to hold the microcontroller, motors, and accommodate the rod that allows it to travel up and down. There were some challenges such as having to move the microcontroller off of the platform and boosting the current-handling capacity of the power supply to the motors. Controlling quadcopters, even in just one dimension, is a complex topic when building everything from the ground up, but this guide goes some more of the details of PID controllers and how they help quadcopters maintain their position.

Continue reading “A Deep Dive Into Quadcopter Controls”

How IBM Stumbled Onto RISC

There are a ton of inventions out in the world that are almost complete accidents, but are still ubiquitous in our day-to-day lives. Things like bubble wrap which was originally intended to be wallpaper, or even superglue, a plastic compound whose sticky properties were only discovered later on. IBM found themselves in a similar predicament in the 1970s after working on a type of mainframe computer made to be a phone switch. Eventually the phone switch was abandoned in favor of a general-purpose processor but not before they stumbled onto the RISC processor which eventually became the IBM 801.

As [Paul] explains, the major design philosophy at the time was to use a large amount of instructions to do specific tasks within the processor. When designing the special-purpose phone switch processor, IBM removed many of these instructions and then, after the project was cancelled, performed some testing on the incomplete platform to see how it performed as a general-purpose computer. They found that by eliminating all but a few instructions and running those without a microcode layer, the processor performance gains were much more than they would have expected at up to three times as fast for comparable hardware.

These first forays into the world of simplified processor architecture both paved the way for the RISC platforms we know today such as ARM and RISC-V, but also helped CISC platforms make tremendous performance gains as well. In fact, RISC-V is a direct descendant from these early RISC processors, with three intermediate designs between then and now. If you want to play with RISC-V yourself, our own [Jonathan Bennett] took a look at a recent RISC-V SBC and its software this past March.

Thanks to [Stephen] for the tip!

Photo via Wikimedia Commons

Paddling Help From Electric-Assisted Kayak

Electric-assisted bicycles, or ebikes, are fundamentally changing the way people get around cities and towns. What were once sweaty, hilly, or difficult rides have quickly turned into a low-impact and inexpensive ways around town without foregoing all of the benefits of exercise. [Braden] hoped to expand this idea to the open waters and is building what he calls the ebike of kayaking, using the principles of electric-assisted bicycles to build a kayak that helps you get where you’re paddling without removing you completely from the experience.

The core of the project is a brushless DC motor originally intended a hydrofoil which is capable of providing 11 pounds (about 5 kg) of thrust. [Braden] has integrated it into a 3D-printed fin which attaches to the bottom of his inflatable kayak. The design of the fin took a few iterations to get right, but with a working motor and fin combination he set about tuning the system’s PID controller in a tub before taking it out to the open water. With just himself, the battery, and the motor controller in the kayak he’s getting about 14 miles of range with plenty of charge left in the battery after the trips.

[Braden]’s plans for developing this project further will eventually include a machine learning algorithm to detect when the rider is paddling and assist them, rather than simply being a throttle-operated motor as it exists currently. On a bicycle, strapping a sensor to the pedals is pretty straightforward, but we expect detecting paddling to be a bit more of a challenge. There are even more details about this build on his personal project blog. We’re looking forward to seeing the next version of the project but if you really need to see more boat hacks in the meantime be sure to check out [saveitforparts]’s boat which foregoes sails in favor of solar panels.

Continue reading “Paddling Help From Electric-Assisted Kayak”

A Guide For Heat-Treating Steel At Home

A lot of colloquial words that we might use when describing something’s durability take on extremely specific meanings when a materials scientist or blacksmith uses them. Things like “strength”, “toughness”, “hardness”, and “resilience” all have different meanings when working in a laboratory or industrial setting than most people might otherwise think.

For the beginner metalworker, this can be a little bit confusing at first but some hands-on practice will help. To that end, this beginner lesson in heat-treating steel from [Blondihacks] demonstrates why it can be beneficial to trade some of the metal’s toughness for improved hardness and just how to accomplish it on your own.

The first part of the lesson is to make sure the steel is high-carbon steel, since most other steels aren’t able to be heat treated. It will also have a specific method for its quenching, either in oil, water, or some other medium. But beyond that the only other thing required for this process is a torch of some sort. [Blondihacks] is using a MAP-Pro torch to get the steel up to temperature, which is recognizable when it turns a specific orange color. From there all that’s needed is to quench the hot metal in whatever fluid is called for. At this point the metal can also be tempered, which restores some of its toughness while maintaining a certain amount of hardness.

While the process doesn’t require specialized tools, [Blondihacks] does have a hardness tester, a fairly expensive piece of instrumentation that measures how deeply the metal can be indented by a force. By measuring the size of the indentation made by the tool, the hardness can be determined. As it’s many thousands of dollars this is mostly for demonstration and not necessary for most of us, but does go a long way to demonstrate the effectiveness of heat treating and tempering in an otherwise simple environment. If you’re looking for excuses to start heat treating and tempering metal, here’s a great project which creates a knife nearly from scratch.

Continue reading “A Guide For Heat-Treating Steel At Home”

Old Prius Gets Upgraded Batteries

So many of the batteries made today are lithium batteries of some sort, from mobile phones, laptops, and drones to electric cars and grid storage solutions. But this technology is relatively new; even as late as the 90s and early 00s the only widely-available batteries for things like power tools or the new hybrid vehicles coming on the market were nickel-metal hydride (NiMH). While it was good for the time, they don’t hold up to all of the advantages lithium has. There’s still plenty of hybrid vehicles on the road using these batteries, so if you’re driving an older Prius and want to give it a modern refresh, there’s a quick option to swap your old batteries.

Despite lithium technology being available for several decades, the switch to lithium for the Toyota Prius wasn’t instant, with many variants still using NiMH batteries as late as the 2020s largely because the NiMH batteries are less expensive and less maintenance-intensive than lithium batteries are. As these batteries lose capacity, the cars are still driveable but the advantages of the hybrid drivetrain won’t be as accessible anymore. The upgrade, from a company called Project Lithium, replaces these batteries with modern lithium technology that can improve the efficiency and performance of these cars even above their original capabilities since lithium batteries have more power density.

With the Toyota Prius being among the most reliable vehicles on the road thanks to the electric motor in the hybrid drivetrain taking a lot of stress off of the internal combustion engine, it’s often worth upgrading these old batteries to modern ones to squeeze every last mile from these workhorses as possible. With many of the replacement processes being almost as simple as lifting out an old battery and placing a new one in, it can be a no-brainer if that’s the only issue with the vehicle otherwise. This is also true of all-electric vehicles as well, although the process to replace the battery can be a little more involved.

Thanks to [JohnU] for the tip!

Renewable Energy: Beyond Electricity

Perhaps the most-cited downside of renewable energy is that wind or sunlight might not always be available when the electrical grid demands it. As they say in the industry, it’s not “dispatchable”. A large enough grid can mitigate this somewhat by moving energy long distances or by using various existing storage methods like pumped storage, but for the time being some amount of dispatchable power generation like nuclear, fossil, or hydro power is often needed to backstop the fundamental nature of nature. As prices for wind and solar drop precipitously, though, the economics of finding other grid storage solutions get better. While the current focus is almost exclusively dedicated to batteries, another way of solving these problems may be using renewables to generate hydrogen both as a fuel and as a means of grid storage. Continue reading “Renewable Energy: Beyond Electricity”