Hackaday

Syndicate content Hackaday
Fresh hacks every day
ถูกปรับปรุง 1 ชั่วโมง 46 min ก่อน

Hackaday Prize Semifinalist: Portable A/C

เสาร์, 08/29/2015 - 12:00

Many people with Multiple Sclerosis have sensitivity to heat. When the core body temperature of an MS sufferer rises, symptoms get worse, leading to fatigue, weakness, pain, and numbness. For his entry to the Hackaday Prize, [extremerockets] is finding a solution. He’s developing a wearable, personal cooling device that keeps the wearer at a comfortable temperature.

The device is based on a wearable shirt outfitted with small tubes filled with a cooling gel. This setup is extremely similar to the inner garments worn by astronauts on spacewalks, and is the smallest and most efficient way to keep a person’s core body temperature down.

Unlike a lot of projects dealing with heating and cooling, [extremerockets] isn’t working with Peltiers or thermoelectric modules; they’re terribly inefficient and not the right engineering choice for something that’s going to be battery-powered. Instead, [extremerockets] is building a miniature refrigeration unit, complete with a real refrigeration cycle. There are compressors, valves, and heat exchanges in this build, demonstrating that [extremerockets] has at least some idea what he’s doing. It’s a great project, and one we can’t wait to see a working prototype of.

The 2015 Hackaday Prize is sponsored by:
Filed under: The Hackaday Prize

Make Your Own Transparent Whiteboard

เสาร์, 08/29/2015 - 09:01

Now this is seriously cool. Beyond seeing it in movies, having a transparent whiteboard that lights the ink up is absolutely awesome and pretty darn unique. [Andrew McNeil] shows us how — and it’s pretty simple too!

As an avid YouTuber, [Andrew] often has to explain things by drawing out diagrams and what not. If you’ve ever tried to film yourself doing this, you’ll know it’s not easy. So what if you could use the whiteboard like you normally would? And that whiteboard is also the window of which you, the audience, watches through? It’s really quite brilliant, and already in use for some teaching methods.

But wait, are we talking about literally using a glass window to write on? Well… kind of. But the trick is to have the glass edge-lit using LEDs. Doing so will literally make your dry erase markers glow. It practically looks like a neon sign.

We think [Bil Herd] might have to make one of these for his Hack a Day videos! But we’d expect nothing less than an automatic erasing system built right in to the whiteboard as well…


Filed under: how-to

A Sunflower Heat Engine

เสาร์, 08/29/2015 - 06:01

Looking for a cool science experiment to do with the kids? Why not build a type of heat engine that resembles a sunflower? [Steve] from Rimstar.org shows us how!

It’s actually a pretty ingenious little project. Using metal foil scraps from a coffee bag, [Steve] created a perfectly balanced wheel that looks kind of like a sunflower. When the foil petals come close to heat they try to expand, but much like a bimetal strip, the materials making up the packaging expand at different rates to straighten the heated petal. This moves the center of gravity of the wheel off-axis, causing a rotation. As the wheel spins, the foil petal cools off, and another one is heated, creating continual movement — at least until the heat supply is taken away!

It’s a lot of work to get the balance just right, but thanks to an ingenious axle design it’s pretty easy to make adjustments. The wheel actually floats on a nail with its point stuck to a magnet, and the other end is suspended by a series of magnets. It’s pretty much as close to a friction free axle as you can get!

For other cool engine builds, check out his simple steam engine, or his famous Corona motor he’s used in many videos!


Filed under: how-to

Firmware Factory: Bit Fields vs Shift and Mask

เสาร์, 08/29/2015 - 03:00

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.

Consider this register from an Analog Devices ADAU1977, an Analog to Digital Converter (ADC). There is a lot going on here. We’ve got 6 separate data elements to deal with. Bit 7, is a read only bit, while the rest are read/write. The 3 least significant bits are handled as a single 3 bit value, used to select the master clock for the ADC. 

Bit Fields

C’s native interface for describing bitwise data is bit fields. Bit fields are defined just like structures, which means they make for very easy to read code. The disadvantage to bit fields is that they are non-portable. Using bit fields means placing a lot of trust that your compiler will do what you expect it to.

In bit fields, we would describe the PLL control register as follows:

struct { unsigned char clockSelect:3; unsigned char res2 :1; unsigned char clkSource :1; unsigned char res1 :1; unsigned char pllMute :1; unsigned char pllLock :1; } PllControlRegister;

accessing the bit fields is just like a structure:

struct PllControlRegister myRegister; myRegister.pllMute = 0;

Easy right? Well, the devil is in the details. Bit fields are one of the gotchas of non-portable code. Even the Linux kernel hackers have been bitten. If the project you’re working on is architecture (and compiler) specific, and you know how the compiler will work, you’re golden! However, if you have any future plans to re-use this code on a different system, you’re asking for trouble. Here’s why: The C standard doesn’t define how bit fields should be ordered. In fact, it says: “The order of allocation of bit-fields within a unit (high-order to low-order or low-order to high-order) is implementation-defined.”

Going by that, we have no way to know if pllLock will end up in the most significant bit like we expect it to, or the least significant bit. Things get even more complicated when you throw in larger bit fields on 32 or 64 bit machines, endianness, and padding for fields that cross storage boundaries. If you’re interested in portable code, you’re better off with the other method, shift and mask, which I describe below. For now though, let’s talk about a real world case where bit fields are the better bet.

Microchip’s PIC line of processors use bit fields extensively in their own include files. For example, the INTCON (interrupt control) register on the PIC16F1829 microcontroller is defined as follows:

struct { unsigned IOCIF :1; unsigned INTF :1; unsigned TMR0IF :1; unsigned IOCIE :1; unsigned INTE :1; unsigned TMR0IE :1; unsigned PEIE :1; unsigned GIE :1; }INTCONbits_t;

(the actual .h file has a union, but I’ve simplified things a bit here)

Microchip can use bit fields here because they know what the compiler will do – they wrote it! INTCON is also an internal register on the PIC itself, so no worries about writing portable code. The added bonus here is that PIC has bit set and clear opcodes that can operate over all of its RAM. The compiler is smart enough to translate any bit field operation to the appropriate bsf and bcf opcodes, which operate in a single cycle.

Shift and Mask

The safer way to handle operations like this is shifting and masking. As the name implies, this uses a shift operation to build up a mask, then we use that mask with a logical operator to set or clear a specific bit. We don’t want to perform all this work on the actual hardware, so the best bet is to use a shadow of the register in RAM. First read the hardware register into RAM, then make modifications on the RAM shadow, and finally write the RAM shadow back to the hardware register. This is where the term Read-Modify-Write comes from. I know this all sounds complex, but after using it a few times, shift and mask with a shadow register becomes second nature.

Looking back at the ADC register up at the top of the article, let’s say we wanted to set pllMute, which is bit 6. The logical OR operation can be used to set a bit. In this case you need to mask all the bits you want to change with a 1.

For simplicity’s sake, assume for these examples that PllControlRegister is a memory mapped I/O location, called  “pllCtlReg”.

unsigned char pllShadow; unsigned char mask = 1; pllShadow = pllCtlReg; //Read the current value of pllCtlReg //now build the mask mask = mask << 6; //Shift to get 0x40, or b0100 0000 pllShadow | = mask; //Logical OR will SET the only bit 6 in our shadow pllCtlReg = pllShadow; //write the shadow back to the hardware

If we want to clear a bit, a logical AND is the way to go, but this time you need to mask the bits you want to change with 0s, all other bits will be set to 1.

unsigned char pllShadow; unsigned char mask = 1; pllShadow = pllCtlReg; //Read the current value of pllCtlReg //now build the mask mask = mask << 6; //Shift to get 0x40, or b0100 0000 mask = ~mask; //logical NOT gives us 0xBF, or b1011 1111 pllCtrlReg &= mask; //Logical AND will clear only bit 6 in our shadow. pllCtlReg = pllShadow; //write the shadow back to the hardware

If you need to toggle a bit, logical exclusive or (XOR, or the ^ operator) is the tool of choice. I’m just showing one of the most basic ways to perform shift and mask. There are plenty of ways to perform the same operations. You can use #defines, or preprocessor macros, or even functions to perform these same tasks. It all depends on what is most important for your application: memory space, or execution speed.


Filed under: Featured

Hacklet 72 – Burning Man Projects

เสาร์, 08/29/2015 - 00:00

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!

We 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.

Bicycles 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.

Next 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.

Finally, 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.

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!


Filed under: Hackaday Columns

Cheap Function Generator Teardown and Improvement

ศุกร์, 08/28/2015 - 22:31

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.


Filed under: misc hacks, tool hacks

Building a Business Around Generative Design and Marvels of 3D Printing

ศุกร์, 08/28/2015 - 21:01

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.

The company was founded in the Boston area by [Jessica Rosenkrantz] and [Jesse Louis-Rosenberg], both graduates of MIT. They produce all kinds of goods from furniture, to jewelry, games, and of course art (which includes clothing – more on that in a bit). What’s special about all of this is that the customer can be integral in the design process. The workflow for several of their products starts with a web-based design tool that lets you start with a simple generated design and make it your own.

Nervous System is well-known for designing the Kinematics Dress. This is a one-piece dress that was 3D printed out of nylon in one shot using selective laser sintering (SLS).  To make it fit in the printer the garment had to be “folded” in software, a very cool design trick! Unfortunately it’s not the most comfortable of clothing so this is absolutely an art piece. It is currently on exhibit in the Museum of Modern Art in New York.

On display when you enter the studio is furniture they have been experimenting with. The end tables are milled from plywood. The shapes feel very organic but it’s not hard to make the acrylic pieces fit snugly; CNC is great at that trick.

The bookshelves have been in use for years. [Jessica] mentioned that she added the key to the 3D printed connectors because the wood shrinks over time and a snug fit is prone to dump your books all over the room without this nifty design detail. If you’re interested in these check out the Github repo they’ve posted.

The vast majority of their production 3D printing is done off-site by the best equipment available. But it gets shipped to this studio for finishing. This starts with a trip through a vibrating polisher where ceramic medium makes the items smooth. Direct from the printers they have a powdery texture which results from the SLS process.

If the customer chooses a color the items are then dyed to specification. The day we visited there was a batch of jewelry being soaked in black dye.

On the research and development side of things the team has a lot of toys on site. I didn’t take a picture of every 3D printer but here are a few shots of the interesting ones. The rest of the shop area is actually used for production. The laser cutter is used to produce the puzzles shown below. They’ve been down a costly path of learning what this laser can and can’t do; cutting the tight tolerances in the puzzles is demanding for the stepper motors.

It’s always nice to leave some of the most interesting for last. The color-printed coral sculptures were breathtaking. I can’t imagine a process other than 3D printing that could feasibly make something like this. Along similar lines are the zoetropes they have on display. This is a sculpture that spins in a dark-box, with lights that strobe synchronous to the spinning. The result is a three-dimensional sculpture that generates right in front of your eyes.

Perhaps the widest appeal will be for the generative jigsaw puzzles. Many of these are not that large, about the size of a large slice of bread. But they contain numerous pieces with wonderfully whimsical shapes. The last puzzle shown is spectacular. It includes pieces of a different color throughout the design. These can be taken out separately to make a separate round puzzle. The puzzle-within-a-puzzle design was developed to be super-difficult after avid puzzlers asked for something more challenging. Good luck with that one!

Nervous System is built on a very interesting idea executed extremely well. Thanks for opening you doors to Hackaday and showing us how you make all of these wonderful pieces!


Filed under: 3d Printer hacks, Featured, laser hacks

Witness The Birth of a 36-Lens Panoramic Camera

ศุกร์, 08/28/2015 - 18:01

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.

Unsurprisingly, the device itself is pretty complex: I counted two rather crowded looking circuit boards and at least three smaller daughterboards that the cameras and USB port connect to, plus a whole rats nest of ribbon cables. This is the first commercial version (they are making and selling just a thousand of them, called the explorer edition), but it looks a little inefficient: I thought it might be possible to connect some of the cameras directly to the edge of the circuit board to lose a few of the cables. I asked [Jonas] about that, and he said:

The orientations of the camera modules are important and not two are the same. So at most we could mount three of 36 on the 3 mainboards in the center plane of the sphere. Orientation of the camera modules calls for their PCB to be tangential to the sphere surface. So basically you have to fold something. I’m sure there are other ways but this is the solution we came up with. We spent a good deal of time on that folding pattern and the shapes of the flexible boards :) Also for something made to hit the floor at this speed you have to decouple things mechanically or it will decouple itself on impact ;)

So, can anyone come up with a better idea for attaching the cameras to simplify this complex build?


Filed under: digital cameras hacks, teardown

Modified Mower Hacks the Heavy Stuff

ศุกร์, 08/28/2015 - 15:01

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.


Filed under: home hacks, tool hacks

Hackaday Prize Semifinalist: Water Quality Monitoring

ศุกร์, 08/28/2015 - 12:00

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:


Filed under: chemistry hacks, The Hackaday Prize

Hipster Rotary Dial Adds Bluetooth 4.0

ศุกร์, 08/28/2015 - 09:01

We have seen a few projects that convert a rotary dial for use with modern technology, but this one adds a new twist to the mix: it uses Bluetooth 4.0. [Silent] used a Nordic Semiconductor NRF51 DK development board for the project, which was built from the Nordic SDK source code for creating an HID (Human Interface Device). After what he claims was an hour or so of hacking, he was able to get this Arduino-compatible SoC dev board to detect the pulses from the rotary dial, then pass the appropriate number to a connected device as a key press. This means that his design should work with any device that has Bluetooth 4.0 support. It is powered from a big dry cell because, to quote [Silent], “small coin batteries are not hipster enough”.

It’s a simple project, and we have seen rotary cell phones before, but this still is ripe for expansion. You could either use a smaller, cheaper version of the Nordic chip at the center of this hack, as most of the dev board features aren’t used. Or you could do some more hacking, add support for the Bluetooth HSP headset profile, then wire it up to a vintage phone for the most hipster Bluetooth headset ever. We can’t wait until we see a hipster sitting in a coffee shop banging away on a typewriter and answering this. Get to it, people!


Filed under: Cellphone Hacks

Reverse Engineering a Different Kind of Bus

ศุกร์, 08/28/2015 - 06:01

Radio enthusiasts have a long history of eavesdropping on non-broadcast stations–police, fire, and public transportation frequencies, for example. These days, though, a lot of interesting communications are digital. When [bastibl] wanted to read data displayed on bus stop signs, he turned to software defined radio. He used gr-fosphor to monitor the radio spectrum as buses drove by and discovered a strong signal near 151 MHz (see photo below).

That, however, was just the start. Using a variety of tools, he figured out the modulation scheme, how the data framing worked, and even the error correction scheme. Armed with all the information, he built a GNU Radio receiver to pick up the data. A little number crunching and programming and [bastibl] was able to recover data about  individual buses including their position and schedule.

A little programming, and you wind up with live bus maps. Granted, if you don’t live in Paderborn Germany, this might not be directly useful to you. But it was a detective story worthy of a radio-version of CSI.

Apparently having an SDR is more fun if you have some native detective skills. It isn’t hard to get started with the basics, though.


Filed under: transportation hacks, wireless hacks

MIDI Sampling Off Magnetic Tapes

ศุกร์, 08/28/2015 - 03:01

Ever heard of the Mellotron? It was a British made audio sampler that used the most cutting edge technology available back in 1963… Magnetic tapes. You could record different sounds, music, beats or rhythm onto these magnetic tapes, and then play it back with the keyboard, much like a MIDI Sampler keyboard today. Well, someone has gone and made a newer version of one.

He calls it the Crudman, and it’s the same concept of a Mellotron, but uses slightly more modern components. Specifically, audio cassettes.

A MIDI keyboard sends output commands to a series of cassette players outfitted with Teensy microcontrollers. Depending on the settings, pressing a key can speed up or slow down a tape in order to generate a note. If it sounds simple, trust us, it’s not. The project has been a labor-of-love for the unnamed creator, who has spent nearly 10 years designing it. He now sells them (but only one a month) — you’ve gotta take a listen — they produce some of the most unique sounds we’ve ever heard.

For more cool magnetic tape hacks, why not build yourself a micro cassette tape delay?

[Thanks Itay, via Gizmodo]


Filed under: musical hacks

Before Arduino There was Basic Stamp: A Classic Teardown

ศุกร์, 08/28/2015 - 00:01

Microcontrollers existed before the Arduino, and a device that anyone could program and blink an LED existed before the first Maker Faire. This might come as a surprise to some, but for others PICs and 68HC11s will remain as the first popular microcontrollers, found in everything from toys to microwave ovens.

Arduino can’t even claim its prominence as the first user-friendly microcontroller development board. This title goes to the humble Basic Stamp, a four-component board that was introduced in the early 1990s. I recently managed to get my hands on an original Basic Stamp kit. This is the teardown and introduction to the first user friendly microcontroller development boards. Consider it a walk down memory lane, showing us how far the hobbyist electronics market has come in the past twenty year, and also an insight in how far we have left to go.

The Basic Stamp 1. A Simple circuit with just a microcontroller, an EEPROM, crystal, and brownout circuit. Teardown

The Basic Stamp kit on my workbench was made in 1993, and sold for a suggested retail price of $139 USD. Adjusted for inflation, this is nearly $230 in 2015 dollars. What do you get in the Basic Stamp starter kit? A single stamp, a programmer cable, and a surprising amount of documentation.

The Basic Stamp is an extremely minimalist board that does just enough to blink an LED, read a button, or drive an LCD. In the official documentation,  there are only a handful of parts: a microcontroller, an EEPROM with a few bytes of memory, a crystal, and a voltage regulator.

The PIC16C56XL is the brains of the outfit, featuring 1.5kilobits of Flash memory and 25 bytes of RAM. By modern standards, it’s tiny; the closest modern analog would be the ATtiny10, itself not a very recent chip. Microchip’s smallest and newest chip is the PIC12LF1522, featuring twice as much Flash and ten times the amount of RAM. We’re dealing with an old microcontroller when using the Basic Stamp

Like the Arduino, it was encouraged to use the Basic Stamp in product design.

Other components include a 93LC56 serial EEPROM. beside that is a 4MHz resonator, a 5V linear regulator, and a transistor and a few resistors for the ‘brown out’ circuit. Power is provided by a 9V battery connector soldered onto the board.

The electronic design of the Basic Stamp is simple, yes, but there’s a method to the madness. The code you write for the Basic Stamp is stored in 256 bytes of the EEPROM. This code is read by a PBASIC interpreter on the PIC, dutifully following commands to blink a LED or display a character on an LCD. No user code is actually stored on the microcontroller.

Programming

How about the programming environment? That’s a single executable running in a DOS shell. The system requirements are only, an IBM PC or compatible, DOS 2.0+, 128k of RAM, and a disk drive. Meager requirements, but this is not something that will run on your modern Windows workstation; it requires a proper parallel port.

For an IDE, the Basic Stamp editor is comparable to earlier Arduino IDEs; Alt+R runs the program on the Stamp connected to the computer, Alt+L loads a program, Alt+S saves a program, and Alt+Q quits the editor.

The BASIC language implemented on the PIC is minimal, but it does everything you would expect; individual pins can be set as input and output, buttons are debounced, and PWM functions are baked into the language.

An ad for the Basic Stamp. From High Tech Entrepreneur, October/November 1993. Ads had text in the past. Context

The Basic Stamp is now regarded as a slow, inconvenient artifact from the past. No one uses it, and the only place you’ll find one is in the back cabinet in a physics or EE classroom. This is an incredible disservice to a still-impressive piece of technology, and looking back at the Basic Stamp with our modern expectations is an incredible bias.

There were microcontroller development platforms before the Basic Stamp, but these were engineering tools, and expensive compared to the Stamp. Development platforms for the electrical hobbyist were around after the stamp, too: the Micromint Domino packed an entire development platform into a rectangular brick of plastic. None of these designs could match the popularity of the Basic Stamp despite the platform’s shortcomings.

The Arduino receives a lot of hate. Detractors say it’s too high-level for proper embedded programming, not high-level enough for a modern workflow, is based on old, obsolete chips, doesn’t have the features of modern ARM microcontrollers, and the IDE is a mess. Despite an even less capable IDE, meager memory, and a slow processor, the Basic Stamp proved incredibly popular. The fact that you could pick up a Basic Stamp development kit at any Radio Shack probably didn’t hurt it’s popularity, either.

Now, with our fancy IDEs, mbed microcontrollers, powerful ARMs, and huge libraries, the ease of use of the Basic Stamp has still not been equaled. It may be slow, outdated, but all of us owe a great debt to the Basic Stamp for introducing an entire generation to the world of embedded programming, microcontrollers, and electronics tinkering.


Filed under: classic hacks, Featured, Microcontrollers

Fail of the Week: Exploding Fermentation

พฤ, 08/27/2015 - 22:31

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.”

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.]


Filed under: Fail of the Week, Hackaday Columns

Learning Verilog for FPGAs: Hardware at Last!

พฤ, 08/27/2015 - 21:01

Getting into FPGA design isn’t a monolithic experience. You have to figure out a toolchain, learn how to think in hardware during the design, and translate that into working Verliog. The end goal is getting your work onto an actual piece of hardware, and that’s what this post is all about.

In the previous pair of installments in this series, you built a simple Verilog demonstration consisting of an adder and a few flip flop-based circuits. The simulations work, so now it is time to put the design into a real FPGA and see if it works in the real world. The FPGA board we’ll use is the Lattice iCEstick, an inexpensive ($22) board that fits into a USB socket.

Like most vendors, Lattice lets you download free tools that will work with the iCEstick. I had planned to use them. I didn’t. If you don’t want to hear me rant about the tools, feel free to skip down to the next heading.

Hiccups with Lattice’s Toolchain

Still here? I’m not one of these guys that hates to sign up for accounts. So signing up for a Lattice account didn’t bother me the way it does some people. What did bother me is that I never got the e-mail confirmation and was unable to get to a screen to ask it to resend it. Strike one.

I had tried on the weekend and a few days later I got a note from Lattice saying they knew I’d tried to sign up and they had a problem so I’d have to sign up again. I did, and it worked like I expected. Not convenient, but I know everyone has problems from time to time. If only that were the end of the story.

I was impressed that Lattice does support Linux. I downloaded what appeared to be a tgz file. I say appeared because tar would not touch it. I examined the file and it looked like it was gzipped, so I managed to unzip it to a bare file with a tar extension. There was one problem: the file wasn’t a tar file, it was an executable. Strike two. I made it executable (yes, I’m daring) and I ran it. Sure enough, the Lattice installer came up.

Of course, the installer wants a license key, and that’s another trip to the Web site to share your network card’s MAC address with them. At least it did send me the key back fairly quickly. The install went without incident. Good sign, right?

I went to fire up the new software. It can’t find my network card. A little Internet searching revealed the software will only look for the eth0 card. I don’t have an eth0 card, but I do have an eth3 card. Not good enough. I really hated to redo my udev rules to force an eth0 into the system, so instead I created a fake network card, gave it a MAC and had to go get another license. Strike 3.

I decided to keep soldiering (as opposed to soldering) on. The tool itself wasn’t too bad, although it is really just a simple workflow wrapper around some other tools. I loaded their example Verilog and tried to download it. Oh. The software doesn’t download to the FPGA. That’s another piece of software you have to get from their web site. Does it support Linux? Yes, but it is packaged in an RPM file. Strike 4. Granted, I can manually unpack an RPM or use alien to get a deb file that might work. Of course, that’s assuming it was really an RPM file. Instead, I decided to stop and do what I should have done to start with: use the iCEStorm open source tools.

TL;DR: It was so hard to download, install, and license the tool under Linux that I gave up.

Programming an FPGA Step-by-Step

Whatever tools you use, the workflow for any FPGA is basically the same, although details of the specific tools may vary. Sometimes the names vary a bit, too. Although you write code in Verilog, the FPGA has different blocks (not all vendors call them blocks) that have certain functions and methods they can connect. Not all blocks have to be the same either. For example, some FPGAs have blocks that are essentially look up tables. Suppose you have a look up table with one bit of output and 16 rows. That table could generate any combinatorial logic with 4 inputs and one output. Other blocks on the same FPGA might be set up to be used as memory, DSP calculations, or even clock generation.

Some FPGAs use cells based on multiplexers instead of look up tables, and most combine some combinatorial logic with a configurable flip flop of some kind. The good news is that unless you are trying to squeeze every bit of performance out of an FPGA, you probably don’t care about any of this. You write Verilog and the tools create a bitstream that you download into the FPGA or a configuration device (more on that in a minute).

The general steps to any FPGA development (assuming you’ve already written the Verilog) are:

  • Synthesize – convert Verilog into a simplified logic circuit
  • Map – Identify parts of the synthesized design and map them to the blocks inside the FPGA
  • Place – Allocate specific blocks inside the FPGA for the design
  • Route – Make the connections between blocks required to form the circuits
  • Configure – Send the bitstream to either the FPGA or a configuration device

The place and route step is usually done as one step, because it is like autorouting a PC board. The router may have to move things around to get an efficient routing. Advanced FPGA designers may give hints to the different tools, but for most simple projects, the tools do fine.

Constraints For Hardware Connected to Specific Pins (or: How does it know where the LED is?)

There is one other important point about placing. Did you wonder how the Verilog ports like LED1 would get mapped to the right pins on the FPGA? The place and route step can do that, but it requires you to constrain it. Depending on your tools, there may be many kinds of constraints possible, but the one we are interested in is a way to force the place and route step to put an I/O pin in a certain place. Without that constraint it will randomly assign the I/O, and that won’t work for a ready made PCB like the iCEStick.

For the tools we’ll use, you put your constraints in a PCF file. I made a PCF file that defines all the useful pins on the iCEstick (not many, as many of you noted in earlier comments) and it is available on Github. Until recently, the tools would throw an error if you had something in the PCF file that did not appear in your Verilog. I asked for a change, and got it, but I haven’t updated the PCF file yet. So for now, everything is commented out except the lines you use.

Here’s a few lines from the constraint file:

set_io LED3 97  # red set_io LED4 96  # red set_io LED5 95  # green

Every external pin (including the clock) you plan to use must be defined in the constraint file. Errors in the file can be bad too. Routing an output to a pin that is connected, for example, directly to ground could damage the FPGA, so be careful! The picture to the right shows the configuration with my PCF file (the center LED and the one closest to the FPGA chip just blink and are not marked in the picture). Keep in mind, though, you could reroute signals any way that suited you. That is, just because LED1 in the Verilog is mapped to D1 on the board, doesn’t mean you couldn’t change your mind and route it to one of the pins on the PMOD connector instead. The name wouldn’t change, just the pin number in the PCF file.

Configuring an FPGA

Different FPGAs use different technology bases and that may affect how you program them. But it all starts with a bitstream (just a fancy name for a binary configuration file). For example, some devices have what amounts to nonvolatile memory and you program the chip like you might program an Arduino. Usually, the devices are reprogrammable, but sometimes they aren’t. Besides being simpler, devices with their own memory usually start up faster.

However, many FPGAs use a RAM-like memory structure. That means on each power cycle, something has to load the bitstream into the FPGA. This takes a little time. During development it is common to just load the FPGA directly using, for example, JTAG. However, for deployment a microprocessor or a serial EEPROM may feed the device (the FPGA usually has a special provision for reading the EEPROM).

The FPGA on the iCEstick is a bit odd. It is RAM-based. That means its look up tables and interconnections are lost when you power down. The chip can read an SPI configuration EEPROM or it can be an SPI slave. However, the chip also has a Non Volatile Configuration Memory (NVCM) inside. This serves the same purpose as an external EEPROM but it is only programmable once. Unless you want to dedicate your iCEstick to a single well-tested program, you don’t want to use the NVCM.

The USB interface on the board allows you to program the configuration memory on the iCEstick, so, again, you don’t really care about these details unless you plan to try to build the device into something. But it is still good to understand the workflow: Verilog ➔ bitstream ➔ configuration EEPROM ➔ FPGA.

IceStorm

Since I was frustrated with the official tools, I downloaded the IceStorm tools and the related software. In particular, the tools you need are:

  • Yosys – Synthesizes Verilog
  • Arachne-pnr – Place and Route
  • Icestorm – Several tools to actually work with bitstreams, including downloading to the board; also provides the database Arachne-pnr needs to understand the chip

You should follow the instructions on the IceStorm page to install things. I found some of the tools in my repositories, but they were not new enough, so save time and just do the steps to build the latest copies.

There are four command lines you’ll need to program your design into the iCEstick. I’m assuming you have the file demo.v and you’ve changed the simulation-only numbers back to the proper numbers (we talked about this last time). The arachne-pnr tool generates an ASCII bitstream so there’s an extra step to convert it to a binary bitstream. Here are the four steps:

  • Synthesis: yosys -p "synth_ice40 -blif demo.blif" demo.v
  • Place and route: arachne-pnr -d 1k -p icestick.pcf demo.blif -o demo.txt
  • Convert to binary: icepack demo.txt demo.bin
  • Configure on-board EEPROM: iceprog demo.bin

Simple, right? You do need the icestick.pcf constraint file. All of the files, including the constraint file, the demo.v file, and a script that automates these four steps are on Github. To use the script just enter:

./build.sh demo

This will do all the same steps using demo.v, demo.txt, and so on.

Try It Out

Once the board programs, it will immediately start operating. Remember, this isn’t a program. Once the circuitry is configured it will start doing what you meant it to do (if you are lucky, of course). In the picture below (and the video), you can see my board going through the paces. I have some buttons for the two adder inputs on one side and a reset button on the other. I also soldered some headers to the edge of the board.

If you are lazy, you can just use a switch or a jumper wire to connect the input pins to 3.3V or ground. It looks like the device pins will normally be low if you don’t connect anything to them (but I wouldn’t count on that in a real project). However, I did notice that without a resistor to pull them down (or a switch that positively connected to ground) there was a bit of delay as the pin’s voltage drooped. So in the picture, you’ll see I put the switches to +3.3V and some pull down resistors to ground. The value shouldn’t be critical and I just grabbed some 680 ohm resistors from a nearby breadboard, but that’s way overkill. A 10K would have been smarter and even higher would probably work.

If it works, congratulations! You’ve configured an FPGA using Verilog. There’s still a lot of details to learn, and certainly this is one of the simplest designs ever. However, sometimes just taking that first step into a new technology is the hardest and you’ve already got that behind you.

Although you can do just about anything with an FPGA, it isn’t always the best choice for a given project. Development tends to be harder than microcontroller development (duplicating this project on an Arduino would be trivial, for example). Also, most FPGAs are pretty power hungry (although the one we used is quite low power compared to some). Where FPGAs excel is when you need lots of parallel logic executing at once instead of the serial processing inherent in a CPU.

FPGAs get used a lot in digital signal processing and other number crunching (like Bitcoin mining) because being able to do many tasks all at once is attractive in those applications. Of course, it is possible to build an entire CPU out of an FPGA, and I personally enjoy exploring unusual CPU architectures with FPGAs.

Then again, just because you can make a radio with an IC doesn’t mean there isn’t some entertainment and educational value to building a radio with transistors, tubes, or even a galena crystal. So if you want to make your next robot use an FPGA instead of a CPU, don’t let me talk you out of it.


Filed under: Featured, FPGA

Ubuntu Core Supports Raspberry Pi 2 I/O

พฤ, 08/27/2015 - 18:01

Although it isn’t official, Ubuntu Core–the tiny Internet of Things version of Ubuntu–now runs on the Raspberry Pi 2. There are prebuilt binaries as well as instructions for how to roll your own, if you prefer. You can even access GPIO

Ubuntu Core abandons the old-style Debian packages, in favor of Snap, a new version of the Ubuntu phone’s Click package manager. Snap offers transactional updates. The idea is that all of these “things” on the IoT need to be updated to patch security holes or fix other issues.

As you might expect from an unofficial release, there are some rough edges. However, as you can see in the video below, it is workable,  With all the hype about Windows 10 on the same board, it is a good move to push this release out sooner rather than later. Hopefully, the final release won’t be too far away. The Pi 2 is certainly capable enough, with specs that would shame an average desktop PC not too many years ago.


Filed under: news, Raspberry Pi, slider

Turning A Typewriter Into A Mechanical Keyboard

พฤ, 08/27/2015 - 15:01

Is your keyboard too quiet? Is your Cherry MX Blue board not driving your coworkers crazy enough? If the machine gun fire of a buckling spring keyboard isn’t enough for you, there’s only one solution: [Russell]’s typewriter turned into a mechanical keyboard.

Converting typewriters into keyboards has been done for a very long time; teletypes, the first computer keyboards, were basically typewriters, and the 1970s saw a number of IBM Selectrics converted into a keyboard with serial output. Even in recent years, typewriters have been converted into keyboards with the help of some switches and an ATMega. [Russell]’s mechanical keyboard improves on all of these builds by making the electronic interface dead simple, and a project that can be done by anyone.

Instead of installing switches underneath every key or futzing about with the weird mechanics of a Selectric typewriter, [Russell] is only installing a touch-sensitive position sensor into the frame of the typewriter. When a key is pressed, it strikes a crossbar in the frame of the typewriter. With a single ADC chip and a Raspberry Pi, [Russell] can determine which key was pressed and use that information to output a character to a terminal.

It’s a very simple solution for an electrical interface to a mechanical device, and the project seems to work well enough. [Russell] is using his new keyboard with Vim, even, something you can check out in the video below.


Filed under: classic hacks, peripherals hacks

Hackaday Prize Semifinalist: Haptic Navigation

พฤ, 08/27/2015 - 12:00

For his project entered in the Hackaday Prize, [Neil] is working on a navigation aid for the blind. He’s calling his device Pathfinder, and it’s designed to allow greater freedom of motion for the disabled.

Pathfinder is a relatively simple device, with a cheap, off the shelf ultrasonic distance sensor, an ATMega, and a few passives. On its own, the ultrasonic distance sensor is only accurate to about 5%. By incorporating a temperature sensor, [Neil] was able to nail down the accuracy of his sensor to about 1%. Impressive!

For the machine to human interface, [Neil] chose haptic feedback, or small vibration motors tucked away inside a wristband. It’s by far the easiest way to add the output needed, and with a haptic motor driver, it’s easy to add specialized drive patterns to the vibration motor

You can check out [Neil]’s quarterfinal entry video for the Pathfinder below.

The 2015 Hackaday Prize is sponsored by:


Filed under: The Hackaday Prize

Update: What You See Is What You Laser Cut

พฤ, 08/27/2015 - 09:01

If there’s one thing about laser cutters that makes them a little difficult to use, it’s the fact that it’s hard for a person to interact with them one-on-one without a clunky computer in the middle of everything. Granted, that laser is a little dangerous, but it would be nice if there was a way to use a laser cutter without having to deal with a computer. Luckily, [Anirudh] and team have been working on solving this problem, creating a laser cutter that can interact directly with its user.

The laser cutter is tied to a visual system which watches for a number of cues. As we’ve featured before, this particular laser cutter can “see” pen strokes and will instruct the laser cutter to cut along the pen strokes (once all fingers are away from the cutting area, of course). The update to this system is that now, a user can import a drawing from a smartphone and manipulate it with a set of physical tokens that the camera can watch. One token changes the location of the cut, and the other changes the scale. This extends the functionality of the laser cutter from simply cutting at the location of pen strokes to being able to cut around any user-manipulated image without interacting directly with a computer. Be sure to check out the video after the break for a demonstration of how this works.

This system could be great not only for laser cutters, but for any CNC machine normally controlled by a computer interface. By interacting directly with the project it’s less likely you’ll end up with something that’s just slightly the wrong size or slightly the wrong dimensions. If you’re new to CNC you might want to check out this guide, or maybe you just want to turn your existing CNC machine into a chess robot.


Filed under: cnc hacks, laser hacks, Virtual Reality