Hack a Day

Subscribe to Hack a Day feed Hack a Day
Fresh hacks every day
Updated: 24 min 25 sec ago

Analog Clock Goes Digital, or Vice Versa

Fri, 11/16/2018 - 22:00

Designing a good clock takes a lot of considerations. It’s not just hands, faces, and numbers anymore; there are also word clocks, electronic clocks, marble clocks, or water clocks, and just about anything else imaginable can be used to tell time. Of course, electronic clocks are great for their versatility, and this one shows off an analog-looking clock that is (of course) digital, leveraging all of the perks of analog with all of the upsides of digital electronics.

One of the key design considerations that [Sasa] had while building this piece was that it needed to be silent. LEDs certainly fit that description, so the decision was made to go with an WS2812b ring. It runs using a STM ST32F103 Nucleo board (and a cheaper version of it in later versions of this clock) which shows a red LED for the current hour, yellow LEDs for the traditional analog clock divisions, a green LED for the current minute, and glows the rest of the LEDs up to the current minute with a rainbow pattern.

This is a really clean, simple build with good design at its core, and would be easy to replicate if you’re looking for an eye-catching clock to build. As a bonus, all of the schematics and code are available on the project site, so everything you need is there. If you’re looking for more inspiration, there are some clocks that are even more unique, like this marble clock that is a work of art — but is anything but silent.

Expanding 3D Printer Bed Stays True Under Fire

Fri, 11/16/2018 - 19:00

It’s hard to pass up another lesson in good machine design brought to us by [Mark Rehorst]. This time, [Mark] combats the relentless forces of bed deformation due to thermal expansion.

Did you think your printer stayed the same size when it heated up? Well, think again! According to [Mark’s] calculations, when heated, the bed can expand by as much as half a millimeter in the x/y direction. While x/y deformation seems like something we can ignore, that’s not always true. If our bed is rigidly fixed in place, then that change in dimension will only result in a warped bed as it tries to make space for itself.

Don’t give up yet though. As sinister as this problem may seem, [Mark] introduces a classic-but-well-implemented solution: and adjustable kinematic coupling. The kinematic coupling holds the bed at the minimum number of points to keep it rigid while exposing thumbscrews to dial in a level bed. What’s special about this technique is that the coupling holds the bed perfectly rigid whilst allowing it to thermally expand!

This is the beauty of “exact constraint” design. Parts are held together only by the minimum number of points needed to guarantee a specific relationship. Here that relationship is coplanarity between the the nozzle’s x/y plane and the bed. Even when the bed expands this relationship holds. Now that is magic.

With such a flood of 3D printed parts on the market, building a printer has never been easier! Nevertheless, it’s easy to pin ourselves into a corner re-tuning a poor design that skips a foundation on the base principles. If you’re curious about more of these principles behind 3D printer design, check out [Mark’s] thorough walkthrough on the CoreXY design.

The Kilogramme Will Cease To Be A Physical Entity

Fri, 11/16/2018 - 16:00

One of the most illuminating high school courses no doubt for many readers as much as for your scribe, was the series of physics lessons during which the SI units were explained. That glorious sense of having the order of the universe unlocked into an interlocking series of units whose definitions could all be derived in terms of a series of base units was mind-blowing in those early teen years, and even though the explanations might have been at a for-the-children level that has been blown out of the water by later tiers of learning it’s still a bedrock that will serve an engineer or scientist life-long.

The definitions of the SI base units have evolved with scientific advancement to the point at which they are no longer tied to their original physical entity definitions. Of all the base units though there is still one that has resisted the urge to move away from the physical: the kilogramme (giving it its French spelling to preserve context) is still defined in terms of a metal cylinder in a laboratory just outside Paris. Kg diehards have not much time left to cling onto their platinum-iridium alloy though, for a new definition has been adopted in which it is derived from Planck’s Constant. From next May this will become the official kilogram, at which point concerns over microscopic erosion of the metal standard become irrelevant, and an SI kilogram can be replicated by any laboratory with the means to do so.

The piece of apparatus that makes this definition possible is the Kibble balance, a balance in which the force required to overcome the effect of gravitational force on a given mass is measured in terms of the electrical power required to do so. The gravitational force at a given point can be measured accurately and is defined in terms of the other SI units, while the electrical power can be derived from a Josephson junction, a superconducting junction whose current is defined in terms of Planck’s constant. As a result, the kilogram can be measured solely in terms of the constant and other SI units, consigning the metal cylinder to history.

This high-end metrology and physics make for interesting reading, but it’s fairly obvious that the de facto kilogram we all use will not change. Our everyday measures of everything from sugar to PLA filament will be the same today as they will be next May. But that’s not the point, everyday measurements do not need the extreme accuracy and reproducibility of a laboratory. The point of it all comes in as yet unforseen applications, as an example would the ability to synchronise timing to create GPS or digital radio have been possible were the second to be still defined in terms of astronomical movements rather than atomic states?

Standard kilogramme replica picture: Japs 88 [CC BY-SA 3.0]

DIY Telepresence Robot Built From Off-The-Shelf Parts

Fri, 11/16/2018 - 14:30
Petite, but it does the job. Note the huge LED headlight in the center.

Telepresence hasn’t taken off in a big way just yet; it may take some time for society to adjust to robotic simulacra standing in for humans in face-to-face communications. Regardless, it’s an area of continuous development, and [MakerMan] has weighed in with a tidy DIY build that does the job.

It’s a build that relies on an assemblage of off-the-shelf parts to quickly put together a telepresence robot. Real-time video and audio communications are easily handled by a Huawei smartphone running Skype, set up to automatically answer video calls at all times. The phone is placed onto the robotic chassis using a car cell phone holder, attached to the body with a suction cup. The drive is a typical two-motor skid steer system with rear caster, controlled by a microcontroller connected to the phone.

Operation is simple. The user runs a custom app on a remote phone, which handles video calling of the robot’s phone, and provides touchscreen controls for movement. While the robot is a swift mover, it’s really only sized for tabletop operation — unless you wish to talk to your contact’s feet. However, we can imagine there has to be some charm in driving a pint-sized ‘bot up and down the conference table when Sales and Marketing need to be whipped back into shape.

It’s a build that shows that not everything has to be a 12-month process of research and development and integration. Sometimes, you can hit all the right notes by cleverly lacing together a few of the right eBay modules. Getting remote video right can be hard, too – as we’ve seen before.

FPGA Testbenches Made Easier

Fri, 11/16/2018 - 13:01

You finally finish writing the Verilog for that amazing new DSP function that will revolutionize human society and make you rich. Does it work? Your first instinct, of course, is to blow it into your FPGA of choice and see if it works. If it does, that was a great idea. If it doesn’t, it was a terrible idea because — typically — it is hard to look inside the FPGA. That’s why you’ll typical simulate your logic on a desktop computer before you commit it to the FPGA. But that means you have to delay gratification long enough to write a testbench — a piece of hardware description language (HDL) code that exercises the function you wrote. In this post I’ll show you a small piece of software that can read your Verilog module and automatically create most of a testbench for you. The code originally came from GitHub, but I wanted to make some changes to it, so I forked it and I’ll tell you about the changes I made. This isn’t specific to a particular FPGA. Any Verilog project can use the tool to generate a simple starter testbench.

Writing a testbench isn’t that hard. You usually use the same language you wrote the original code in but since it won’t reside in silicon, you can do things in the simulator that you can’t get away with in code that you’ll synthesize. However, it is a bit painful to have to always write more or less the same code, especially if you have a lot of modules you want to test. But it is a good idea to test small modules before linking them together and then test them linked together, too. With this little Python script, it is very easy to generate a simple testbench and then further elaborate it. It isn’t life-changing, but it does save some time. If you want to try this out, you’ll need something to run the Python script on, of course. You also need a Verilog simulator or you can use EDA Playground to try all this out in your browser.

Anatomy of a Testbench

A Verilog testbench usually had a few major sections:

  1. A module with no inputs or outputs. This is like the main function of a C program.
  2. Reg variables for all the inputs you want to feed to the device or devices under test.
  3. Wire variables for all the outputs you want to monitor for the device or devices under test.
  4. An initial section that initializes all the reg variables.
  5. Since the device under test probably needs a clock, an always block or a forever loop will create the clock in one of the reg variables.
  6. Since the device under test probably needs a reset, you’ll frequently start out by generating a reset.
  7. You’ll want to send some special commands to the Verilog simulator to ask it to monitor certain signals and record them to a file. You can also just print things like a pass/fail message, but usually you want a file with the signal tracing.
  8. You’ll then send the device under test whatever input vectors you want placing an appropriate time delay between signal transitions.

There are two features of the Verilog simulator that make this work. First, you have a timescale statement at the start of the testbench that tells the simulator what each “tick” represents and how precise the tick is. For example, you might have `timescale 1ns/100ps which means that a delay of 1 means 1 nanosecond with sufficient resolution for 1.1 and 1.2 nanosecond delays. Contrast that to `timescale 1ns/1ns which only has 1 ns resolution. If you wrote 1, 1.1, and 1.2 nanosecond delays, they would be rounded to be the same 1 ns delay. Of course, delays aren’t something you can use in code that targets the FPGA, but in the simulation, they are fair game.

So, for example, if you wanted to assert a signal for 5 nanoseconds (given the above timescale) you might write:

reg thesignal=0; ... thesignal=1'b1; #5 thesignal=1'b0;

An Example Testbench

Armed with all this, let’s jump into a simple test bench. The device under test doesn’t matter, although it is the example on GitHub, if you are curious. I’m going to break it up into pieces:

`timescale 1ns/1ns //Adjust to suit module tb_top;

This is the timescale and the module with no I/O. The next section covers the input and output variables for the device under test.

reg clk ; reg rst ; reg run ; reg hold ; wire LED1 ; wire LED2 ; wire LED3 ; wire LED4 ;

Here’s where you create the module you want to test. UUT stands for Unit Under Test.

top uut ( .clk ( clk ), .rst ( rst ), .run ( run ), .hold ( hold ), .LED1 ( LED1 ), .LED2 ( LED2 ), .LED3 ( LED3 ), .LED4 ( LED4 ) );

The period of the clock will be 10 nanoseconds.

parameter PERIOD = 10; //adjust for your timescale

This section of code will set the output file, set what we want to look at, and generate the clock. The $dumpvars statement tells the simulator to start at tb_top (this module) and do as far as the next layer in the hierarchy.

initial begin $dumpfile("tb_output.vcd"); $dumpvars(2, tb_top); clk = 1'b0; #(PERIOD/2); forever #(PERIOD/2) clk = ~clk; end

I usually use an always block to generate the clock, but a forever loop like this works too. You just can’t put anything after it except the end since the loop never exits. But as you can see below, it works fine.

This little snippet handles the reset signal. Note that the reset signal is negative you only have to change the first zero.

initial begin rst=1'b0; #(PERIOD*2) rst=~rst; #PERIOD rst=~rst; end

Finally, we initialize the device inputs, wait a bit for the reset to settle, and then give it some test inputs. After waiting a bit, we call $finish to stop the whole thing.

initial begin run=1'b0; hold=1'b0; #(PERIOD*10) run=1'b1; #PERIOD run=1'b0; #(PERIOD*1024) hold=1'b1; #PERIOD hold=1'b0; #(PERIOD*100) $finish; end endmodule Automation

The original Python program I found on GitHub did most of this. However, a lot of things were hardcoded and although it detected the reset signal, it didn’t do anything with it. What’s more, it not only didn’t exercise reset, but it also didn’t do any of the test signals for you, which is understandable. However, if you made a change to the file and then wanted to regenerate the test bench (perhaps your module changed its inputs and outputs) you’d lose your changes!

I forked the code and changed it to run with Python 3, added command line options to it, and then made some changes to pulse reset. To handle your addition, the testbench includes a file that you can use to write your own test code. That way regenerating the test bench won’t clobber your code.

These are all simple changes, but they pay off. If you use no options, you get sensible defaults. However, you can specify any or all of the following:

  • -d – Set custom dumpfile name
  • -i – Set custom user include file
  • -l – Set dumpvars level
  • -p – Set period
  • -r – Make reset active low
  • -t – Set timescale

So in the above example, the final initial block would wind up in the user include file since the script didn’t generate it. All the rest of it was the automatic output from the tool.

Try It

There’s an example module, top.v, included in my fork of the project. Actually, you’ll see this again in a future post about embedding logic analyzers, but for now, I reduced the timing delays to make it easier to simulate. This isn’t uncommon since a one-second delay at 12 MHz takes 12 million clock cycles.

The defaults for this are just fine so issue a command like:

./tbgen.py top.v tb_top.v

Of course, you don’t need the ./ if the executable is on your path. Now you need to simulate the tb_top.v file. I’ve already provided the user include (user.tb_top.v), but if you were starting from scratch you’d have to create that file even if it were empty. This is the file that holds your specific tests to carry out.

If you use Icarus, your simulation might look like this:

iverilog tb_top.v top.v -o tb_top vvp tb_top gtkwave tb_output.vcd

If you don’t want to install anything, you can try EDA Playground. Just put the testbench file in the left-hand pane and the top module in the right-hand pane. You’ll need to either paste the user include file in over the include statement or create a new test bench tab and put it there. I’ve already done that for you, if you want a peek.

What’s it Worth?

Like most tools, this works best if you know how to not use the tool. Despite being handy, you still need to understand a few things about testbenches to make it work. On the other hand, it is a nice timesaver to not have to create the same code over and over for multiple modules. It also makes your test code a bit more consistent. If you don’t like the generated code, it is pretty easy to make changes even if you aren’t a Python wizard. I thought about changing the code to work from a template file, but it was fine like it is. However, not being one to leave well enough alone, I have a version that reads from a template file in the template branch on GitHub if you want to try it.

You might argue that you don’t want to simulate your Verilog and, instead, you’d rather put a logic analyzer on board and debug on the actual hardware. That sounds great in theory and I’ll actually show you how to do that in a future post. But there are problems. You generally can’t get everything in a logic analyzer unless your design is very simple. Reconfiguration can be a long process and you don’t always have the ability to set up the exact stimulus you need. Simulation is sort of a “God Mode” where you can make anything happen and see everything. Of course, simulation has its own problems, especially behavioral simulation where you aren’t accounting for real timing delays and things like that. So I’d argue that while onboard logic analyzers are a great tool, it isn’t a replacement for simulation just as simulation can’t completely replace live debugging.

Meanwhile, using this tool can help you create your testbenches. Reading its generated code can help you learn how to create your own even if you don’t want to use the tool in every case.

Turning A Rotary Tool Into A CNC

Fri, 11/16/2018 - 11:30

Now that 3D printers are everywhere, electronics are cheap, and open source software is extremely capable, just about anyone can build a CNC machine. That’s exactly what [Nikodem] did by turning a Dremel tool into an extremely capable CNC machine that’s able to cut MDF and acrylic and can engrave aluminum.

The electronics for the build are just an Arduino Uno, a motor driver sheld running GRBL, a relay for the Dremel, a few motor drivers, and a big ‘ol 30 A power supply. The build uses NEMA 17 motors, two on the Y-axis and one each on the X and Z. The CNC has a fantastically strong frame despite the 3D printed parts. It is constructed out of aluminum extrusion, with the carriages riding on some nice straight rods.

As for how well this CNC machine works, it’s pretty good. With the Gcode to cut an 80mm diameter circle out of MDF, this machine managed to cut a circle that was 80.02 mm in diameter. That’s pretty good, and getting into the territory that the error is probably in the cheap set of calipers, not the finished part itself. It’s an awesome build, and [Nikodem] has everything documented in his four-part video series. You can check the end of that out below.

Supercon: Designing Your Own Diffractive Optics

Fri, 11/16/2018 - 10:00

Kelly Peng is an electrical and optical engineer, and founder of Kura AR. She’s built a fusion reactor, a Raman spectrometer, a DIY structured light camera, a linear particle accelerator, and emotional classifiers for likes and dislikes. In short, we have someone who can do anything, and she came in to talk about one of the dark arts (pun obviously intended): optics.

The entire idea of Kura AR is to build an immersive augmented reality experience, and when it comes to AR glasses, there are two ways of doing it. You could go the Google Glass route and use a small OLED and lenses, but these displays aren’t very bright. Alternatively, you could use a diffractive waveguide, like the Hololens. This is a lot more difficult to manufacture, but the payoff will be a much larger field of view and a much more immersive experience.

The lens that Kelly is using in her AR headset is basically a diffraction grating, or a series of parallel lines on a piece of plastic. These diffraction gratings reflect light, but it’s dependent on the wavelength. Therefore, for a full-color system, you need three layers, one for red, one for blue, and another for green. The trick here is how to manufacture this. Kelly took a Hololens lens apart and took a look at it with an electron microscope, which appears to be made via fancy, and expensive, photolithography.

There is another way, though. The feature sizes on this diffraction grating aren’t too small, and this could conceivably be done through injection molding. With a lot of coding, simulation, and testing, Kelly realized this was manufacturable with somewhat standard injection molding processes, would cost only about $60,000 upfront, and would produce a part for one dollar. That’s much better than whatever process is going into the Hololens, and an amazing technical feat that’s bring the future of AR closer than ever before.

This talk gets deep into diffractive optics. It’s jam-packed with the kind of technical detail you’ll need to know if you’re going to hack together your own AR / VR system. In short, it’s the kind of real-world technical talk that we love. Sit back with some popcorn and your notepad.

The HackadayPrize2018 is Sponsored by:





Delta Bot Plucks Out Tunes on a Mandolin

Fri, 11/16/2018 - 07:00

Is there no occupation safe from the scourge of robotic replacement? First it was the automobile assemblers, then fast food workers, and now it’s the — mandolin players?

Probably not, unless [Clayton Darwin]’s mandolin playing pluck-bot has anything to say about it. The pick-wielding delta-ish robot can be seen in action in the video below, plucking out the iconic opening measures of that 70s prom-theme favorite, “Colour My World.” The robot consists of two stepper motors connected to a hinged wooden arm by two pushrods. We had to slow the video down to catch the motion, but it looks like [Clayton] has worked out the kinematics so that the pick can be positioned in front of any of the mandolin’s eight strings. A quick move of the lower stepper then flicks the pick across a string and plucks it. [Clayton] goes into some detail about how he built the motion-control part in an earlier video; he also proves that steppers are better musicians than we’ll ever be with a little “Axel F” break.

It’s only a beginning, of course, but the complexity of the kinematics just goes to show how simple playing an instrument isn’t. Unless, of course, you unleash an endless waterfall of marbles on the problem.

Thanks for the tip, [baldpower].

Smooth Moves from Cheap Motors

Fri, 11/16/2018 - 04:00

Building an electric motor isn’t hard or technically challenging, but these motors have very little in the way of control. A stepper motor is usually employed in applications that need precision, but adding this feature to a motor adds complexity and therefore cost. There is a small $3 stepper motor available, but the downside to this motor is that it’s not exactly the Cadillac of motors, nor was it intended to be. With some coaxing, though, [T-Kuhn] was able to get a lot out of this small, cheap motor.

To test out the motors, [T-Kuhn] built a small robotic arm. He began by programming his own pulse generating algorithm that mimics a sine wave in order to smooth out the movement of the motor. An Arduino isn’t fast enough to do these computations, though, so he upgraded to using the ESP32. He also was able to implement the inverse kinematics on his own. The result of all this work for a specific platform and motor type is a robotic arm that has a very low cost but delivers performance of much more expensive hardware.

The robot arm was built by [T-Kuhn] too, and all of the details on that build, as well as all the schematics and code, are available on the project site if you need a low-cost robot arm or a good stepper motor controller for a low cost. There are many other ways of getting the most out of other types of low-cost motors as well.

How’s a Gyro Work?

Fri, 11/16/2018 - 01:00

It wasn’t long ago that a gyro — or gyroscope — was an exotic piece of electronics gear. Most of us only saw them as children’s toys that would balance on your finger. That’s changed, though, thanks to microelectronics. Now your game controller, your phone, and your drone all probably use little ICs that are actually three-axis gyroscopes. Ever wonder how they work and what they do? [RCModelReviews] has a video that covers three kinds of gyros: old mechanical gyros, modern MEMS gyros, and even an exotic laser-based gyro. (YouTube, embedded below.)

Gyroscopes allow you to detect orientation by detecting linear forces on a rotating element. They are used in everything from spacecraft to submarines. The device has many origins dating back to antiquity. But the modern gyro showed up around 1800 or so. The children’s toy appeared in 1917 and is still made today.

Gyroscopes combined with accelerometers can give you a lot of information about a vehicle’s orientation and motion. Combine it with magnetic field sensors and you can even tell your absolute orientation in the Earth’s magnetic field.

Of course, given the source, the video talks mostly about how gyros have changed flying RC vehicles including quadcopters and helicopters. If you ever wondered how they got a spinning disk into those little MEMS gyros, this video will fill you in.

Hard to imagine, but having a gyro in your phone could be a security risk. If you want to see what a $15,000 gyro from the 1960s looked like, you can see that in an earlier post.

Magnets and Printed Parts Make Quick-Disconnect Terminals

Thu, 11/15/2018 - 22:00

The Apple MagSafe power connector is long gone from their product line, but that doesn’t mean that magnetic connectors aren’t without their charms. It just takes the right application, and finding one might be easier with these homebrew magnetic connectors.

We’ll admit that the application that [Wesley Lee] found for his magnetic connectors is perhaps a little odd. He’s building something called Linobyte, a hybrid art and electronics project that pays homage to computing history with very high-style, interactive core memory modules. The connectors are for the sense wire that is weaved through the eight toroids on each module, to program it with a single byte. Each connector has a 3D-printed boot that holds a small, gold-plated neodymium magnet with the sense wire soldered to it. A socket holds another magnet to the underside of a PCB. The magnet in the boot sticks to the PCB and makes contact with pads, completing the circuit. We know what you’re thinking: heating a magnet past the Curie point is a great way to ruin it. [Wesley] admits that happens, but it just makes the connection a little weaker, which works for his application. The short video below shows how he puts them together.

We can think of a couple of ways these connectors would be useful, and we really like the look of the whole project. It’ll be interesting to see where it goes, but in the meantime, brushing up on how magnets work could be fun.

[via r/electronics]

Measuring The Cooling Effect Of Transformer Oil

Thu, 11/15/2018 - 19:00

Transformer oil has long served two purposes, cooling and insulating. The large, steel encased transformers we see connected to the electrical grid are filled with transformer oil which is circulated through radiator fins for dumping heat to the surrounding air. In the hacker world, we use transformer oil for cooling RF dummy loads and insulating high voltage components. [GreatScott] decided to do some tests of his own to see just how good it is for cooling circuits.

He started with testing canola oil but found that it breaks down from contact with air and becomes rancid. So he purchased some transformer oil. First, testing its suitability for submerging circuits, he found that he couldn’t see any current above his meter’s 0.0 μA limit when applying 15 V no matter how close together he brought his contacts. At 1 cm he got around 2 μA with 230 VAC, likely from parasitic capacitance, for a resistance of 115 Mohm/cm.

Moving on to thermal testing, he purchased a 4.7 ohm, 100 watt, heatsink encased resistor and attached a temperature probe to it with Kapton tape. Submerging it in transformer oil and applying 25 watts through it continuously, he measured a temperature of 46.8°C after seven minutes. The same test with distilled water reached 35.3°C. Water’s heat capacity is 4187 J/kg∙K, not surprisingly much better than the transformer oil’s 2090 J/kg∙K which in turn is twice as good as air’s 1005 J/kg∙K.

He performed a few more experiments but we’ll leave those to his video below.

We’ve run across a number of tests running boards submerged in various oils before. For example, we’ve seen Raspberry Pi’s running in vegetable oil and mineral oil as well as an Arduino running in a non-conductive liquid coolant, all either overclocked or under heavy load.

Foam Airboat is Cheap RC Fun

Thu, 11/15/2018 - 16:00

Archer fans and residents of Louisiana will already be familiar with the concept of the airboat. Put a powerful engine running an aircraft prop on a flat-bottomed hull, and you’ve got an excellent way to traverse the marshes of the American South. While a fully-fledged airboat might run you the best part of $100,000, this no-frills radio-controlled version is great fun at a much lower price.

The hull is built on a sheet of foam, which is cheap, readily available, and suitably buoyant for the task. It’s then kitted out with a brushless motor to run the prop and a servo to control the rudder. Lace it up with a radio receiver and speed controller and you’re good to go.

The build could readily be completed in well under a couple of hours, and is a great one to tackle with kids due to its mechanical simplicity. There’s room for extra creativity too – you can always substitute a watermelon if you’re feeling peckish. Video after the break.

Researchers Seek to Create the Digital Smell Interface

Thu, 11/15/2018 - 14:30

We hear digital audio, we see digital video, and we feel digital haptic feedback. However, we don’t have an analog for the sense of smell. [Kasun] and his team of researchers from the Imagineering Institute in Malaysia are in the midst of changing that reality. Their project aims to transmit fragrances via electronic stimulation. Though it’s really more of a step toward creating a multi-sensory internet.

The team’s “electric smell machine” consists of a variable power supply connected to silver electrodes wrapped around an endoscopic camera. The camera is necessary to ensure contact with the user’s olfactory bulb as electric current pulses through the electrodes. The current values vary based upon the scent being replicated and are in the 0.2mA neighborhood. Early trials of the machine have revealed that around one-quarter of test subjects are able to identify the smells being replicated. They reported smells being fruity, sweet, and woody though all had a chemical-like odor attached.

The concept of “smell-o-vision” is not a new one, as it has been around longer than motion pictures with sound. Previous attempts at accompanying film and television with scent have been a result of chemical reactions. Devices from these types of experiments typically involved cartridges that would need to be replaced when the chemical substances were depleted. [Kasun]’s team approach is to avoid the chemical approach in favor of directly stimulating the olfactory receptors. Those interested in the gritty details can read the research paper on digitizing smell.

[Kasun] and his team uploaded a video on the project that you can view below. It’s all a work in progress at this point, but sign me up for a trial when they pinpoint the true essence of new car smell.

Of course if you were hoping to outsource some of the “not so great” smells in your life to the cloud, there’s this feature on using IOT devices to sniff out spoiled foods.

An In-Depth Look at Dexter, the Robotic Arm

Thu, 11/15/2018 - 13:01

Dexter, a really great robot arm project, just won top honors in the 2018 Hackaday Prize, and walked away with $50,000 toward continuing their project. As a hat tip to Hackaday and the community, Haddington Dynamics, the company behind Dexter, agreed to open-source their newest version of Dexter as well. As James Newton said when accepting the trophy during the award ceremony, “because of your faith in us, because of this award, we have been moved to open-source the next generation of Dexter.” Some very clever work went into producing Dexter, and we can’t wait to see what further refinements have been made!

Dexter isn’t the only robotic arm in town, by any means. But in terms of hobbyist-level robotics, it’s by far the most complete robot arm that we’ve seen, and it includes a couple of design features that make both its positional accuracy and overall usability stand out above the rest. This is a robot arm with many of the bells and whistles of a hundred-thousand dollar robot, but on a couple-thousand dollar budget.

Moreover, many of the design innovations can be taken piecemeal and used in your own project. For instance, our judges particularly liked Dexter’s clever encoder design. Optical encoders usually use a disk with holes in it; shine a light through the disk onto a sensor and you can determine the position by counting the number of resulting pulses.

Dexter takes this a step further, using the analog value of the light sensor, allowing it to track a few thousand positions per hole, multiplying the usable resolution. This means that, with a 3D printed encoder wheel and some serious math to transform this into a position, Dexter’s encoder can resolve over a million positions per revolution. That’s mind-blowing precision, and it’s available relatively cheaply due to advances in computing power.

Specifically, an FPGA and some custom “gateware” logic code runs the conversion of encoder data to arm position. That’s right, they’re dedicating an embedded Linux computer with FPGA peripherals doing the heavy lifting to calculate two joints’ position. You might think that this is overkill, but with an arm like this any small angular error in the first joint that sits on the table is multiplied by the reach of the arm. You want positional accuracy of 0.1 mm at the end of a half-meter arm, you’re looking at 0.01 degree angular resolution. Getting that resolution with a 3D-printed encoder wheel and some heavy computation is a great innovation.

Combine such detailed positional feedback with some good software and you can design an arm that’s both compliant, strong, and easily trainable just by moving it around. Dexter uses harmonic drives for some of the axes, and while you don’t normally want to force a harmonic drive, the extreme resolution of the positional sensor lets the robot know when it’s being pushed out of position and either apply more force to hold position, or drive the motors in the direction of the motion if it’s trying to learn a new move. This makes for easy training, much in the style of Baxter, the robot that has obviously inspired Dexter, but costs significantly more and isn’t open source.

At the pointy end of the stick, Dexter has an expandable set of end effectors connected by a simple 3D-printed locking-collar-and-pogo-pin arrangement. Whether you need a vacuum, scissors, or a gripper at the end of your robot arm, Dexter has you covered.

If there’s one flaw in Dexter, it’s that the FPGA code to run the encoders was written in a proprietary hardware description language, Viva. So while the Dexter folks can provide us with a bitstream to flash into our own FPGAs, we can’t tweak the encoders’ algorithms. That’s a shame, but Haddington Dynamics’ position is that they can’t afford to re-engineer the FPGA code in order to become fully open source.

In the end, though, Dexter is significantly more than the sum of its parts. Haddington Dynamics has applied what our judge Quinn Dunki called “true hacker spirit” to making the build more affordable wherever possible, but still retaining high quality. If you’re at all interested in building a robot arm, there are a ton of lessons to learn here, and if you need a high-class solution on a hacker’s budget, this is where we’d start. We can’t wait to see what’s been updated in the newest version!

Congratulations, Dexter and Haddington Dynamics!

The HackadayPrize2018 is Sponsored by:





Adding Linux To A PDP-11

Thu, 11/15/2018 - 11:30

The UNIBUS architecture for DEC’s PDPs and Vaxxen was a stroke of genius. If you wanted more memory in your minicomputer, just add another card. Need a drive? Plug it into the backplane. Of course, with all those weird cards, these old UNIBUS PDPs are hard to keep running. The UniBone is the solution to this problem. It puts Linux on a UNIBUS bridge, allowing this card to serve as a memory emulator, a test console, a disk emulator, or any other hardware you can think of.

The key to this build is the BeagleBone, everyone’s second-favorite single board computer that has one feature the other one doesn’t: PRUs, or a programmable real-time unit, that allows you to blink a lot of pins very, very fast. We’ve seen the BeagleBone be used as Linux in a terminal, as the rest of the computer for an old PDP-10 front panel and as the front end for a PDP-11/03.

In this build, the Beaglebone’s PRU takes care of interfacing to the UNIBUS backplane, sending everything to a device emulator running as an application. The UniBone can be configured as memory or something boring, but one of these can emulate four RL02 drives, giving a PDP-11 an amazing forty megabytes of storage. The real killer app of this implementation is giving these emulated drives a full complement of glowing buttons for load, ready, fault, and write protect, just like the front of a real RL02 drive. This panel is controlled over the I2C bus on the Beaglebone, and it’s a work of art. Of course, emulating the drive means you can’t use it as the world’s largest thumb drive, but that’s a small price to pay for saving these old computers.

Choosing Cell Modems: The Drama Queen of Hardware Design

Thu, 11/15/2018 - 10:01

So you went to a tradeshow and heard about this cool new idea called the Internet Of Things; now it’s time to build an IoT product of your own. You know that to be IoT, your Widget D’lux® has to have a network connection but which to choose?

You could use WiFi or Bluetooth but that would be gauche. Maybe LoRaWAN? All the cool kids are using LoRa for medium or long range wireless these days, but that still requires a base station and Widget D’lux® will be a worldwide phenomenon. Or at least a phenomenon past your bedroom walls. And you know how much user’s hate setting things up. So a cell modem it is! But what do you have to do to legally include one in your product? Well that’s a little complicated.

We’ve talked about government certification testing before (seriously, go read that article. Bob did a great job!) and it’s entirely relevant here but cell modems add a couple layers to that onion. There are a bunch of entry points to this discussion so let’s pick one and dive in.

Certification: Intentional, Unintentional, Multiple

So what kind of government certification will you need before you can ship your product? There are a few. If you plan to turn your cell radio on the entire device will need to be certified for intentional radiation to make sure that the radios you intend to use are well-behaved (don’t emit too much energy for given frequency bands). If you plan to turn on Widget D’lux® at all than it will also need to be checked for unintentional emissions to make sure there isn’t too much electromagnetic energy you didn’t mean to transmit. If you want to add another radio like Bluetooth or WiFi there’s also multi-radiator certification to look for problems caused by multiple radios operating at once.

Fortunately there are some tricks which might make that process easier. Testing and certification for multiple radiators is only relevant when more than one is on at once. Maybe the application can be adjusted so that you don’t actually need, say, Bluetooth at the same time as the cell connection? Or only turn the WiFi radio on when the cell signal falls below a certain strength and the radio is subsequently disabled? As long as there’s only ever one transmitter on at a time then you shouldn’t need to pursue additional certification. Though if there is ever a case where they can both be on at once it needs to be appropriately certified.

An even more specific exception is using WiFi to gather access ESSID’s and MACs to help with geolocation. Actively scanning for APs might be faster but if you stick to a passive scan the WiFi radio never transmits. No extra certification required.

Alternatively some modular certifications (we’ll get to that in a moment) allow you to avoid dual radiator certification if antennas of different radiators are placed far enough apart (here’s an example with a 20cm separation). Specific information about this may be in a given device’s FCC grant like that one.

There is also an entire list of device types which are exempt from certain types of emissions tests. For instance certain kinds of appliances and automotive devices don’t require testing. Though if they have intentional radiators they must still comply with those the relevant laws. So devices like underglow for your very classy body kit probably don’t need to be tested so long as there isn’t a Bluetooth app for configuration.

We won’t go into more detail about how these tests are performed. Again, refer to Bob’s article on FCC testing for more detailed information.

Cell Specific Certification: PTRCB

Ok! If that’s not enough for you there are a couple more cellular-specific certifications you’ll need too: PTRCB and/or carrier certification. The FCCs job is to make sure that your device plays nicely with everyone else’s and the airwaves are generally available to be shared. They do not care whether or not your device actually works (though they do care if it breaks due to ESD sensitivity!). The cell carriers on the other hand need to make sure that your device obeys their network specifications so that you don’t cause a general degradation of service.

Thanks Cetecom

The end goal here is really carrier certification, which means that the certified device has been tested to work with the specific blend of herbs and spices that, say, Verizon requires. A carrier certification is specific to that network though for many carriers (in the US, AT&T, T-Mobile, and Sprint) getting this certification is actually a superset of the testing done to specifications from a body called the PTRCB. Surprise! The PTRCB was founded by a consortium of carriers to help test and regulate cell devices.

Whew! Still excited to bring Widget D’lux® to the hungry masses? No? But we haven’t even talked about cost and time (tens of thousands of dollars and up to tens of weeks)! Do I hear you begging for an easier answer? That doesn’t sound like much fun, but I guess we can explore other options.

The magic words are “modular certification.” Cell modems come in all shapes and sizes, from raw modems and RF components through development kits designed to plug into a breadboard. In the middle there is a sweet spot where cell modems are available as modules which are designed to be permanently installed in an end device. In their most complete form such modules include all RF related hardware.

For all the certification content above except unintentional radiation modules can be variously approved for modular end device use. Sorry, that’s still a messy description. Electrically, components can be FCC tested and certified for use as intentional and unintentional radiators inside other products AKA “for modular use”. As long as you obey the conditions of the FCC certification grant, like not placing another intentional radiator too close, the certification carries through to the end device. Modules can be similarly carrier tested for end device use. So sticking to very certified modules get you most of the way to a shippable device.

Integrating a Cell Modem into a Product

There are a few ways to integrate a cell modem and fortunately they don’t all have the same regulatory burden.

The board is called “bird brain” Devkits and Bailing Wire

For prototyping and very low volume products gluing a development kit to the rest of a system might be enough to get a system out the door. There are a few options in this space, with Particle’s Electron being probably the best known. This is probably a fine option when starting out but often more consumer/prototype oriented development kits won’t be available in quantity from suppliers, may not be as robust for long term installation, and may not be certified appropriately for use in a commercial device. But that doesn’t mean they’re impossible to use.

As Make noticed the first generation scooters retrofitted by Bird (currently valued at over $2 billion) contain, amazingly, a Particle Electron on their mainboard at the top of the scooter! From the photo it looks like it’s USB and JST battery connector have been removed and the entire daughterboard may be soldered down into the scooter. But hey, I guess a shipping product is the most important thing!

Module Down

There’s a lot of other text in this article but the one liner explanation of the easiest way to integrate a cell modem into a product is “use a module.” As mentioned above modems are sold packaged with many/most of their RF bits as modules. Whether they use through holes, castellations, or a nasty land grid array, these are designed to be permanently installed in an end product. If you choose one that has the correct certifications (AKA all of the certifications), dropping in a module is the fastest practical way to go to market, though prices will probably be higher than sourcing a bare modem.

What’s inside the module? It depends. Some are just a modem with support circuitry and a standardized mounting pattern. Others include another microcontroller and might be capable enough to be the main application processor for your system. There are a few other handy benefits for going the modular route:

  • If a vendor has a standardized pin arrangement, using a module may offer an upgrade pathway in the future as cell technologies change. This is a headline feature of MultiTech and Digi modules.
  • If a module adds another micro they may also add a nice wrapper around the raw AT commands that the modem probably speaks. This might make it easier to open TLS wrapped sockets, send text messages, etc. Modules from Particle and Digi both offer this.
  • Carriers will require that modems be kept up to date or they’ll kick you off their network. Modules with onboard microcontrollers may be able to update themselves with little to no intervention on the developer’s part.
  • Some vendors (Particle being a prime example) offer varying levels of cloud infrastructure which may make it easy to quickly get an application setup.

A selection of common module vendors are Particle (they have non devkit options too), Digi, MultiTech, NimbeLink, and Link Labs.

Modem Down

The companies which make and sell cell modems will happily sell them for use in end devices (what do you think is inside the modules?). But by buying a Telit or a u-blox or a Sierra module and dropping it on a board you’ll need to go through most of the arduous certification process. These vendors know how rough that process is and will help you figure out what tests to perform and who to talk to, but it will still be a costly and time consuming process. This complexity is why modular products exist in the first place; it’s is so difficult it’s a complete business.

All that aside using a modem directly will be cheaper than a module and the size can be minimized/customized to your application.

Chip Down

If you were building a very high volume product and really needed unusual features or the lowest possible cost, you could piece together the cell modem yourself. This is by far the most expensive, time consuming, and complex option. All certification would be required.

To Learn More

If you’re doing this for real it should be obvious by now that you’ll need to ask for some help. Expert help. One option is to hire a consultant. But another is to talk to a test lab. Not all labs will be amenable to being a living/breathing FAQ but some will. I’ve found that it’s a good sign when a lab is willing to be helpful, perhaps a useful trait to consider when choosing who to do business with. In the Bay Area there are lots of options. In no particular order I’ve known people to work with TÜV Rheinland, NTS (they had pizza and soda for customers, a big plus), Bay Area Compliance Labs, MET labs, and Cetecom. Ideally the lab you work with will also be the one you certify with.

Ready to bring Widget D’lux® to life? No? You want to go back to ESP8266’s and breadboards in a shoebox? That’s ok, maybe the world doesn’t need another IoT thermometer with targeted advertising.

Note: If it’s not obvious, this should be taken as advice of the casual kind. This is a trail of breadcrumbs leading to larger knowledge… but don’t launch a product based solely on what you read here.

Cyborg Mushrooms

Thu, 11/15/2018 - 07:00

Of all the fictional cyborgs who turn against humanity to conquer the planet, this is as far from that possibility as you can get. These harmless mushrooms seem more interested in showing off their excellent fashion sense with a daring juxtaposition of hard grid lines with playful spirals. But the purpose of this bacteria-fungus-technology hybrid is to generate electricity. The mushrooms are there to play nurse to a layer of cyanobacteria, the green gel in the photo, while the straight black lines harvest electricity.

Cyanobacteria do not live very long under these kinds of conditions, so long-term use is out of the question, but by giving the cyanobacteria somewhere it can thrive, the usefulness grows. The interplay between bacterial and supportive organics could lead to advances in sensors and hydrogels as well. At some point, we may grow some of our hardware and a green thumb will be as useful as a degree in computer science.

Hydrogels could be the next medical revolution, and we’ve already made hydrogels into tattoos, used them as forms for artificial muscles, and hydrogels can be a part of soft tissue printing.

The Smaller, More Powerful Raspberry Pi 3 Model A+

Thu, 11/15/2018 - 04:01

It’s that time of year again, and the Raspberry Pi Foundation has some new hardware for you. This time, it’s an improved version of the Raspberry Pi Model A, bringing it the speed and power of its bigger brother, the Raspberry Pi Model 3 B+.

The Raspberry Pi Model A is the weird middle child of the Raspberry Pi lineup, or maybe it’s the Goldilocks choice. It’s not as powerful and doesn’t have the USB ports or Ethernet jack found in the latest revision of the family, the Raspberry Pi Model 3 B+, and it’s not as small or as cheap as the Raspberry Pi Zero W. If you’re running a Pi as just something that takes in power and spits out data on the GPIO pins, the Model A might be all you need.

The full specs include:

  • Broadcom BCM2837B0 Cortex A-53 running at 1.4GHz
  • 512 MB of LPDDR2 SRAM
  • 2.4 GHz and 5 GHz 802.11 b/g/n/ac wireless LAN, Bluetooth 4.2/BLE
  • Full size HDMI
  • MIPI DSI display port / CSI camera port
  • Stereo Output and composite video port

In short, we’re looking at a cut-down version of the Raspberry Pi Model 3 B+ released earlier this year, without an Ethernet port and only one USB port. The wireless chipset is hidden under a lovely embossed can, and until we get our hands on this new model and a pair of pliers, we’re assuming this is a CYW43455, the Cypress chipset found in the Pi 3 B+.

The price of the Raspberry Pi 3 Model A+ will be $25 USD, with availability soon at the usual retailers. Since there’s no such thing as a Pi Zero 3 yet, if you’re looking for a powerful Linux computer, with wireless, in a small form factor, you’re not going to do much better than this little guy. You could of course desolder a Pi 3 B+, but for now this is the smallest, most powerful single board computer with good software support.

Re-enacting TRON on the Apple IIgs

Thu, 11/15/2018 - 01:00

TRON is a science fiction classic, hitting cinemas in the midst of the burgeoning home computer era. It’s the film that created the famous light cycle, which spawned many video game recreations in the following years. Many years ago now, [Daniel] decided to flex his programming muscles by coding a version of the game for the Apple IIgs, with accidentally excellent results.

In the film, the characters find an escape from the light cycle game by forcing another player to crash into the walls of the play area. The resulting explosion left a hole, allowing the players to exit the light cycle game and explore the rest of the computer. Amusingly, due to a coding oversight, [Daniel] had created exactly this same flaw in his own code.

[Daniel]’s game differed from the original in that players were provided with missiles to destroy enemy trails. However, these missiles did not discriminate, and due to the simplicity of the code, were able to destroy the boundary on the play area. This was discovered when the computer player tried to escape an otherwise impossible situation. Upon blowing a hole in the arena wall, the computer player proceeded to drive off the screen – into invalid memory. This led to the computer crashing in short order, due to the unprotected memory space of the Apple II platform.

It’s a case of code imitating art – and completely by accident. The game managed to replicate the light cycle escape from the film entirely due to the unexpected behaviour of the simple missile code. [Daniel] steps through the code and how the bug happened, and covers the underlying principle behind the resulting crashes. It’s an entertaining tale of the risks of coding at low level; something we don’t always run into with today’s modern interpreted languages.

Thirsty for more tales of hacking the Apple II? How about going back in time to fix a 37 year old bug?

Pages