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.

ardu

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.

 

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]

Powering Your F-16 With An Arduino

What do you do when you have an F-16 sitting around, and want to have some blinking navigation lights? We know of exactly one way to blink a light, and apparently so does [Dr. Craig Hollabaugh]. When asked to help restore an F-16 for the National Museum of Nuclear Science and History in New Mexico, [Craig] pulled out the only tool that should ever be used to blink navigation lights on an air superiority fighter.

[Craig]’s friend was working on getting an F-16 restored for the Nuclear Museum, and like anyone with sufficient curiosity, asked how hard it would be to get the navigation lights working again. [Craig] figured an Arduino would do the trick, and with the addition of a shield loaded up with a few mosfets, the nav lights on an old F-16 would come to life once again.

The board doesn’t just blink lights on and off. Since [Craig] is using LEDs, the isn’t the nice dimming glow you’d see turning a normal incandescent light off and on repeatedly. To emulate that, [Craig] is copying Newton’s law of cooling with a PWM pin. The results are fantastic – at the unveiling with both New Mexico senators and a Brigadier General, everything went off without a hitch. You can see the unveiling video below, along with a few videos from [Craig]’s build log.

Continue reading “Powering Your F-16 With An Arduino”

Programming an Arduino over WiFi with the ESP8266

A lot of people have used ESP8266 to add inexpensive WiFi connectivity to their projects, but [Oscar] decided to take it one step further and program an Arduino over WiFi with the ESP8266. [Oscar] wrote a server script in Python that communicates with firmware running on the Arduino. The Arduino connects to the server on startup and listens for a “reboot” command.

When the command is received, the processor resets and enters the bootloader. The python script begins streaming a hex file over WiFi to the ESP8226, which relays it to the Arduino’s bootloader. Once the hex file is streamed, the microcontroller seamlessly starts executing the firmware. This method can be used with any AVR running a stk500-compatible bootloader.

[Oscar]’s writeup is in Spanish, but fortunately the comments in his Python and Arduino code are in English. Check out the video (in English) after the break where [Oscar] demonstrates his bootloading setup.

Continue reading “Programming an Arduino over WiFi with the ESP8266″

Battery Shield Mounts Underneath The Arduino

So, what do you do when your Arduino project needs to operate in a remote area or as a portable device? There are LiPo battery shields available, and although they may work well, recharging requires access to a USB port. You can also go the 9v battery route plugged into the on-board regulator of the Arduino but the low mAh rating of a 9v won’t allow your project to stay running for very long. [AI] needed a quick-change battery option for his Arduino project and came up with what he is calling the AA Undershield.

As the name implies, AA sized batteries are used in the project, two of them actually. Yes, two AA batteries at 1.5v each would equal only 3 volts when connected in series. The Arduino needs 5v so [AI] decided to use a MAX756 DC-to-DC step-up regulator to maintain a steady stream of 5v. This article has some nice graphs showing the difference in performance between a 9v battery being stepped down to 5v verses two AA’s being bumped up to 5v.

The ‘under’ in Undershield comes from this shield being mounted underneath the Arduino, unlike every other shield on the planet. Doing so allows use of a standard 0.100″-spaced prototype PCB and is an easy DIY solution to that odd-sized space between the Arduino’s Digital 7 and 8 pins. The Arduino mounts to the Undershield via its normal mounting holes with the help of some aluminum stand offs.

[AI] did a great job documenting his build with schematics and lots of photos so that anyone that is interested in making one for themselves can do so with extreme ease.

Now Let’s See The World’s Largest Arduino

A few days ago we saw what would have been a killer Kickstarter a few years ago. It was the smallest conceivable ATtiny85 microcontroller board, with resistors, diodes, a USB connector, and eight pins for plugging into a breadboard. It’s a shame this design wasn’t around for the great Arduino Minification of Kickstarter in late 2011; it would have easily netted a few hundred thousand dollars, a TED talk, and a TechCrunch biopic.

[AtomSoftTech] has thrown his gauntlet down and created an even smaller ‘tiny85 board. it measures 0.4in by 0.3in, including the passives, reset switch, and USB connector. To put that in perspective, the PDIP package of the ‘tiny85 measures 0.4 x 0.4. How is [Atom] getting away with this? Cheating, splitting the circuit onto two stacked boards, or knowing the right components, depending on how you look at it.

USB [Atom] is using a few interesting components in this build. The USB connector is a surface mount vertical part, making the USB cord stick out the top of this uC board. The reset button is extremely small as well, sticking out of the interior layer of the PCB sandwich.

[AtomSoft] has the project up on OSH Park ($1.55 for three. How cool is that?), and we assume he’ll be selling the official World’s Smallest Arduino-compatible board at Tindie in time.