The Dubious Claim Of A World Helium Shortage

If you’ve been reading the news lately, you doubtless read about the find of a really big new helium gas field in Tanzania. It’s being touted as “life-saving” and “game-changing” in the popular media, but this is all spin. Helium is important for balloon animals, scientists, and MRI machines alike, but while it’s certainly true that helium prices have been rising steadily since 2000, this new field is unlikely to matter all that much in the grand scheme of things.

helium_uses
Source: USGS

The foundation of every news story on helium is that we’re running out of the stuff. As with most doomsday scenarios, the end of the world’s supply of helium is overstated, and we don’t just mean in light of the new Tanzanian field. Helium is the second-most abundant element, making up 24% of the total mass of the universe. And while the earth has a disproportionate amount of heavier elements, helium is in rocks everywhere. It’s just a question of getting it out, and at what price that’s viable.

So while we’re stoked that the era of (relatively) cheap helium can continue onwards for a few more years, we’re still pretty certain that the price is going to continue to rise, and our children’s children won’t be using the stuff for something so frivolous as blowing up party balloons — it’ll be used primarily, as it is now, where it’s more valuable: in science, medicine, and industry.

Let’s take this moment to reflect on the economics of second-lightest element. Here’s to you, Helium!

Continue reading “The Dubious Claim Of A World Helium Shortage”

Join The GUI Generation: QTCreator

More and more projects require a software component these days. With everything being networked, it is getting harder to avoid having to provide software for a desktop or phone environment as well as the code in your embedded device.

If you’ve done a lot of embedded systems work, you probably already know C and C++. If so, it is pretty easy to grab up a C compiler and write a command-line application that does what you want. The problem is that today’s users have varying degrees of fear about the command line ranging from discomfort to sheer terror. On a mobile device, they probably don’t even know how to get to a command line. I’ve been waiting for years for the WIMP (Windows/Icon/Mouse/Pointer) fad to fade away, but even I have to admit that it is probably here for the foreseeable future.

qtrigolSo what’s the alternative? There are actually quite a few. However, I wanted to talk about one that is free, has a wide range of deployment options, uses C++, and is easy to pick up: Qt. Specifically, creating programs with QtCreator (see right). Yes, there are other options, and you can develop Qt programs in a number of ways.

You might think Qt isn’t free. There was a time that it was free for open source projects, but not for commercial projects. However, recent licensing changes (as of version 4.5) have made it more like using gcc. You can elect to use the LGPL which means it is easy to use the Qt shared libraries with closed software. You might also think that a lot of strange constructs that “extend” C++ in unusual ways. The truth is, it does, but with QtCreator, you probably won’t need to know anything about that since the tool will set up most, if not all, of that for you.

Background

If you ever used Visual Basic or something similar, you will feel right at home with QtCreator. You can place buttons and text edit boxes and other widgets on a form and then back them up with code. Buttons create signals when you push them. There are lots of signals like text changed or widgets (controls) being created or destroyed.

To handle a signal, an object provides a slot. There is a meta-compiler that preprocesses your C++ code to get all the signal and slot stuff converted into regular C++. Here’s the good news: you don’t really care. In QtCreator you can write code to handle a button push and exactly how that happens isn’t really much of a worry.

QtCreator has kits that can target different platforms and — in general — the code is reasonably portable between platforms. If you do want to do mobile development for Android or iOS, be sure that you understand the limitations before you start so you can avoid future pitfalls.

You Need Class

Like many similar frameworks, Qt uses an application class (QtApplication) that represents a do-nothing application. Your job is to customize a subclass and have it do what you want. You add widgets and you can even add more screens, if you like. You can connect signals to existing slots or new slots.

There are many classes available, and the online documentation is quite good. Depending on which version of Qt you are using, you’ll need to find the right page (or ask QtCreator to find it for you). However, just to whet your appetite, here’s the Qt5 reference page. From there you can find classes for GUI widgets, strings, network sockets, database queries, and even serial ports.

I could do an entire tutorial on using QtCreator, but it would be a duplication of effort. There’s already a great getting started one provided. You’ll find there is plenty of documentation.

Portability

How do you enumerate serial ports? It depends on the platform, right? In Qt, the platform-specific part is hidden from you. For example, here’s a bit of code that fills in a combo box with the available serial port:

MainWindow::MainWindow(QWidget *parent) :
 QMainWindow(parent),
 ui(new Ui::MainWindow)
{
 ui->setupUi(this);
// initialize list of serial ports
 ports = QSerialPortInfo::availablePorts();
// fill in combo box
 for (int i=0; i<ports.length(); i++) 
 {
   ui->comport->addItem(ports[i].portName(), QVariant(i));
 }
}

The QSerialPortInfo object provides an array of serial port objects. The ui->comport is a combo box and the addItem method lets me put a display string and a data item in for each selection. In this case, the display is the portName of the port and the extra data is just the index in the array (as a variant, which could be different types of data, not just a number). When you select a port, the index lets the program look up the port to, for example, open it.

When the combo box changes, a currentIndexChanged signal will occur. Here’s the slot handler for that:

void MainWindow::on_comport_currentIndexChanged(int index)
{
 QString out;
 // get selected index
 int sel=ui->comport->currentData().toInt();
// build up HTML info string in out
 out="<h1>Serial Port Info</h1>";
 ui->output->clear();
 out += ports[sel].portName() + " " + ports[sel].description() + "
";
 out += ports[sel].systemLocation() + "
";
 if (ports[sel].hasVendorIdentifier() && ports[sel].hasProductIdentifier())
 out += ports[sel].manufacturer() + " ("+ QString::number(ports[sel].vendorIdentifier(),16) + ":" + QString::number(ports[sel].productIdentifier(),16) + ")";
 // and put it on the screen
 ui->output->setText(out);
}

In this case, the result is information about the serial port. You can see the resulting output, below. The QString is Qt’s string class and, obviously, the text display widget understands some HTML.

qtserial

Not Just for GUIs

You can develop console applications using Qt, but then many of the provided classes don’t make sense. There’s even a Qt for Embedded (essentially Linux with no GUI). You can find guides for Raspberry Pi and BeagleBoard.

On the mobile side, you can target Android, iOS, and even Blackberry, along with others. Like anything, it probably won’t just be “push a button” and a ported application will fall out. But it still should cut down on development time and cost compared to rewriting a mobile app from scratch.

And the Winner Is…

I’m sure if you want some alternatives, our comment section is about to fill up with recommendations. Some of them are probably good. But it strikes me that not everyone has the same needs and background. The best tool for you might not work as well for me. I find Qt useful and productive.

Even if Qt isn’t your tool of choice, it still can be handy to have in your tool bag. You never know when you will need a quick and dirty cross-platform application.

Ask Hackaday: How Hard Is It To Make A Bad Solder Joint?

When you learn to solder, you are warned about the pitfalls of creating a solder joint. Too much solder, too little solder, cold joints, dry joints, failing to “wet” the joint properly, a plethora of terms are explained  if you read one of the many online guides to soldering.

Unsurprisingly it can all seem rather daunting to a novice, especially if they are not used to the dexterity required to manipulate a tool on a very small-scale at a distance. And since the soldering iron likely to be in the hands of a beginner will not be one of the more accomplished models with fine temperature control and a good tip, it’s likely that they will experience most of those pitfalls early on in their soldering career.

As your soldering skills increase, you get the knack of making a good joint. Applying just the right amount of heat and supplying just enough solder becomes second nature, and though you still mess up from time to time you learn to spot your errors and how to rework and fix them. Your progression through the art becomes a series of plateaux, as you achieve each new task whose tiny size or complexity you previously thought rendered it impossible. Did you too recoil in horror before your first 0.1″ DIP IC, only to find it had been surprisingly easy once you’d completed it?

A few weeks ago we posted a Hackaday Fail of the Week, revolving around a soldering iron failure and confirmation bias leading to a lengthy reworking session when the real culprit was a missing set of jumpers. Mildly embarrassing and something over which a veil is best drawn, but its comments raised some interesting questions about bad solder joints. In the FoTW case I was worried I’d overheated the joints causing them to go bad, evaporating the flux and oxidising the solder. This was disputed by some commenters, but left me with some curiosity over bad solder joints. We all know roughly how solder joints go wrong, but how much of what we know is heresay? Perhaps it is time for a thorough investigation of what makes a good solder joint, and the best way to understand that would surely be to look at what makes a bad one.

Continue reading “Ask Hackaday: How Hard Is It To Make A Bad Solder Joint?”

Modding The Monoprice MP Mini Printer

Two weeks after my review of the MP Select Mini 3D printer, Monoprice’s own website has said this printer has been out of stock, in stock, and out of stock again several times. This almost unimaginably cheap 3D printer is proving to be exceptionally popular, and is in my opinion, a game-changing machine for the entire world of 3D printing.

With the popularity of this cheap printer that’s more than halfway decent, there are bound to be improvements. Those of us who have any experience with 3D printers aren’t going to be satisfied with a machine with any shortcomings, especially if it means we can print enhancements and mods for our printers.

Below are the best mods currently available for this exceptional printer. Obvious problems with the printer are corrected, and it’s made a little more robust. There are mods to add a glass build plate, and a few people are even messing around with the firmware on this machine. Consider this volume one of the MP Mini hacks; with a cheap printer that’s actually good, there are bound to be more improvements.

Continue reading “Modding The Monoprice MP Mini Printer”

Tearing Into Delta Sigma ADC’s

It’s not surprising that Analog to Digital Converters (ADC’s) now employ several techniques to accomplish higher speeds and resolutions than their simpler counterparts. Enter the Delta-Sigma (Δ∑) ADC which combines a couple of techniques including oversampling, noise shaping and digital filtering. That’s not to say that you need several chips to accomplish this, these days single chip Delta-Sigma ADCs and very small and available for a few dollars. Sometimes they are called Sigma-Delta (∑Δ) just to confuse things, a measure I applaud as there aren’t enough sources of confusion in the engineering world already.

I’m making this a two-parter. I will be talking about some theory and show the builds that demonstrate Delta-Sigma properties and when you might want to use them.

Continue reading “Tearing Into Delta Sigma ADC’s”

Build A 3D Printer Workhorse, Not An Amazing Disappointment Machine

3D printers have become incredibly cheap, you can get a fully workable unit for $200 – even without throwing your money down a crowdfunded abyss. Looking at the folks who still buy kits or even build their own 3D printer from scratch, investing far more than those $200 and so many hours of work into a machine you can buy for cheap, the question “Why the heck would you do that?” may justifiably arise.

The answer is simple: DIY 3D printers done right are rugged workhorses. They work every single time, they never break, and even if: they are an inexhaustible source of spare parts for themselves. They have exactly the quality and functionality you build them to have. No clutter and nothing’s missing. However, the term DIY 3D printer, in its current commonly accepted use, actually means: the first and the last 3D printer someone ever built, which often ends in the amazing disappointment machine.

This post is dedicated to unlocking the full potential in all of these builds, and to turning almost any combination of threaded rods and plywood into a workshop-grade piece of equipment.

Continue reading “Build A 3D Printer Workhorse, Not An Amazing Disappointment Machine”

Don Eyles Walks Us Through The Lunar Module Source Code

A couple weeks ago I was at a party where out of the corner of my eye I noticed what looked like a giant phone book sitting open on a table. It was printed with perforated green and white paper bound in a binder who’s cover looked a little worse for the wear. I had closer look with my friend James Kinsey. What we read was astonishing; Program 63, 64, 65, lunar descent and landing. Error codes 1201, 1202. Comments printed in the code, code segments hastily circled with pen. Was this what we thought we were looking at? And who brings this to a party?

Continue reading “Don Eyles Walks Us Through The Lunar Module Source Code”