Hacklet 31 – Software Tools

For every computer error, there are two human errors, and one of them is blaming the computer. Whenever a human blames a computer for something, there are two tools, and one of them is the computer.

Not all of your nifty tools need to be fancy robots, CNC machines, or nifty Robertson screwdrivers; a computer is equally capable of being a fantastic tool, provided it has the right software. For this week’s Hacklet, we’re going through some of the best software tools on hackaday.io.

6653681421957570397[Alan] was inspired to build a software tool for making sewing patterns. Sewing patterns are usually designed for the ‘average’ person, but if you’re making custom wearables, you should end up with a piece of clothing that fits perfectly.

The first project [Alan] is using this tool for is a fleece cap that fits the contour of his head. He captured a 3D mesh of his head, imported the mesh into Blender, and unwrapped the resulting mesh. The two halves of the hat were then plotted with a Silhouette Cameo, cut out of fleece, and sewn together. The result is a beanie that fits perfectly around [Alan]’s head. It’s an extremely cool and novel application of 3D modeling, and if you ever need to wrap a 3D object with a 2D material, this is the project you want to check out.

5869061407871295021 And you thought the autorouter in Eagle was bad.

[Anderson] built a tool called Pyrite that will take a schematic and build a layout in three-dimensional space. He calls them Volumetric Circuits, and it’s basically the point-to-point wiring found in old radios and amplifiers taken to the next level. We featured this project before, and there haven’t been many updates since then. Maybe giving [Anderson]’s project a few skulls will help motivate him to get back to the project.

133031421839442989 Not satisfied with the existing free and open source CAM programs, [Snegovick] started work on his own.

[Snegovick] calls his project BCAM, and it’s exactly what you need to mill holes in PCBs, cut gears with a CNC router, engrave plastic, and anything else a 2.5 axis CNC machine can do. The project is written in Python, and yes, the source is available. Supported operations include drilling, path following, offset path following, and pocketing.

Write enough microcontroller projects, and you’ll eventually come up with your own library of common code that does one thing and one thing well. If you’re smart, you’ll reuse that code in future projects. [ericwazhung] is cutting through the hard part of developing all this code and released some things that are useful in a whole lot of projects.

Included in the commonCode library are the usual ‘heartbeat LED’, non-blocking input, a standard interface for AVR timers, bitmaps of text characters, DC motor control, and a whole bunch more. Extremely useful in any event.

That’s it for this round of the Hacklet, bringing you the best hackaday.io has to offer.

A Simple Floppy Music Controller

While playing music with floppy drives has been done many times over, making any device with a stepper motor play music still appeals to the hacker in all of us. [Tyler] designed an Arduino shield and a library which lets you get up and running in no time. [Tyler]’s shield includes pin headers to connect 4 floppy drives, which plug directly into the shield. The drives don’t need any modification before being used.

While you could simply wire a few floppy drives up to an Arduino with some jumpers, this breakout shield makes connecting your drives trivial. In addition to designing the shield, [Tyler] released an Arduino library to make things even easier. The library lets you simply set the frequency you want each drive to play, which saves a bit of legwork.

The floppy-controlling Arduino library is available on GitHub and a video of the controller is included after the break.

Continue reading “A Simple Floppy Music Controller”

Reverse Engineering a Wireless Studio Lighting Remote

If you want to take a photograph with a professional look, proper lighting is going to be critical. [Richard] has been using a commercial lighting solution in his studio. His Lencarta UltraPro 300 studio strobes provide adequate lighting and also have the ability to have various settings adjusted remotely. A single remote can control different lights setting each to its own parameters. [Richard] likes to automate as much as possible in his studio, so he thought that maybe he would be able to reverse engineer the remote control so he can more easily control his lighting.

[Richard] started by opening up the remote and taking a look at the radio circuitry. He discovered the circuit uses a nRF24L01+ chip. He had previously picked up a couple of these on eBay, so his first thought was to just promiscuously snoop on the communications over the air. Unfortunately the chips can only listen in on up to six addresses at a time, and with a 40-bit address, this approach may have taken a while.

Not one to give up easily, [Richard] chose a new method of attack. First, he knew that the radio chip communicates to a master microcontroller via SPI. Second, he knew that the radio chip had no built-in memory. Therefore, the microcontroller must save the address in its own memory and then send it to the radio chip via the SPI bus. [Richard] figured if he could snoop on the SPI bus, he could find the address of the remote. With that information, he would be able to build another radio circuit to listen in over the air.

Using an Open Logic Sniffer, [Richard] was able to capture some of the SPI communications. Then, using the datasheet as a reference, he was able to isolate the communications that stored information int the radio chip’s address register. This same technique was used to decipher the radio channel. There was a bit more trial and error involved, as [Richard] later discovered that there were a few other important registers. He also discovered that the remote changed the address when actually transmitting data, so he had to update his receiver code to reflect this.

The receiver was built using another nRF24L01+ chip and an Arduino. Once the address and other registers were configured properly, [Richard’s] custom radio was able to pick up the radio commands being sent from the lighting remote. All [Richard] had to do at this point was press each button and record the communications data which resulted. The Arduino code for the receiver is available on the project page.

[Richard] took it an extra step and wrote his own library to talk to the flashes. He has made his library available on github for anyone who is interested.

Re-Using The LCD & Button Assembly From A Broken Inkjet Printer

Inkjet printers are a dime a dozen. You probably have taken old printers apart to scavenge parts like motors, pulleys, belts, switches, linear rods, power supply, etc. These parts are easy to reuse in other projects, unlike the controller portion of the printer which not as easy to make use of. [Blaupause] has done something very interesting, and it probably ranks in the ‘extreme difficulty’ category for most tinkerers. He has taken the front panel off an otherwise non-working Canon Pixma inkjet printer and has figured out a way to interface with it.

The front panel of this printer has the standard buttons that you would find on any ole printer, but the Pixmas also has a small LCD screen. [Blaupause] has written a library for the Olimexino microcontroller that can communicate with and make use of the repurposed front panel. And the neat part of this project is that the front panel’s on-board processor does the heavy lifting when it comes to displaying images on the LCD screen or checking button states which frees up your microcontroller to do whatever else. Right now, the LCD screen can display bitmaps and supports image transparency. The library can not display video as of yet, but that option is being worked on.

[Blaupause] makes all his hard work available to the public on the project’s Sourceforge page. In addition to the library, he also includes printer panel pinouts and detailed information on how to communicate with the buttons and LCD screen. Video after the break…

Continue reading “Re-Using The LCD & Button Assembly From A Broken Inkjet Printer”

Arduino SPI Library Gains Transaction Support

Transaction SPI Timing
Transaction SPI Timing

To prevent data corruption when using multiple SPI devices on the same bus, care must be taken to ensure that they are only accessed from within the main loop, or from the interrupt routine, never both. Data corruption can happen when one device is chip selected in the main loop, and then during that transfer an interrupt occurs, chip selecting another device. The original device now gets incorrect data.

For the last several weeks, [Paul] has been working on a new Arduino SPI library, to solve these types of conflicts. In the above scenario, the new library will generate a blocking SPI transaction, thus allowing the first main loop SPI transfer to complete, before attempting the second transfer. This is illustrated in the picture above, the blue trace rising edge is when the interrupt occurred, during the green trace chip select. The best part, it only affects SPI, your other interrupts will still happen on time. No servo jitter!

This is just one of the new library features, check out the link above for the rest. [Paul] sums it up best: “protects your SPI access from other interrupt-based libraries, and guarantees correct setting while you use the SPI bus”.

Build a Sensorless Brushless DC Motor Controller

[Davide Gironi] shows us how to implement a sensorless brushless DC motor controller (sensorless BLDC) using an ATmega8 microcontroller. In order to control a BLDC motor you need to know its rotational sequence position and speed so you can calculate and apply the correct current phase sequence to the motor windings at just the right time.

Simply said, sensorless BLDC means you’re not using a purpose built sensor to determine the motor’s position and speed, however, you are sensing the motor’s sequence position using the back EMF signal coming from one of motor’s coils that is not currently receiving power. When this back EMF signal crosses zero voltage a microcontroller can calculate the rotational speed and when to switch to the next power sequence. This technique is not good for position control motors but is great for continuous motors like computer fans and drives were the slightly reduced wiring costs make this type of BLDC control favored.

If you want to build a BLDC controller we recommend starting with [Davide’s] last project on sensor controlled BLDC motors. You can also checkout these interactive demonstrations for more understanding on the different BLDC configurations.

Follow along after the break to watch the video demonstration of [Davide’s] sensorless BLDC controller controlling a motor from CD-ROM drive.

Continue reading “Build a Sensorless Brushless DC Motor Controller”

Building a brushless motor controller around an ATmega chip

You know when you see something like this it’s just going to be awesome, and we weren’t disappointed by our first impression. [Davide Gironi] built a brushless motor controller from the ground up using an ATmega8 as the brain. If you want to understand every aspect of a subject this is how to do it. Lucky for us he explains what each portion of the prototype does.

Brushless motors have no brushes in them (duh). But what does that really mean? In order to spin the motor a very carefully crafted signal is sent through the motor coils in the stationary portion (called the stator), producing a magnetic field that pushes against permanent magnets in the rotor. A big part of crafting that signal is knowing the position of the rotor. This is often accomplished with Hall Effect sensors, but can also be performed without them by measuring the back EMF in the coils not currently being driven. The AVR-GCC compatible library which [Davide] put together can be tweaked to work with either setup.

Get a good look at the system in action after the break.

Continue reading “Building a brushless motor controller around an ATmega chip”