Firmware Factory: Bit Fields Vs Shift And Mask

Working with embedded systems usually involves writing code which will interface with hardware. This often means working on the register level. It doesn’t matter if we’re talking about a UART, an analog to digital converter, an LCD controller, or some other gizmo. Sooner or later, you’re going to have to break out the datasheets and figure out how to talk to an external device. To succeed at this you must become a master of bit manipulation.

Hardware designers don’t like wasting space, so modes, settings and other small pieces of information are often stored as packed bits. Our processors usually access things a byte (or a word) at a time, so what is the best way to handle this? Like so many other topics in software engineering, there are multiple ways to skin this cat. In C (and its derivatives) there are two major options: shift and mask, and bit fields.

Continue reading “Firmware Factory: Bit Fields Vs Shift And Mask”

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!

Cheap Function Generator Teardown And Improvement

In general, you get what you pay for, and when [Craig] picked up a cheap function generator off eBay, he didn’t expect much from it. But as he shows us in his blog post and a series of videos below, while the instrument lived down to his expectations, he was able to fix it up a bit.

Having spent only $100USD for the MHS-5200A, [Craig]’s adventure is a complete teardown and analysis of the function generator. While it sort of lives up to its specs, it’s pretty clear that some design decisions resulted in suboptimal performance. At higher frequencies and higher amplitudes, the sine wave output took on a markedly non-sinusoidal character, approaching more of a triangle waveform. The spectrum analyzer told the tale of multiple harmonics across the spectrum. With a reverse-engineered schematic in hand, he traced the signal generation and conditioning circuits and finally nailed the culprit – an AD812 op-amp used as the final amplifier. An in-depth discussion of slew rate follows in part 2, and part 3 covers replacement of the dodgy chip with a better selection that improves the output signal. We’re also treated to improvements to a low-pass filter that fixed a nasty overshoot and ringing problem with the unit’s square wave function.

If hacking the MHS-5200A seems a bit familiar to you, that’s because we covered another reverse-engineering exploit of it recently. That hack of the serial protocol of the instrument was by [WD5GNR], also known as Hackaday’s own [Al Williams]. Cheers to both [Craig] and [Al] for showing us what you can do with a hundred bucks and a little know-how.

Continue reading “Cheap Function Generator Teardown And Improvement”

Building A Business Around Generative Design And Marvels Of 3D Printing

Generative design is a method of creating something by feeding seed data into an algorithm. It might be hard at first to figure out how someone would build a business around this, but that’s exactly what Nervous System has been doing with great success. The secret is not only in the algorithm, but in how they’re bringing it to life.

Continue reading “Building A Business Around Generative Design And Marvels Of 3D Printing”

Witness The Birth Of A 36-Lens Panoramic Camera

We are suckers for a teardown video here at Hackaday: few things are more fascinating than watching an expensive piece of equipment get torn apart. [Jonas Pfeil] is going the other way, though: he has just published an interesting video of one of his Panono panoramic ball cameras being built.

The Panono is a rather cool take on the panoramic camera: it is a ball-shaped device fitted with 36 individual cameras. When you press the button and throw the camera in the air, it waits until the highest point and then takes pictures from all of the cameras. Sound familiar? We first coverd [Jonas’] work way back in 2011.

Photos are stitched together into a single panoramic image with an equivalent resolution of up to 106 megapixels. The final image is panoramic in both horizontal and vertical directions: you can scroll up, down, left, right or in and out of the image. Since images are all taken at the same time you don’t have continuity problems associated with moving a single camera sensor. There are a number of sample images on their site but keep reading for a look at some of the updated hardware since our last look at this fascinating camera.

Continue reading “Witness The Birth Of A 36-Lens Panoramic Camera”

Modified Mower Hacks The Heavy Stuff

Clearing brush is no fun. Sure, swinging a machete on a hot, humid day sounds great, but when you’re sitting in an oatmeal bath the next day because you didn’t see the poison ivy, you’ll be looking for a better way. [RoboMonkey] did just that with a field-expedient brush trimmer that’s sure to help with his chores.

This is a hack in the true Junkyard Wars sense of the word. A cast-off electric push mower deck caught [RoboMonkey]’s eye, and a few spare brackets and bolts later his electric hedge trimmer was attached across the front of the mower. With a long extension cord trailing behind, he was able to complete in 10 minutes what would normally take him an hour to accomplish, without spending a dime on either a specialized brush cutter or a landscaping service. The video after the break reveals that it may not be the most powerful tool in the shed, and it won’t likely stand up to daily use, but for this twice a year chore, it’s more than sufficient. And since the hedge trimmer wasn’t modified, it’s still available for its original purpose. Reduce, reuse, recycle – and repurpose.

While we haven’t seen many brush cutters before, we seen plenty of mower mods. From LiPo electrics to a gas-powered RC unit, the common push-mower seems to be a great platform for all kinds of hacking.

Continue reading “Modified Mower Hacks The Heavy Stuff”

Hackaday Prize Semifinalist: Water Quality Monitoring

The theme of this year’s Hackaday Prize is to build something that matters, and there is nothing more important than water quality and pollution. Everything we eat and drink is influenced by the water quality in rivers and reservoirs. C4Derpillar, a semifinalist for the Hackaday Prize, is solving the problems of water-related health issues with innovative sensors for under $500 USD per unit.

The C4Derpiller is using capillary electrophoresis (CE) to detect anions and cations in waterways. CE pulls a water sample through a very thin tube with an electric current. As water is moving through this capillary, a sensor is able to detect heavy metals, pesticides, and other pollutants in a water supply. The team behind C4Derpiller has written a few posts about the separation chemistry of their device

Commercial CE equipment costs tens of thousands of dollars. The team behind the C4Derpillar are hoping to develop their pollution monitoring device and make it available for about $500 USD. That’s cheap enough for multiple pollution monitoring stations in the third world, and by pushing the results to the cloud, the C4Derpillar will be able to monitor pollution in real time.

You can check out C4Derpillar’s Hackaday Prize video below.

The 2015 Hackaday Prize is sponsored by:

Continue reading “Hackaday Prize Semifinalist: Water Quality Monitoring”