AVR math optimization

Following up on our previous post on understanding floating point math and speed of operations on 8-bit AVRs, we ran across an excellent article today on Arduino math optimization. Alan walks through his implementation of an exponential moving average algorithm. An exponential moving average normally requires floating point arithmetic, but due to the lack of native support on 8-bit AVRs, Alan worked out a way to do it with fixed point math.

After some experimentation, he was able to get his version running quite a bit faster than the floating point version, and offers a detailed writeup and tips along the way. Just as we found in our brief testing, the easiest AVR math optimization is to avoid division, since these processors don’t have a native divide instruction. If you’re looking to squeeze every last drop of performance out of your 8-bit chip and can’t (or won’t) upgrade to something more powerful, check this out for some good ideas.

Link: Sensor smoothing and optimised maths on the arduino

Original source: Hackaday

Using a CMOS camera to replace conventional light sensors

Little did we know, that quarter is the size of a dinner plate.

A post on Embedded Lab that discusses using a CMOS camera for sensing applications caught our eye today. Traditionally, to process the output from a CMOS you need some serious number-crunching power, and common lore holds that most 8-bit microcontrollers aren’t up to the task. However, Ibrahim Kamal from IKALOGIC has written an article that explains how you can use a CMOS to replace rudimentary image or light sensors such as photo diodes.

By reducing the captured resolution, discarding color data, and potentially converting the pixel values to binary information, you can still receive useful input but can parse it with a low-cost, low-power processor. In this way, an 8-bit chip can open the door to basic image processing, allowing for lots of possibilities in robotics or other projects.

The article includes an example that hooks up a CMOS available on Sparkfun (the TCM8230MD) to an AVR XMega. For $10, you have no excuse not to try it in your next sensing project.

Article: IKALOGIC
Source: Embedded Lab
Image: Sparkfun

The best books on electronics

Electronics is relevant to our modern lives like almost no other field of science. On the one hand, we have the physical world, with objects and phenomena that we touch, see, and interact with. On the other, we increasingly spend time with the digital world, where we log data in spreadsheets or apps, solve complex problems with the help of computers, or rely on various devices to make our lives easier.

Sitting in between these two worlds and bridging the divide is electronics. Without it, there would be no microprocessors, no grids of tiny transistors to switch on and off and do our bidding millions of times per second. No way to power our homes or gadgets, or even manufacture many of the non-technical goods we take for granted. It has truly revolutionized every facet of our existence. Much emphasis today is placed on programming and application development, but it is important to remember that these things are abstractions sitting on top of a physical and electrical foundation.

In case all of this talk of revolution has you fired up, we’ve collected some of the best books to help you learn electronics. Whether you’re a total beginner or advanced engineer, check out the resources below to find a learning guide that’s right for you.

The top 5 Arduino projects for advanced hackers

As the Arduino surges in popularity, people keep dreaming up crazier and more complex ways to use it. We’ve rounded up five of the most impressive Arduino projects on the web to show what’s possible with such a versatile and inexpensive platform. Be warned – these projects aren’t for beginners, but if you’re looking for a challenge and something to brag about, they could be just the ticket.

Arduino open source tracking device leverages Kickstarter

A new Kickstarter project aims to provide a low-cost, open source platform for building a GPS tracking device. The author, Wayne Truchsess of DSS Circuits, explains that a few years back, his brother in law had a PS3 stolen during a long power outage in the depths of winter. Not wanting to repeat history, Wayne bought a fake PS3 case on eBay and developed his own prototype position tracker to put inside it.

The tracker consists of a GSM cellular modem, a GPS unit, and an accelerometer, all tied to an Arduino and a LiPo battery to provide brains and power, respectively. Normally, the device lies in wait, asleep to save power. If it detects motion, it turns on the modem and alerts a preconfigured phone number via SMS. The owner can then respond with various commands to turn position tracking on or put the device back to sleep.