Embed With Elliot: Practical State Machines

Raindrops on roses, and whiskers on kittens. They’re ok, but state machines are absolutely on our short list of favorite things.

There are probably as many ways to implement a state machine as there are programmers. These range from the terribly complex, one-size-fits-all frameworks down to simply writing a single switch...case block. The frameworks end up being a little bit of a black box, especially if you’re just starting out, while the switch...case versions are very easy to grok, but they don’t really help you write clear, structured code.

In this extra-long edition of Embed with Elliot, we’ll try to bridge the middle ground, demonstrating a couple of state machines with an emphasis on practical coding. We’ll work through a couple of examples of the different ways that they can be implemented in code. Along the way, we’ll Goldilocks solution for a particular application I had, controlling a popcorn popper that had been hacked into a coffee roaster. Hope you enjoy.

Continue reading “Embed With Elliot: Practical State Machines”

Why IoT Will Fail (and How To Save It)

Buzzword technology has two possible fates: they fail and disappear or they succeed and disappear. Remember at one time “multimedia” and “networking” were buzzwords. They succeeded and now they’ve vanished into ubiquity. Of course, there are plenty of failed buzzwords (like telecosm) that you probably don’t even remember. They just vanished into obscurity.

Unless you’ve been living under the CNC mill in your local hackerspace, you’ve probably heard or read about the “Internet of Things” (IoT). Companies big and small have realized that getting in early on The Next Big Thing is good for share prices and, right now, IoT is where everyone is trying to make a play.

There’s two things I’d observe, though: First, IoT is far from new. Connecting embedded systems to the Internet is old hat (I even wrote a book called Embedded Internet Design way back in 2003). Second, the way it is going, IoT–in its current incarnation–is doomed.

Continue reading “Why IoT Will Fail (and How To Save It)”

Retrotechtacular: Häfla Hammerforge Healed

Visit any renaissance fair across the United States this fall and you’ll undoubtedly find a blacksmith. He’ll be sweating away in a tent, pounding on a piece of glowing steel set against an anvil. While the practice of the single blacksmith endures today, high-production ‘works of days past required increasing amounts of muscle. The more tireless the muscle, the better. The manual efforts of the blacksmith were replaced by huge hammers, and the blacksmith needed only to turn the piece between impressions and maintain a healthy respect for the awesome crushing power of the machine.

Last week, blacksmith enthusiasts completed restoration work on the Häfla hammer in Finspang, Sweden. The 333 year old hydraulic hammer hadn’t been used since 1924, when operations ceased at the Häfla Hammerforge. The ‘works was built in 1682 and used the German method of forging, which had been introduced to Sweden in the 1500s. Steel production was revolutionized in the 1800s by the Bessemer process, which resulted in a much stronger product. Continue reading “Retrotechtacular: Häfla Hammerforge Healed”

atom drawing

The Eulogy Of Local Hidden Variables

During the early 1900’s, [Einstein] was virtually at war with quantum theory. Its unofficial leader, [Niels Bohr], was constantly rebutting Einstein’s elaborate thought experiments aimed at shooting down quantum theory as a description of reality. It is important to note that [Einstein] did not disagree with the theory entirely, but that he was a realist. And he simply would not believe that reality was statistical in nature, as quantum theory states. He would not deny, for example,  that quantum mechanics (QM) could be used to give a probable location of an electron. His beef was with the idea that the electron doesn’t actually have a location until you try to measure it. QM says the electron is in a sort of “superposition” of states, and that asking what this state is without measurement is a meaningless question.

So [Einstein] would dream up these incredibly complex hypothetical thought experiments with the goal of showing that a superposition could not exist. Now, there is something to be said about [Einstein] and his thought experiments. He virtually dreamed up his relativity theory while working as a patent clerk at the ripe old age of 26 years using them. So when he had a “thought” about something, the whole of the scientific world stopped talking and listened. And such was the case on the 4th of May, 1935.

Continue reading “The Eulogy Of Local Hidden Variables”

Hackaday Links Column Banner

Hackaday Links: August 30, 2015

A month ago, we ran a post about [Jim]’s rare and strange transparent microchips. He’s back at it again, this time taking a look at the inner workings of MOSFETs

The Unallocated Space hackerspace is moving, and they’re looking for a few donations to get the ball rolling.

Yes, it’s a Kickstarter for a 3D printer, but the LumiPocket is interesting, even if only on the basis of the engineering choices. It’s a UV laser resin printer, and they’re using a SCARA arm to move the laser around. They’re also doing a top-down resin tank; it requires more resin, but it seems to work well enough.

Around DC or northern Virginia? We’re going to be there on September 11th through the 13th. We’re holding a Hackaday Prize Worldwide meetup at Nova Labs in Reston, Virgina. Sign up now! Learn KiCAD with [Anool]! Meet [Sudo Bob]! It’ll be a blast.

Not around DC or NOVA? This Wednesday we’ll be hosting another chat on .io.

The GEnx is one of the most beautiful and advanced engines in the world, and that means [Harcoreta] oven on the RC groups forums has made one of the most beautiful electric ducted fans in the world. On the outside, it looks like a GEnx, including reverse thrust capabilities, but inside it’s pure electronics: a brushless motor rotates a 100mm, 18-blade fan. He’s hoping to mount it on a Bixler (!). We can’t wait for the video of the maiden.

Hacklet 72 – Burning Man Projects

Burning Man is almost here! In just a few days, artists, hackers, makers, and engineers will converge on the Black Rock Desert in northern Nevada. They’ll endure the heat, the dust, and possibly a few bugs to create one of the largest outdoor art festivals in the world. Every year, the playa is covered with art cars, giant rolling barges, and fire-breathing animals covered in RGB LEDs. With so many projects to work on, it’s no surprise that quite a few Hackaday.io members (and Hackaday staffers) are burners. This week’s Hacklet is about some of the best Burning Man projects on Hackaday.io!

thedeepWe start with [David Nghiem] and “The Deep” – DC’s Sonic Jellyfish Art Cart. There’s just something calming about a watching a luminescent jellyfish floating serenely through the dark ocean. [David] and his team are recreating that effect in the desert with The Deep. They’re hanging a giant jellyfish in front of a golf cart. The medusa will be festooned with yards of silk and other types of fabric to create a flowing effect. Lighting will come from 8 RGB LED strips, controlled by 15 Teensy LCs. The Teensys will keep the lights flashing to the beat of the music. Burners can dance inside the sculpture, because this jellyfish thankfully has no sting.

anglerfishBicycles are the preferred mode of personal transportation at Burning Man. As you might imagine, it can be pretty hard to find your bike among all the other parked cycles. [Bob Baddeley] has made this a bit easier with Anglerfish for Bikes. Real anglerfish have an illicium, which is a stalk with a lighted tip that hangs just in front of their mouth. The bioluminescent light lures prey to the fish. [Bob] is using an RGB LED illuminated ball to lure him to his bike. This anglerfish started life as a blinky globe from Amazon. [Bob] removed the original electronics and replaced them with a Bluetooth radio on his own custom PCB. A simple press of a button gets the ball shimmering and blinking, leading [Bob] to his ride.

danceNext up is [Jeremy] with Interactive Disco Dance Floor. Inspired by Saturday Night Fever and the music video for Billy Jean, [Jeremy] is creating a dance floor that responds to those dancing on it. The floor is lit by 80 meters of 5050 RGB LEDs, controlled by ATmega168s. The ATmega168’s are connected to a capacitive sensor made up of a chicken wire grid. The system is sensitive enough to pick up feet even when wearing thick motorcycle boots. All the processors connect to a central computer via an RS-485 network. This allows the computer to take over and drive pre-programmed patterns to the floor. The PC side code is written in JavaScript, so it’s easy to modify.

jacketFinally, we have Hackaday.io’s own [Jasmine] with Glow Jacket. Walking around at night in Black Rock City can be dangerous. People running from party to party, high cyclists flying across the playa, you never know who might run into you! Having something to make sure you’re visible is a great start of a project. Keeping warm through the cold nights in the desert would be an added bonus. [Jasmine] sewed 32 feet of electroluminescent (EL) wire onto the back of a black parka. The wire ran to two AA battery-powered inverters hidden in the jacket. The hardest part turned out to be sewing all that EL wire to a jacket. Once all the stitching was done though, her husband [Ben] glows like a beacon in the night.

burning-thumb

Burners unite! [Jasmine] has set the Hacker Burners project page as a meeting place for all burners and fans of Burning Man. If you’re interested, join up! If you’d like to see more Burning Man projects, I’ve got you covered with our new Burning Man project list. If I missed your project, don’t hesitate to drop me a message on Hackaday.io. That’s it for this week’s Hacklet. As always, see you next week. Same hack time, same hack channel, bringing you the best of Hackaday.io!

Fail Of The Week: Exploding Fermentation

It’s no secret that hackers like fermentation, both the process and the end results. I myself have a crock of sauerkraut happily bubbling away in the kitchen right now. Fermentation can lead to tasty endpoints, and the process itself, which basically amounts to controlled rotting, is a fascinating set of biochemical reactions. But done wrong, fermentation can result in injury, as it did at CCC this year when a fermentation vessel exploded.

"It was the one on the left, officer. He did it."
“It was the one on the left, officer. He did it.”

Exactly what happened isn’t really clear, except that Food Hacking Base ran a number of workshops at CCC 2015, several of which involved fermented foods or drinks. A Grolsch-style bottle with a ceramic flip-top was apparently used as a fermentation vessel, but unfortunately the seal was not broken. The bottle found its way to another tent at CCC, this one running an SMD soldering workshop. Carbon dioxide gas built up enough pressure in the bottle to shatter it and send shrapnel flying through the workshop tent. According to a discussion thread on the incident, “people got hurt and need to go to the hospital because glas [sic] particles were stuck in their faces, a throat was cut and an eyelid bleeding.” The explosion was quite energetic, because, “we also found a 20cm long piece of glass that went trough [sic] the ceiling of the tent and propelled for another 4-5 meters afterwards.”

We’ve seen lots of Hackaday projects involving instrumentation and automation of fermentation, including some with really large vessels. The potential for destruction if such a vessel isn’t properly vented is pretty high. At the very least, you’ll be left with a really big mess to clean up. Be careful out there – microbes are not to be trifled with. We don’t want to give you the wrong idea about CCC; this year was incredible as [Elliot Williams] reported during his time there.

Now it’s off to the kitchen to check on my kraut.

[Thanks to Morgan for the tip.]