Debugging Arduino is Painful: This Can Help

If you are used to coding with almost any modern tool except the Arduino IDE, you are probably accustomed to having on-chip debugging. Sometimes having that visibility inside the code makes all the difference for squashing bugs. But for the Arduino, most of us resort to just printing print statements in our code to observe behavior. When the code works, we take the print statements out. [JoaoLopesF] wanted something better. So he created an Arduino library and a desktop application that lets you have a little better window into your program’s execution.

To be honest, it isn’t really a debugger in the way you normally think of it. But it does offer several nice features. The most rudimentary is to provide levels of messaging so you can filter out messages you don’t care about. This is sort of like a server’s log severity system. Some messages are warnings and some are informational, and some are verbose. You can select what messages to see.

In addition, the library timestamps the messages so you can tell how much time elapsed between messages and what function you were in during the message. It can also examine and set global variables that you preconfigure and set watches on variables. It is also possible to call functions from the serial monitor.

Continue reading “Debugging Arduino is Painful: This Can Help”

Printed Parts Turn Ruler into Marking Gauge

For Hackaday readers who spend more time with a soldering iron than a saw, a marking gauge is a tool used to put parallel lines on a piece of wood (and occasionally metal or plastic) for cutting. The tool is run across the edge of the piece to be marked, and an adjustment allows the user to set how far in the line will be made. As an example, if you wanted to cut a board into smaller strips, a marking gauge would be an ideal choice for laying out your lines ahead of time.

But as with many niche tools, it’s not something you’re going to use every day. For [chaosbc], this meant he wanted to see if he could come up with a DIY solution on the cheap. Plus he could have it in hand now, rather than waiting for it to take the slow boat from overseas. With the addition of a few clever 3D printed components, he was able to turn his trusty aluminum ruler into a serviceable marking gauge for the cost of filament and a few bits of hardware.

The general design of a marking gauge is fairly simple: there’s a block that rides up and down a graduated shaft (known as the headstock) which allows you to set the depth of the line, and then a piece on the end which holds your marking tool. The marking tool could be a blade if you’re working with something soft enough, but for wood is usually going to be a pencil.

[chaosbc] provides all the STL files for his DIY marking gauge, though they might need adapting as they were created for his specific ruler. Luckily the parts aren’t that complex so it shouldn’t be too difficult to get it sorted out. He also has a useful hint for anyone looking to duplicate his work: a few drops of super glue on the bolt used to lock down the headstock is enough to create a non-marring surface so you don’t tear up your ruler.

We’ve got a few other tips for woodworking on a budget, as well as a primer about this whole making stuff with dead trees concept.

Continue reading “Printed Parts Turn Ruler into Marking Gauge”

Junkbox Constant Current Source Helps with Kelvin Sensing

Is it ironic when a YouTube channel named “The Current Source” needs to build a current source? Or is that not ironic and actually just coincidental?

Regardless of linguistic considerations, [Derek], proprietor of the aforementioned channel has made and disassembled a few current sources in his day. Most of those jobs were for one-off precision measurements or even to drive a string of LEDs in what he describes as a pair of migraine-inducing glasses. Thankfully, The junk box current source presented in the video below is more in service of the former than the latter, as his goal is to measure very small resistances in semiconductors using Kelvin clips.

The current source uses a 24-volt switch-mode power supply and the popular LM317 adjustable voltage regulator. The ‘317 can be configured in a constant current mode by connecting the chip’s adjustment pin to the output through a series resistance. A multiturn pot provides current adjustment, although the logarithmic taper is not exactly optimal for the application. We spotted a pair of what appear to be optoisolators in the build too, but there’s no schematic and no discussion of what they do. [Derek] puts the final product to use for a Kelvin measurement of a 0.47-Ω 1% resistor at the end of the video.

We’re glad to see [Derek] in action; you may recall his earlier video about measuring his own radiation with a Geiger counter after treatment for thyroid cancer. Here’s hoping that’s behind him now.

Continue reading “Junkbox Constant Current Source Helps with Kelvin Sensing”

Teardown of a (Relatively) Cheap Thermal Camera

The cost of tools and test equipment has largely been on the downward trend for years, making it now more affordable than ever to get into the hacking and making scene. This is particularly visible with something like the venerable oscilloscope: a piece of equipment that was near unobtainium for the home hacker a decade ago, you can now get digital pocket scope for as little as $20 USD. But there are still pieces of gear which haven’t quite hit the sort of prices we’d like to see.

A perfect example are thermal imaging cameras. The cheap ones are usually so low resolution they might as well just be thermometers, but the higher resolution ones can cost thousands. [Rob Scott] recently wrote in to tell us about a very promising middle ground, the HTI HT-A1. But he didn’t just point it out to us, he also tore it down and laid its internal’s bare for our entertainment. Now that’s our kind of introduction.

[Rob] walks us through the disassembly of the device, which is made unnecessarily difficult due to the fact that half the screws are hidden under a glued on screen bezel. That means a heat gun, a thin tool, and patience are in order if you want to get inside the device. It’s bad enough they use these kinds of construction techniques on modern smartphones, but at least they’re so thin that we can understand the reasoning. Why this chunky thing needs to resort to such measures is beyond us.

Eventually he cracks the HT-A1 open and is greeted with a single double-sided PCB. The top side is pretty much bare except for the buttons and the LCD display, and the flip side is largely just a breakout for a quad-core Allwinner A33 daughterboard. [Rob] theorizes this is to keep costs down by allowing reuse of the modular A33 board on other devices. Given the A33’s use in so many cheap tablets, it’s also possible HTI simply purchased these daughterboards as a drop-in component and designed their own board around it.

There’s not much else inside the HT-A1 beyond the rechargeable battery pack and thermal camera, both attached to the device’s rear panel. [Rob] noticed that the date on the thermal camera PCB is a full two years older than the date on the main PCB, leading one to wonder if HTI might have gotten a good deal on a bunch of these slightly outdated sensors and spun up a whole device around them.

The HT-A1 is high enough resolution that you can actually pick out individual components on a PCB, and at $400 USD is approaching a reasonable price point for the individual hacker. Which is not to say it’s cheap, but at least you get a useful tool for your money. We wouldn’t suggest you buy this device on a whim, but if you do a lot of diagnostic work, it might pay for itself after a couple repairs.

If that’s still a little too rich for your blood, we’ve covered a handful of DIY options which might better fit your budget.

Continue reading “Teardown of a (Relatively) Cheap Thermal Camera”

Rooting the Amazon Fire TV Cube with an Arduino

Amazon might not be happy about it, but at least part of the success of their Fire TV Stick was due to the large hacking and modification scene that cropped up around the Android-powered device. A quick search on YouTube for “Fire Stick Hack” will bring up a seemingly endless array of videos, some with millions of views, which will show viewers how to install unofficial software on the little media dongle. Now it looks like their latest media device, the Fire TV Cube, is starting to attract the same kind of attention.

The team at [Exploitee.rs] has recently taken the wraps off their research which shows the new Fire TV Cube can be rooted with nothing more than an Arduino and an HDMI cable you’re willing to cut apart. Of course, it’s a bit more complicated than just that, but between the video they’ve provided and their WiKi, it looks like all the information is out there for anyone who wants to crack open their own Cube. Just don’t be surprised if it puts you on the Amazon Naughty List.

The process starts by putting the device’s Amlogic S905Z into Device Firmware Upgrade (DFU) mode, which is done by sending the string “boot@USB” to the board over the HDMI port’s I2C interface. That’s where the HDMI cable comes in: you can cut into one and wire it right up to your Arduino and run the sketch [Exploitee.rs] has provided to send the appropriate command. Of course, if you want to get fancy, you could use an HDMI breakout board instead.

With the board in DFU mode in you gain read and write access to the device’s eMMC flash, but that doesn’t exactly get you in because there’s still secure boot to contend with. But as these things tend to go, the team was able to identify a second exploit which could be used in conjunction with DFU mode to trick the device into disabling signature verification. Now with the ability to run unsigned code on the Fire TV Cube, [Exploitee.rs] implemented fastboot to make it easier to flash their custom rooted firmware images to the hardware.

As with the Fire TV Stick before it, make sure you understand the risks involved when you switch off a device’s security features. They’re often there to protect the end user as much as the manufacturer.

Continue reading “Rooting the Amazon Fire TV Cube with an Arduino”

Inventor Services – Maybe Right For You – Maybe

You’ve no doubt been exposed to the ads for various inventor services; you have an idea, and they want to help you commercialize it and get the money you deserve. Whether it’s helping you file legal paperwork, defending your idea, developing it into a product, or selling it, there’s a company out there that wants to help. So which ones are legit, which ones are scams, and what do you really need to make your millions?

Continue reading “Inventor Services – Maybe Right For You – Maybe”

Lightsaber Uses Pogo Pins to Make Assembly a Breeze

There was an endless supply of fantastic projects at Supercon this year, but one whose fit and finish really stood out was [Scott]’s lightsaber. If you were walking around and saw someone with a very bright RGB device with a chromed-out handle hanging off their belt it was probably this, though it may have been hard to look at directly. On the outside, the saber looks like a well-polished cosplay prop, and it is! But when Scott quickly broke down the device into component pieces it was apparent that extra care had been put into the assembly of the electronics.

Like any good lightsaber replica the blade is lit, and wow is it bright. The construction is fairly simple, it’s a triplet of WS2812B LED strips back to back on a triangular core, mounted inside a translucent polycarbonate tube with a diffuser. Not especially unusual. But the blade can be popped off the hilt at a moments notice for easy transport and storage, so the strips can’t be soldered in. Connectors would have worked, but who wants flying wires when they’re disconnecting their lightsaber blade. The answer? Pogo pins! Scott runs the power, ground, and data lines out of the strips and into a small board with slip ring-style plated rings. On the hilt, there is a matching array of pogo pins to pass along power and data. The data lines from all the strips are tied together minimizing the number of connections to make, and the outer two power rings have more than one pin for better current-carrying capacity. A handy side effect is that there is nowhere on the blade where there aren’t LEDs; the strips go down to the very end of the blade where it meets the main board inside the hilt.

The hilt is filled with an assembly of 18650’s and a Teensy mounted with a custom shield, all fit inside a printed midframe. The whole build is all about robust design that’s easy to assemble. The main board is book-ended by perpendicular PCBs mounted to the ends, one at the top to connect to the blade and one at the bottom to connect to a speaker. Towards the bottom there is space for an optional Bluetooth radio to allow remote RGB control.

Scott is selling this as a product but also provides detailed instructions and parts lists for each component. Assembly instructions for the blade are here. The hilt is here. And pogo adapters are on OSH Park here. An overview of the firmware with links to GitHub is here. Check out a walkthrough of the handle assembly and blade attachment after the break!

Continue reading “Lightsaber Uses Pogo Pins to Make Assembly a Breeze”