SensorBox

A simple Arduino sketch and Max patches for using an Arduino as a sensor interface. Includes code for driving multiplexers as well. The provides an easily extensible example for beginners and students to build projects around MaxMSP and Arduino.

Tool Files

  • SensorBox

chrisbob12's icon

chrisbob12

2月 05 2011 | 8:57 午前

Thank for this Andrew. It's simple and easy to use. It did just what I needed.

jasonD's icon

jasonD

4月 18 2011 | 6:32 午前

Hi Andrew, I am trying to hook up four 4051 multiplexers to use with your Sensorbox but wanted to check that I have the below code right, to get all four muxes in via the Arduino A0, A1, A2, A3 analog channels. Is this correct? Many thanks in advance.

//select analog channels to multiplex
char is_muxPIN[6] = {1,1,1,1,0,0};//This is the only line of code I need to change;
//for A0, A1, A2, A3 analog pins hosting four muxes
char muxcount;//variable to store the number of multiplexed inputs

Andrew Benson's icon

Andrew Benson

4月 28 2011 | 12:14 午後

Hi JasonD, that looks right to me. If you have trouble with it, let's look at it in the forum.

carlo's icon

carlo

12月 14 2011 | 1:42 午前

Hi Andrew, I am trying to put all arduino mega's analog input to max msp , is there a sensor box built for this need?
many thanks
Carlo

edsonedge's icon

edsonedge

6月 13 2012 | 1:20 午後

Hi Andrew

I have the same question as Carlo,

I am trying to use eight analog inputs on the Arduino mega, but I can only get a reading from six (not five, as I would excpect if the code and patch was made for the standard arduino board?)

I can´t seem to figure out how to change the patch or the arduino code to acoomidate more analog sensor inputs (except I suppose the spray object needs to be changed to [spray 8] ?

All the best

kaziem's icon

kaziem

6月 28 2013 | 3:58 午前

Hi Andrew,
This works great! I have used it with 24 light sensors interface.
I am actually thinking of turning it into kickstarter project and was wondering what license there is on this Arduino sketch and Max patch. How can I get in touch with you?

All best,

sponde2nd's icon

sponde2nd

1月 05 2014 | 4:44 午後

Hi Andrew,
thanks for the nice and simple patch - very useful to be able to get this quick progress :) - I am slightly confused though that I have sensors only on 2 pins on the arduino board (0 and 2) and yet all the analogue sliders are responding! :) - 2 or 3 sliders for each pin showing similar levels. any ideas ?

Are you working on more max patches for things like arduino ? (eg for output?) ... also do you have a blog I can follow, to keep track with projects etc ? ... ie projects in general

thanks,
sponde
UK
:)
ps. is MUX simply an extended version of the other patch (to cater for more analogue inputs) ... or is more going on ?

dtr's icon

dtr

1月 05 2014 | 9:25 午後

Your other inputs are 'floating', ie. they have no reference to ground. Your seeing noise / crosstalk from the 2 connected inputs. Ignore it or pull inputs to ground to get stable 0's. https://www.google.nl/search?q=floating+input+arduino

Andrew Benson's icon

Andrew Benson

1月 06 2014 | 8:39 午後

Yeah, what you are seeing is just floating unconnected pins. It's harmless, but if it really bothers you, just tie those pins to ground and you won't see them moving around. The MUX code is for use with one or more analog multiplex chips to multipy the inputs if you need lots of analog sensors. Depending on usage it might require a little customization in the arduino sketch.

JonTayler's icon

JonTayler

1月 08 2014 | 11:48 午前

Im trying to use this to just read the value coming from 3 analogue pins, but I cant seem to get anything through. Im a bit of a novice at this so I'm sure it's something stupid. I have my arduino uno plugged in, with the standardfirmata example on. One thing i think it could be is on the umenu it doesnt have com3, 4 etc, but usbserial-a4001tfl. Is this right?
Any help would be massively appreciated

Andrew Benson's icon

Andrew Benson

1月 10 2014 | 9:13 午後

There is an Arduino firmware sketch included. Load that on your board. This patch wasn't intended to be used with Firmata.

Daniel Hoy's icon

Daniel Hoy

3月 02 2015 | 3:39 午後

Hi

I am using this sensor box patch but using it in max for live to control audio effects in ableton live for a performance at uni.

Can someone help me how to connect the pins and how get it to work in general in max for live for ableton live audio effects.

Thanks

Alejandro Reyes's icon

Alejandro Reyes

6月 02 2015 | 4:44 午後

Hi

i would like to connect my own sketch to your SensorBox patch but i would like to know where i can do it because i see that the boxes in the low side of your sketch are outputs.

Gracias

M's icon

M

6月 26 2015 | 2:16 午後

Hi there, I seem to be having an issue with the .pde. I haven't altered the file in any way but it keeps giving me the following message regarding the first line:

expecting RBRACK, found '12'

What should I do?

I'm using Mac OS X 10.10.3, the newest version of Processing and Arduino 1.0.5 if that helps any. I'm sorry if this is a stupid question, I'm very very new. So far nothing is reading in max.

Thanks!

Pieter Jansen's icon

Pieter Jansen

2月 22 2016 | 5:42 午後

Hey guys,

I don't know if this thread is alive and kicking but trying it anyways! I'm using a Bitalino instead of an Arduino. Would it still be possible to use Sensorbox then?

Thanks in advance!

Benson's icon

Benson

4月 06 2016 | 1:15 午前

How do you get this working with more than 13 analogue pins? I want to have 24 analogue pins.

I'm a noob and would really appreciate some guidance! Changing [Spray 13] to [Spray 24] in the 'SensorBoxMuxAB' patch doesn't work. Only gray lines can be connected to the sliders instead of black

Snickers's icon

Snickers

3月 06 2019 | 1:37 午前

Hi,

Where can I go to download this patch? is it available here on this thread? Am I missing something?
Thanks

Dani Ploeger's icon

Dani Ploeger

6月 12 2019 | 5:07 午後

Dear Andrew,
I made a work with your Sensorbox patch a number of years ago (this: https://fourthree.boilerroom.tv/film/dani-ploeger-electrode) It worked like a charm - and still does - but I lost the Arduino sketch and can't find it online anymore. It's still on the Arduino I used back then, so all is good for now, but just in case, would you be able to upload the sketch somewhere please (and maybe also the patch as Snickers above seems to have been looking for it)?
Many thanks and all best!

Published

2011年1月8日 00:56
Creative Commons License