Sensor graphing with 3 lines of code!

I’ve been looking for simple ways to graph the data from a sensor attached to a microcontroller lately, because it’s such a necessary activity if you want to look at sensor data over time. Using Apples Grapher program, which comes with OSX, I found a simple way that involves only four lines of code on an Arduino or Wiring microcontroller, and produces graphs like this:

graph.png

Continue reading “Sensor graphing with 3 lines of code!”

Ascii to Number in Max/MSP

This patch receives an ASCII-encoded decimal string that ends with a linefeed and carriage return in the serial port, and converts it to a number. A Wiring/Arduino program to send data to it follows. It’s based on an example by Jamie Allen.

To use the patch, copy the text and paste it into a new max patch window.

Thanks to David Mellis and Jamie Allen for the collaboration. These patches were written for a one-day Arduino workshop at NIME 07 hosted by the three of us. The Arduino program comes from the Arduino example files, by David Mellis.

Continue reading “Ascii to Number in Max/MSP”

Serial Graphing application for Max/MSP

This Max patch takes in serial data and graphs it. It’s useful for seeing the changes in an analog sensor. An Arduino code sample that works with it follows the patch.

To use the patch, copy the text and paste it into a new max patch window.

Thanks to David Mellis and Jamie Allen for the collaboration. These patches were written for a one-day Arduino workshop at NIME 07 hosted by the three of us. The Arduino program comes from the Arduino example files, by David Mellis.

Technorati Tags:


Continue reading “Serial Graphing application for Max/MSP”

Devantech SRF04 and 05 Ultrasonic Sensor

The Devantech SRF04 and SRF05 ultrasonic sensors are easy to use and reasonably accurate distance ranging sensors. To use them, you send the sensor s pulse of 10 microseconds on its INIT pin. Then the sensor sends out an ultrasonic pulse and waits for the pulse to bounce off something and return an echo. The sensor then pulses its ECHO pin. The length of the pulse in microseconds is proportional to the distance of the object from the sensor. The code below reads a Devantech sensor on an Arduino or Wiring module.

Continue reading “Devantech SRF04 and 05 Ultrasonic Sensor”

PDuino

Hans Steiner, God of PD/USB and a darn nice guy, has released PDuino. In his words:

“Here’s the first test release of Pduino, a Pd firmware for Arduinoand a matching Pd object, . This allows you get data from the digital and analog inputs, and send data to the PWM and digital outputs. It also allows you to change the digital pins from input, output, or PWM. And you can choose how many analog inputs and turn on/off digital input.

“Keep in mind its a test release, the only thing I am not sure about right now is digitalInput, everything else seems to work fine. In the future, I’d like to figure out how to add the pulseIn feature.

“This firmware would work well with Processing, Max/MSP, Flash, whatever. Then the Arduino becomes a dead simple, cheap sensor box for the newbies, but still open for playing later.”