Profiling An Arduino

profiling

In proper, high-dollar embedded development environments – and quite a few free and open source ones, as well – you get really cool features like debugging, emulation, and profiling. The Arduino IDE doesn’t feature any of these bells a whistles, so figuring out how much time is spent in one section of code is nigh impossible. [William] came up with a clever solution to this problem, and while it doesn’t tell you exactly how much time is spent on a specific line of code, it’s still a good enough tool to be a great help in optimization.

[William]’s solution is to create a ‘bin’ for arbitrary chunks of code – one for each subroutine or deeply nested loop. When the profiler run, you end up with a histogram of how much time is spent per block of code. This is done with an interrupt that runs at about 1 kHz, with macros sprinkled around the code. Each time the interrupt ticks, the macro runs and increases a counter by one. Let the sketch run for a minute or so, and you get an idea of how much time is spent in a specific area of code.

It’s a bit of a kludge, but when you’re dealing with extremely minimal tools, any sort of help in debugging is sorely needed and greatly appreciated.

 

 

Hackaday Links: April 27, 2014

hackaday-links-chain

 

The HackFFM hackerspace in Frankfurt finally got their CO2 laser up and running, and the folks there were looking for something to engrave. They realized the labels on IC packages are commonly laser engraved, so they made a DIP-sized Arduino. The pins are labelled just as they would be on an Arduino, and a few SMD components dead bugged onto the pins provide all the required circuitry. Video here.

A few years ago, we heard [David Mellis] built a DIY cell phone for an MIT Media Lab thingy. Apparently it’s making the blog rounds again thanks to the Raspi cell phone we featured yesterday. Here’s the Arduino cell phone again. Honestly we’d prefer the minimalist DIY Nokia inspired version.

The Raspberry Pi is now a form factor, with the HummingBoard, a Freescale i.MX6-powered clone, being released soon. There’s another form factor compatible platform out there, the Banana Pi, and you can actually buy it now. It’s an ARM A20 dual core running at 1GHz, Gig of RAM, and Gigabit Ethernet for about $60. That SATA port is really, really cool, too.

[Richard] has been working on a solar-powered sun jar this winter and now he’s done. The design uses two small solar panels to charge up two 500F (!) supercapacitors. There’s a very cool and very small supercap charging circuit in there, and unless this thing is placed in a very dark closet, it’ll probably keep running forever. Or until something breaks.

Here’s something awesome for the synth heads out there: it’s an analog modeling synthesizer currently on Indiegogo. Three DCOs, 18dB lowpass filter, 2 envelopes and an LFO, for all that classic Moog, Oberheim, and Roland goodness. It’s also pretty cheap at $120 USD. We really don’t get enough synth and musical builds here at Hackaday, so if you’re working on something, send it in.

A glass-based PCB? Sure. Here’s [Masataka Joei] put gold and silver on a piece of glass, masked off a few decorative shapes, and sandblasted the excess electrum away. [Masataka] is using it for jewelery, but the mind races once you realize you could solder stuff to it.

Small-Scale Projects Use Snail-Mail Mail-Scale

stamps.com scale

Stamps.com offers a free USB scale when you sign up for their service. The first versions of this scale did not have a display. In order to find the weight of an object the scale had to be connected to a computer running the stamps.com software. If you happen to have one of these old scales or are able to pick one up cheap, you may be interested in using it outside of the stamps.com service. There are several options on how to do that.

Continue reading “Small-Scale Projects Use Snail-Mail Mail-Scale”

DIY Multimeter, Arduino Sold Seperately

Arduino-based Multimeter

You can’t argue that Arduinos are extremely popular with the maker/hacker community. Some would say that there is certainly no shortage of projects to make using them. [Milen] thought otherwise and felt it was time to create an Arduino-based multimeter.

At the heart of this project  is a common Arduino Uno. The additional parts were kept to a minimum in order to keep down the overall cost and project complexity. The finished product can measure voltage from 0-100v, amperage up to 500mA and resistance between 0-250 kohm. If you need to check for continuity, it can do that too.

All of the parts required to make the multimeter fit on a shield that plugs directly into the Arduino. Banana plugs allow for attaching test leads. The measurement values are displayed on an LCD screen and/or (if connected) to the Arduino IDE Serial Monitor. If only using the serial monitor, the LCD screen can be omitted to save a few bucks.

Continue reading “DIY Multimeter, Arduino Sold Seperately”

Building A Final Key

Final Key

Remembering passwords is a pain, and there’s a number of devices out there to make it easier. If you’re looking to roll your own, this guide to building a Final Key will walk you through the process.

We talked about the Final Key before. It’s a one button password manager that encrypts and stores your password. It acts as a virtual serial port for configuration. When you hit the button, it becomes a keyboard and types in the correct password.

The creator has no intentions of making this a commercial project for a number of reasons. Instead, easy build instructions are provided based on the Arduino Pro Micro. The 24LC512 EEPROM can be soldered directly to the Arduino by bending out the DIP legs. A few resistors, a button, and an LED finish off the project. The last step is to fill it with hot glue to prevent tampering.

The Final Key firmware is available on Github, and the case can be ordered from Shapeways. If you’re interested in hardware password management, you can also check out the Mooltipass which is being developed on Hackaday.

[Thanks to Lars for the tip!]

Sublime Text As An Arduino IDE

If you’ve played with an Arduino, you’ve probably been frustrated by the IDE. It works, but it’s not the best editor. It’s especially painful for bigger files and larger projects. The Stino plugin for Sublime Text aims to solve this issue by bringing the full functionality of the Arduino IDE to the Sublime Text editor.

Sublime Text is a powerful text editor with support for most programming languages. What it’s missing is support for compiling and uploading code to an Arduino. Stino bridges that gap. Sublime is a commercial product, and retails for $70 USD. However Sublime does have an indefinite trial period, so Stino can be evaluated for free. Stino itself is an open source plugin written in Python, and you can contribute to the project on Github.

After installing Sublime and Stino, you point the plugin at an Arduino install folder. It then allows you to build and flash directly from the editor. For anyone who’s been frustrated with the Arduino IDE, this looks like a slick solution.

[Thanks to Matt for the tip!]

Flexible Arduino Sure To Be A Hit

 

Scrolling LED on soda can

Wearable, lightweight hacks have long been dominated by the Lilypad. This will probably change with the introduction of the Printoo. Using printable circuit technology, the Printoo takes a modular approach to enable hackers, makers, and engineers alike to construct flexible circuits that can be put on almost anything, including paper!

Powered by the all too familiar ATmega328, the Printoo core module is fully compatible with the Ardunio IDE. The modular design enables functionality with several other printed devices including displays, batteries, sensors and even LED strips to make many different projects possible. One of the most interesting modules is the 1.5 volt, 500 micron thick electrochromic display.

Be sure to check out their Kickstarter, which has a nice video that demonstrates the project. If funded, they will be available in October in case you want to get your hands on one. Or feel free to make your own. Just be sure to let us know if you do!