After seeing some heart rate monitor apps for Android which use the camera and flashlight features of the phones, [Tyson] took on the challenge of coding this for himself. But he’s not using a smart phone, instead he grabbed a headlamp and webcam for his heat rate monitor.
To start out he recorded a test video with his smart phone to see what it looks like to cover both the flash LED and camera module with his thumb. The picture is mainly pink, but there’s quite obviously a color gradient that pulses with each gush of blood through his skin. The next task was to write some filtering software that could make use of this type of image coming from a webcam. He used C# to write a GUI which shows the live feed, as well as a scrolling graph of the processed data. He took several tries at it, we’ve embedded one of the earlier efforts after the break.
Continue reading “Monitor your heartbeat with a webcam and a flashlight”
This is a wiring diagram that [Soranne] put together when developing a method of programming PIC microcontrollers using an Arduino board. You can see that he takes care of the 12V issue by connecting the Master Clear (MCLR) pin to an external source. This comes with one warning that the Arduino should always be reset just before making that connection.
He’s tested this with a 16F628 and is happy to report that he can successfully flash the program memory, but hasn’t implemented a way to write to the EEPROM as of yet. This should work for any of the 16F family of chips, but we’d bet this will be extended if some knowledgeable folks decide to lend a hand.
On the PC side of things [Soraane] has been working on a program to push code to the Arduino via the USB connection. He’s developing it in C# and even has a GUI worked up for the project. You can get your hands on the software in the second post of the thread linked above but you’ll have to be logged into the Arduino forum to see the download link.
We think the 12V issue is why we don’t see more roll-your-own programmers for PIC. But there are a few solutions out there like this ATmega8 version.
We know that measuring the speed of light with an Arduino is possible. It’s just that the implementation is hard.
Last month we saw [Udo]’s blinkenlight shield that can be used as a line scan camera. It’s a neat piece of kit, but [Udo] really wants to submit something for the Buildlounge laser cutter giveaway, so he figured measuring the speed of light would be an easy project. If a kid and a chocolate bar can do it, surely it can’t be too hard.
[Udo] hit upon the idea of pulsing a laser pointer and measuring the time of the reflection. Because his blinkenlight shield can be used as a light sensor, all that’s needed is a mirror and a pretty long line of sight. There’s a few problems with the setup though: with the Arduino running at 16 MHz, a photon will travel 19 meters in one clock cycle.
Even with some very clever coding, we’re not really sure detecting an emitted photon is possible at such (relatively) slow clock speeds. We’re thinking [Udo] could source a few hundred meters of optic fiber so the entire experiment could fit on a desk, but feel free to drop a note in the comments if you’ve got a better idea. [Udo]’s demo of his blinkenlight/laser mashup is after the break.
Continue reading “Trying to measure the speed of light with an Arduino”
So you’re getting better at programming microcontrollers and now you want to do several things at once? You know better than that, microcontrollers are only capable of processing one thing at a time. But if you’re clever with your coding you can achieve something that behaves as if several things are going on at once. The most common way to do this is to set a flag using an interrupt, then use the main loop to check for that flag. [S1axter] posted a tutorial on this topic where he uses bit field structures to help simplify time sensitive events.
We think [S1axter] did a fantastic job of explaining this moderately difficult topic clearly and quickly. In the video after the break he begins by explaining what a bit field is and how it is defined. Basically you’re using a C structure to track a flag using just one bit of storage. This way the flag is either set or not. We suggest you pay careful attention to how he declares the structures as volatile, so you don’t have unexpected behavior when you try it yourself.
Continue reading “C bit field structures for microcontroller multitasking”
Chances are you have already heard of the passing of [Dennis Ritchie]. We admit, we’re among the throngs who knew little of his life, but [Cade Metz] has posted an excellent remembrance of his life which we think is well worth reading.
[Dennis] passed on October 12th at the age of 70. This image shows him receiving the National Medal of Technology awarded to him by [Bill Clinton] in 1998. His legacy lives on in the work that earned him this award as the creator of the C programming language; a side project which he developed to help him achieve the creation of a new system kernel called UNIX. This work, of course, was the precursor that led to universal software packages like OSX, iOS, Linux, and even Windows (which at one point was itself written using the C language).
There has been some Internet fodder regarding media coverage of [Steve Jobs’] death and not of [Dennis’] passing. It’s harder for those lacking experience with programming to comprehend [Dennis’] contributions. We’re glad to have an opportunity to pass on the story of his life and to take a moment to appreciate his accomplishments.
[Mike] sent in a project he’s been working on – a port of a BASIC interpreter that fits on an Arduino. The code is meant to be a faithful port of Tiny BASIC for the 68000, and true to Tiny BASIC form, it fits in the very limited RAM of the Arduino.
True to Tiny BASIC’s assembler roots, [Mike]’s C port makes extensive use of the “infinitely-abusable” goto statement. Kernighan and Ritchie said themselves, “code involving a goto can alway be written without one” but [Mike] found that using goto left a lot more room available for BASIC code. The BASIC interpreter eats up around 600 bytes in the Arduino RAM, leaving about 1.4 kB for BASIC code. Not much, but more than the lowest-end BASIC Stamp.
[Mike] says he started this project to see how ‘old bearded ones’ conjured up so many impressive programs with a few kB of RAM. Tiny BASIC was originally conceived for the Altair 8800 that shipped with 256 bytes of RAM stock, so it seemed like a perfect fit. Right now, all we know is we’ll be spending the weekend digging through our copies of Dr. Dobb’s Journal.
Microsoft has thrown its hat into the open source hardware hobby market. Their offering is called the Gadgeteer. We’d love to tell you all about it, but the big M didn’t make it very easy to find out about the device and it’s addons. When we set out to find what processor is running on the board we were happy to see that they do call it an Open Source Hardware project, but no schematic is posted. When we did finally navigate to the hardware documentation it’s a file that must be downloaded and you’ve got to agree to their licensing before grabbing it. So that’s as far as we went, and now we’ll go back to using more open tools.
For those of you who aren’t scared off by the lack of openness, the first thing you’ll notice about this board is that it’s full of connector headers. Instead of the small rows that Arduino uses, the Gadgeteer is meant to use ribbon cables to connect to various breakout boards. You can program for the platform in C# using the .NET framework. This means using Microsoft Visual Studio for those that are already acquainted with the platform. But regular readers will note that we’re always looking for Linux support in our IDEs and you won’t find that here.
[Thanks Hrasdt (and several others) via Slashdot]