Go Down

Topic: Arduino, Maxuino, Firmata and Sensors (Read 1 time) previous topic - next topic



I have been struggling to get the max serial object to read any data from the analog inputs on the Arduino board for weeks now and can see from previous discussions that I am not alone in this. I have tried every solution suggested on both the Arduino forum and also the Max forum to no avail.

I have now got Max talking to Arduino using Maxuino and standard Firmata however there are two things which don't seem to be functioning as I would anticipate.

The patch I am using is from a tutorial found here:


I have the Arduino Mega also - but this is not working with the patch beyond analog input 5 despite extending the patch to account for the additional inputs - so I am back to Duemilanove with fewer inputs.

The inputs need to be ready to receive the data from all analog inputs and these are enabled by toggles in the patch, however when for example I have a sensor in analog input 0 the numbers are fed to the number box for that analog input with the aim of triggering other things in a separate subpatch. The problem is that if all 6 inputs are enabled and I insert for example a sensor into analog input 0 the data is fed to all the analog inputs which are enabled, and then when the second sensor for example in input 1 is triggered it will do the same overwriting the data sent from input 0 as it sends to all the inputs , and so on for all the sensors , which is not what I want.

I am trying to think of a solution such as a gate or switch or something which will resolve this and ensure that data from analog input 0 is fed to the right output and not to all the others as well. If I was using just one sensor i could have the other outputs static ie not routed to anything else in the patch but they should all have inputs routed to their :( corresponding subpatches which will be triggered by different sensors.

Also .. can anybody who is using Arduino and Max please clarify the actual process when uploading to the board and then using Max. ie are you supposed to upload to Arduino, select the correct serial baud rate, then press send to the right of the page. Are you then supposed to close Arduino Firmata down and then open Max as when using Arduino in stand alone or with Processing I am not sure whether you are supposed to do this or if in fact it makes a difference.

Any suggestions on this would be great.

Thank you very much in advance... I have also posted this on the Max forum for greater success rate in hopefully resolving.



The problem is that if all 6 inputs are enabled and I insert for example a sensor into analog input 0 the data is fed to all the analog inputs which are enabled,

Do you mean that you have nothing connected to the other analogue inputs? If so then yes it is how the hardware will behave because it will still have the charge on the sample and hold capacitor when the multiplexer switches to the unconnected input. That is how hardware behaves.

So you can either not enable analogue inputs you are not using or connect unused but enabled inputs to ground (or + 5V). Alternatively you could fit a high value resistor from the analogue input to ground, say 20k to 47K and that should stop unconnected inputs giving a reading based on the last sample taken.



Thanks for your reply.. yes at the moment I have nothing connected to more than one input at a time but I will have other sensors connected for the final patch.  I have just tried your solution of grounding the other inputs that don't have sensors currently connected, and it sent just the data to my max patch from the input which did have a sensor connected.  I will now try adding the additional sensors to see if that works which i am sure it will, as it now makes sense.

Once again thank you.




You have described the process correctly, load Firmata onto the Arduino and then close the arduino IDE and after you do that once, as long as you do not load anything else onto the arduino board, it will continue to run as a standalone.  then you can start and stop max all you want.  I am sorry I have not been able to update the maxuino, but firmata on the mega is still shaky at best.  



Thank you for your reply .. at least i now know that I have been following the correct process for uploading etc.  I am going to use the Duemilanove for this project and leave the mega until it is more stable, hopefully for my next installation.


Go Up