Ray tracing on an Arduino

[Greg] implemented a simple ray tracer for Arduino as a fun exercise and a way to benchmark the processor. He started out with the Moller-Trumbore algorithm, a common ray-tracing algorithm that calculates the intersection of a ray with a triangular plane without doing any pre-calculation of the planes. His code supports one static light and one static camera, which is enough to render a simple scene.

[Greg] started out with a small scene composed of a few polygons, but just finished up a scene with 505 vertices, 901 faces, and reflective surfaces (shown above). He made the above render on his PC emulator, but estimates that it would take just over 4 days to render on the Arduino. [Greg]’s project supports multiple bounces of light, which differentiates his ray tracer from some we’ve covered before (and which explains why it takes so long to render).

The ray tracer is implemented entirely with double-precision floats. This translates to a ton of software float emulation instructions, since the Arduino doesn’t have a floating-point unit. While this ray tracer can’t render anything near real-time graphics due to the slowness of the microcontroller, it’s still a great proof of concept.

The title image for this post was rendered on a modern PC, taking 263 seconds to complete. The same scene, at 64×64 resolution, was rendered on the Arduino, taking 4008 seconds to complete. That render is below.


Enhanced Coffee Brewer Knows How Much of a Caffeine Addict You Are

Who should chip in the most to restock the community coffee supply at work is a common point of contention at some offices. This RFID infused coffee brewer called Juraduino by [Oliver Krohn] solves the issue at his workplace once and for all by logging how much is being consumed by each person and how often; quite the diplomatic hack.

[Oliver] donated his old Jura Coffee maker to his office with some added hardware cleverly hidden underneath the faceplate of the machine. An Arduino mounted within runs the show, powered through mini USB from the logic unit of the coffee maker itself. Once a co-worker swipes their RFID card over the front of the machine, a real-time clock module stamps when the coffee was requested, and then logs the amount selected by that person on a mini SD card. The data stored is sent via an additional bluetooth module to a custom app [Oliver] created with MIT App Inventor for his phone which displays the information. These details can then be exported in the form of an email addressed to everyone in the office at the end of the week, announcing definitively who can be counted on to restock the bulk of the community supplies.

Though there isn’t a link available with further documentation, [Oliver] mentions in the ‘details’ portion of his video that he’d be happy to share that information with anyone who contacts him regarding the project. You can see the Jura at work below:

Continue reading “Enhanced Coffee Brewer Knows How Much of a Caffeine Addict You Are”

Solving Arduino’s stk500_getsync() error

[psgarcha] took a year-old Arduino Uno on an international trip and upon returning found something was wrong. Every time he would try to upload, he would get the dreaded avrdude error, ‘stk500_getsync(): not in sync resp=0x00′. The Rx light would blink a few times during the attempted upload, but the tx light did not. Somehow, something was terribly wrong with the ‘duino, and [psgarcha] dug deep to figure out why.

To test the quality of the Arduino’s serial connection, [psgarcha] performed a loopback test; basically a wire plugged into the Tx and Rx pins of the Arduino. Sending a short message through the serial port showed the problem wasn’t the USB cable, the ATmega16u2 on the ‘duino, or any traces on the board. This would require more thought.

The main reason for the error would then be no communication between the computer and the ‘duino, the wrong COM port selected, the wrong board selected in the Arduino text editor, or timing errors or a corrupt bootloader. The first three errors were now out of the question, leaving timing errors and a corrupt bootloader. Troubleshooting then moved on to ordering a new programmer, and still this didn’t work with the broken Uno.

Frustrated with one of the greatest failures to become an Arduino tinkerer, [psgarcha] took a good, long look at the Uno board. He glanced over to an Arduino Mega board. Something looked different. On the Uno, the resonator had blown off. Problem found, at least.

Replacing the blown part with a hilariously large can crystal oscillator, [psgarcha] was back in business. This isn’t how you would fix 99% of getsync() errors, and it’s difficult imagining a situation where a this part would randomly blow, but if you’re ever looking at a nearly intractable problem, you need to start looking at what really shouldn’t fail.

Resonator my fix (1)

Awesome rework, though.


A Modern Woodworking Workbench

This is a post about workbenches, but not the benches you’re probably thinking about. Workbenches meant for electronics development are simple matters – just about any flat surface, a few shelves for equipment, and an anti-static mat will be fine for every conceivable use.  Workbenches for woodworking are a separate matter entirely. There’s actually quite a bit of history behind the development of the woodworking workbench, but the basic idea is a thick laminated wood top, integrated vices, holes in the work surface for bench dogs, and ergonomics that allow for comfortable use of hand tools. The basic design of these benches hasn’t changed much in several hundred years, and [Dirk] thought the design was ready for a modern update.

Continue reading “A Modern Woodworking Workbench”

Programmable Lithium Charger Shield for Arduino

Surely you need yet another way to charge your lithium batteries—perhaps you can sate your desperation with this programmable multi (or single) cell lithium charger shield for the Arduino?! Okay, so you’re not hurting for another method of juicing up your batteries. If you’re a regular around these parts of the interwebs, you’ll recall the lithium charging guide and that rather incredible, near-encyclopedic rundown of both batteries and chargers, which likely kept your charging needs under control.

That said, this shield by Electro-Labs might be the perfect transition for the die-hard-‘duino fanatic looking to migrate to tougher projects. The build features an LCD and four-button interface to fiddle with settings, and is based around an LT1510 constant current/constant voltage charger IC. You can find the schematic, bill of materials, code, and PCB design on the Electro-Labs webpage, as well as a brief rundown explaining how the circuit works. Still want to add on the design? Throw in one of these Li-ion holders for quick battery swapping action.

[via Embedded Lab]

Morse Decoder’s Lean and Sexy Search Algorithm

Often the Morse Code centered projects that we feature are to help you practice transmitting messages. This one takes a tack and builds an automatic decoder. We think [Nicola Cimmino’s] project is well worth featuring simply based on his explanation of the Digital Signal Processing used on the signal coming in from the microphone. Well done. But he’s really just getting warmed up.

What makes this really stand out is a brilliant algorithm that allows conversion from Morse to ASCII using a lookup table of only 64 bytes. This provides enough room for A-Z and 0-9 without chance of collision but could be expanded to allow for more characters. Below is a concise description of how the algorithm works but make sure you take the time to read [Nicola’s] project description in its entirety.

The algorithm can be decribed as follows. Have an index inside the lookup string inizialied to zero. Have an initial dash jump size of 64. At every received element (dot or dash) halve the initial dash jump and then increase by 1 the index inside the lookup string if a dot was received and by dash jump size if a dash was received. Repeat until a letter separator is reached, at that point the index inside the lookup string will point to the ASCII corresponding to the decoded morse.

Have you heard of this technique before? If so, tell us about it in the comments below. Before you jump all over this one, realize that Magic Morse uses a different technique.

Medical Tricorder Mark I

A handheld tricorder is as good a reason as any to start a project. The science-fiction-derived form factor provides an opportunity to work on a lot of different areas of hardware development like portable power, charging, communications between sensor and microcontroller. And of course you need a user interface so that the values being returned will have some meaning for the user.

[Marcus B] has done a great job with all of this in his first version of a medical tricorder. The current design hosts two sensors, one measures skin temperature using infrared, the other is a pulse sensor.

For us it’s not the number of sensors that makes something a “tricorder” but the ability of the device to use those sensors to make a diagnosis (or to give the user enough hints to come to their own conclusion). [Marcus] shares similar views and with that in mind has designed in a real-time clock and an SD card slot. These can be used to log sensor data over time which may then be able to suggest ailments based on a known set of common diagnosis parameters.

Looking at the image above you may be wondering which chip is the microcontroller. This build is actually a shield for an Arduino hiding underneath.

There’s a demonstration video after the break. And if you find this impressive you won’t want to miss the Open Source Science Tricorder which is one of the finalists for the 2014 Hackaday Prize.

Continue reading “Medical Tricorder Mark I”