Hackaday Prize Entry: The Green Machine

For Hackers, rapid prototyping is made easier using basic building blocks such as the Raspberry Pi, Arduino and the huge variety of add on shields for home brew projects. But we don’t see too many real world Industrial applications or machines built using these off-the-shelf electronics. [SlyScience] built The Green Machine – an industrial grade, automated spray painting device to help coat polycarbonate tubes consistently.

The Green Machine is essentially a linear drive that can move a spray gun across a spinning clear tube and coat it evenly with the desired color. These tubes are used as color filters – they slide over standard T5, T8 or T12 fluorescent lamps – and are used in advertising, special effects, films and similar applications. For almost 10 years prior to this machine, the task was done manually. The HPLV (high pressure, low volume) spray gun used for this process needed skilled hands to get consistent results. It was easy to ruin a tube and cleaning them was not possible. [SlyScience] figured things out on the go – teaching himself and figuring out all of the software and hardware pieces of the puzzle. The welded steel frame is about the only “custom” part in this build. Everything else is COTS. Check out the video of The Green Machine in action below, and if you have any tips to help improve the build, chime in with your comments.

Continue reading “Hackaday Prize Entry: The Green Machine”

Rainbow Cats Announce Engagement

[ANTALIFE] is going to tie the knot sometime in 2017. Instead of sending out paper announcements or just updating his Facebook status, he wanted to give their family members something lasting and memorable, like a small trinket with a pair of light-up cats.

This project is pretty simple in theory. A pair of RGB LEDs cycle through the colors of the rainbow with the help of an ATtiny25 and resistors carefully chosen for each LED. But there are several challenges at play here. [ANTALIFE] wanted to design something quite small that would last at least a day on a single CR2032 coin cell. This project was his first foray into SMD/SMT design and construction. We think that this warrants its own congratulations, especially since it looks as though he made at least a dozen of these things.

[ANTALIFE] made things much easier for himself with the purchase of a cheap hot air rework station and used a chip clip to program the ‘tiny. The cats are a design from Thingiverse, which he modified to turn them into bride and groom. Watch a whole line of them glow after the break. We sincerely hope that a larger version of these cats end up on top of the wedding cake.

For anyone with an undying love blinkenlights and impending nuptials, don’t forget the light-up invitations, wedding attire, and centerpieces.

Continue reading “Rainbow Cats Announce Engagement”

Talking Star Trek

Speech generation and recognition have come a long way. It wasn’t that long ago that we were in a breakfast place and endured 30 minutes of a teenaged girl screaming “CALL JUSTIN TAYLOR!” into her phone repeatedly, with no results. Now speech on phones is good enough you might never use the keyboard unless you want privacy. Every time we ask Google or Siri a question and get an answer it makes us feel like we are living in Star Trek.

[Smcameron] probably feels the same way. He’s been working on a Star Trek-inspired bridge simulator called “Space Nerds in Space” for some time. He decided to test out the current state of Linux speech support by adding speech commands and response to it. You can see the results in the video below.

Continue reading “Talking Star Trek”

Multipurpose Robot For The Masses

As the cost of almost every technology comes falling down, from electronics to batteries to even tools like 3D printers, the cost to build things formerly out of reach of most of us becomes suddenly very affordable. At least, that’s what [John Choi] has found by building a completely DIY general purpose robot for around $2000.

OK, so $2000 isn’t exactly “cheap” but considering that something comparable (like Baxter) costs north of what a new car would cost means that [John] has dropped the price for a general-purpose robot by an order of magnitude. And this robot doesn’t skimp on features, either. It has a platform that allows it to navigate rooms, two manipulating limbs with plenty of servos, a laptop “head” that allows for easy interface, testing, and programming, and an Arduino Mega that allows it to interface with any sensors or other hardware with ease. It’s also modular so it can be repaired and transported easily, and it uses open source software and open hardware so it’s easy to build on.

This robot is an impressive piece of work that should help bring this technology to more than just high-end factories and research labs. They’ve already demonstrated the robot watering plants, playing the piano, picking things up, and many other tasks. We’d say that they’re well on their way to their goal of increasing the number of students and hobbyists who have access to this technology. If the $2k price tag is still too steep, though, there are other ways of getting into robotics without diving headfirst into a Baxter-like robot.

Continue reading “Multipurpose Robot For The Masses”

The Hacker Is The Future Of The Prosthetic: Hackers Helping Those In Need

Rush_valley
Even the city’s welcome sign is held high by two prosthetic arms.

In the show Full Metal Alchemist, there’s a city called Rush Valley whose main and only business are the high performance prostheses called Automail. Engineers roam the street in Rush Valley; the best have their own shop like that of the high-end clothiers in Saville Row. Of course; it’s all fantasy set in a slightly ridiculous Japanese cartoon, but while walking through this year’s Maker Faire I began to wonder if is a future that may come to be.

The problem with prosthetics is the sheer variety of injuries, body types, and solutions needed. If an injury is an inch higher or an inch lower it can have a big effect on how a prosthetic will interact with the limb. If the skin is damaged or the nerves no longer function a different type of prosthesis will be needed. Some prostheses are to replace a lost limb, others are to assist an ailing body in order to return it to normal function. More than a few are simply temporary aides to help the body along in its healing efforts. Unfortunately, this means that it’s often the case that larger companies only sell the prostheses people are most likely to need; the rarer cases are often left without a solution.

The e-Nable project doesn't mess around.
The e-Nable project doesn’t mess around.

However, we see hackers stepping up and not just working on the problems, but solving them. One of our semifinalists last year, openbionics, inspired one of the projects we’ll be talking about later. There are robotic legs. We met a guy at MRRF who has been 3D printing hands for his son from the E-nable project.

Along these lines, we saw two really cool projects at Maker Faire this year: The first is the Motor-Assistive Glove, or MAG. MAG is designed to help people with Peripheral Neropathy regain some use of their hands while they go through the lengthy road to recovery. Perhipheral Neuropathy is a disease, usually resulting from diabetes, toxin exposure, or infection, where the nerves are damaged in such a way that typically the hands and feet are no longer mobile or feel sensation in a useful way. Once the disease is in full swing, a previously able person will find themselves unable to do simple things like hold a can of soda or grasp a doorknob firmly enough to open it.

The Motor Assistive Glove
The Motor Assistive Glove

We had a chance to interview one of the members of the MAG team, [Victor Ardulov], which you can see in the following video. [Victor] and his group started a research project at the University of Santa Cruz to develop the Motor-Assistive Glove. The concept behind it is simple. People with Peripheral Neuropathy typically have some movement in their hands, but no strength. The MAG has some pressure sensors at the tips of the fingers. When the user puts pressure on the pad; the glove closes that finger. When the pressure is off; the glove opens. The concept is simple, but the path to something usable is a long one.

Continue reading “The Hacker Is The Future Of The Prosthetic: Hackers Helping Those In Need”

Gcc: Some Assembly Required

There was a time when you pretty much had to be an assembly language programmer to work with embedded systems. Yes, there have always been high-level languages available, but it took improvements in tools and processors for that to make sense for anything but the simplest projects. Today, though, high-quality compilers are readily available for a lot of languages and even an inexpensive CPU is likely to outperform even desktop computers that many of us have used.

So assembly language is dead, right? Not exactly. There are several reasons people still want to use assembly. First, sometimes you need to get every clock cycle of performance out of a chip. It can be the case that a smart compiler will often produce better code than a person will write off the cuff. However, a smart person who is looking at performance can usually find a way to beat a compiler’s generated code. Besides, people can make value trades of speed versus space, for example, or pick entirely different algorithms. All a compiler can do is convert your code over as cleverly as possible.

Besides that, some people just like to program in assembly. Morse code, bows and arrows, and steam engines are all archaic, but there are still people who enjoy mastering them anyway. If you fall into that category, you might just want to write everything in assembly (and that’s fine). Most people, though, would prefer to work with something at a higher level and then slip into assembly just for that critical pieces. For example, a program might spend 5% of its time reading data, 5% of its time writing data, and 90% of the time crunching data. You probably don’t need to recreate the reading and writing parts. They won’t go to zero, after all, and so even if you could cut them in half (and you probably can’t) you get a 2.5% boost for each one. That 90% section is the big target.

The Profiler

Sometimes it is obvious what’s taking time in your programs. When it isn’t, you can actually turn on profiling. If you are running GCC under Linux, for example, you can use the -pg option to have GCC add profiling instrumentation to your code automatically. When you compile the code with -pg, it doesn’t appear to do anything different. You run your program as usual. However, the program will now silently write a file named gmon.out during execution. This file contains execution statistics you can display using gprof (see partial output below). The function b_fact takes up 65.9% of CPU time.

screenshot_232

If you don’t have a profiling option for your environment, you might have to resort to toggling I/O pins or writing to a serial port to get an idea of how long your code spends doing different functions. However you do it, though, it is important to figure it out so you don’t waste time optimizing code that doesn’t really affect overall performance (this is good advice, by the way, for any kind of optimization).

Assembly

If you start with a C or C++ program, one thing you can do is ask the compiler to output assembly language for you. With GCC, use a file name like test.s with the -o option and then use -S to force assembly language output. The output isn’t great, but it is readable. You can also use the -ahl option to get assembly code mixed with source code in comments, which is useful.

You can use this trick with most, if not all, versions of GCC. Of course, the output will be a lot different, depending. A 32-bit Linux compiler, a 64-bit Linux compiler, a Raspberry Pi compiler, and an Arduino compiler are all going to have very different output. Also, you can’t always figure out how the compiler mangles your code, so that is another problem.

If you find a function or section of code you want to rewrite, you can still use GCC and just stick the assembly language inline. Exactly how that works depends on what platform you use, but in general, GCC will send a string inside asm() or __asm__() to the system assembler. There are rules about how to interact with the rest of the C program, too. Here’s a simple example from the a GCC HOWTO document (from a PC program):

__asm__ ("movl %eax, %ebx\n\t"
"movl $56, %esi\n\t"
"movl %ecx, $label(%edx,%ebx,$4)\n\t"
"movb %ah, (%ebx)");

You can also use extended assembly that lets you use placeholders for parts of the C code. You can read more about that in the HOWTO document. If you prefer Arduino, there’s a document for that, too. If you are on ARM (like a Raspberry Pi) you might prefer to start with this document.

So?

You may never need to mix assembly language with C code. But if you do, it is good to know it is possible and maybe not even too difficult. You do need to find what parts of your program can benefit from the effort. Even if you aren’t using GCC, there is probably a way to mix assembly and your language, you just have to learn how. You also have to learn the particulars of your platform.

On the other hand, what if you want to write an entire program in assembly? That’s even more platform-specific, but we’ll look at that next time.

Continuous Delivery For Your ESP8266

There’s nothing to be ashamed of. It’s a problem we all have. You change your code a lot — you can’t help it, you just need to tweak one last little bit. And then you have to go downstairs, fetch your ESP8266 module, plug it in to your computer, flash the new firmware in, and then run back down and re-install your wine-cellar temperature monitor. If only there were a way to continuously update your ESP8266 over the air, pulling new code down from your GitHub repository, automatically running your test suite on it, and then pushing it off to the ESP.

OK, it’s ridiculous overkill, but [squix] strung together a bunch of open-source continuous integration tools and made them work with the ESP8266. A simple PHP script connects the ESP to the rest of the web infrastructure.

[squix] says the word “security” in the same way that gin aficionados whisper “vermouth” over their Martinis. Which is to say, there is none. But for a home solution, or if you want to play around with continuous development, it’s a good start.

And this is a cool project because it makes use of the ESP8266 OTA (over-the-air) programming library to push the code across. And we do hate having to run around the house to update firmware.

So check it out if you want to push code to your ESP8266s without physically going to fetch them, or if you want to integrate your web development with your home deployment.