Go Down

Topic: XY Plotter Arduino vs Processing (Read 2671 times) previous topic - next topic

opkach

I have been researching/reading through the forums a bunch recently and was curious about which was better to use to create and xy plotter, Arduino only code or Processing only. I understand you can code the arduino board you have into Processing but haven't stumbled upon a definite response if you can use the Arduino code only to do it. Why I asked is that I want to use an Arduino, grouped with various sensors (temp/ambient light/humidity/etc), to be routed to Max/MSP and then routed back to the Arduino to affect the plotter. Does that sound like it is possible? Or is it more likely I will need to use Processing to analyze the correct parameters. My goal is to use the sensor data, which will be scaled, to create a small drawing based on these sensors. Thanks for reading!
- opkach

Grumpy_Mike

Quote
I understand you can code the arduino board you have into Processing

No you can't.

Quote
a definite response if you can use the Arduino code only to do it

Can you say more clearly what "IT" is.

You can talk to Max/MSP direct to the arduino because all it is, is a serial port. So I don't see why Processing has to get involved, unless you need to include any PC based components like a web cam.

However, as you haven't said what this X-Y plotter needs to do it is all speculation.

opkach

First off, thanks for the response and patience with my stupidity.

Sorry if I was unclear but I wanted to ask the general question before I dove into what it was used for and I outlined it partially. I want to use the Arduino to acquire audio data from a microphone (integers, not  audio) then use the data stream, scale it, and have the data trigger specific plot points. I know you can talk to Max/MSP, I already have it setup to parse the data but I want to figure out how to route it plot movements and points from Max/MSP. So when I draw a line, the stepper as well will draw line, to receive some type of response, if any, would be greatn. I have looked into maxuino as well and I have a bunch of examples from professors but I can't figure out how to communicate with the steppers using Max/MSP. You can probably do it all within the arduino but I was just curious in general if it were possible. Also, the Processing part was unclear as well since it seems like I stated it backwards but you can have them communicate. Just trying to find out which way would be more efficient to plot points on an xy plotter, Processing/Arduino or Arduino/Max.
- opkach

Grumpy_Mike

Sorry still not too clear, this line is difficult to understand
Quote
So when I draw a line, the stepper as well will draw line, to receive some type of response, if any, would be greatn.

Is the plotter a stand alone device or have you made one with an arduino?

Quote
I want to use the Arduino to acquire audio data from a microphone (integers, not  audio) then use the data stream, scale it, and have the data trigger specific plot points.

Are you talking about the envelope of the sound rather that the individual samples?
If so then there is not much processing to do and the arduino can do it easly.
So if I get it right you want to draw stuff depending on the volume of inputed sound?

opkach

Its not your bad, I am explaining it poorly, plus for me its hard to conceptualize entirely since I am trying to just understand the process of how to make them interact first.

The plotter would be made using the arduino with 2 stepper motors using the EasyDriver board (http://www.sparkfun.com/products/9402). So the steppers would be attached to the arduino using the easy driver board.

Yes, you are correct. I am using a microphone breakout sparkfun (http://www.sparkfun.com/products/9964) and the .pde I originally used to acquire the data, which is amplitude, is from the Arduino Cookbook. I was thinking about doing DSP related processes using the Arduino but I haven't looked into it that much and I wanted to used Max/MSP to do that. That being said, thats why I am using the streaming data from the electret microphone. At this point I am just gathering the data within Max/MSP but now I want to send it back to the Arduino so it will plot a point based on the amplitude data.

It all boils down to taking the acquired data from the microphone (amplitude) that is hooked up to the Arduino, this data is read by Max/MSP, and then is sent back to the Arduino where it will plot a point. Does it make sense? Would this work using MaxMSP to send the data back out to to a plotter? I know you can do it with servos but I haven't explore it too much but I should do that tonight since I will have some time.

Sorry if I am persistently confusing. I really really realllllyyy appreciate the help and thank you a ton for the response!
- opkach

Grumpy_Mike

Streaming individual audio samples to the computer is going to be a very intensive operation. Have you calculated what data rate you are going to have to do this at? It is probably more than the arduino / your computer can cope with, and that is without doing anything else. I think you would be much better off doing this with the sound input on your computer. The plotting data will be very slow in comparison. It has to be anyway because the plotter will take quite a time to physically move to a point.

Quote
I was thinking about doing DSP related processes using the Arduino

I think this represents about the limit of what you can do and that takes up all the processing power:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/

opkach

Thanks for the info and the link! I wanted to DSP in other programs anyways but it definitely saves me time researching.

Well a possible compromise would be taking in the amplitude data but only record the stream for a certain period of time then use that acquired data. So essentially make small pools of data that can be used instead of being overwhelmed by the stream in general.

My main concern at this point is still the servo motor. I have been trying to setup the motor correctly using Maxuino but I am unable to get the program to control the servo correctly. Do you have any experience with this?
- opkach

Grumpy_Mike

Make sure you can control the servos just from the arduino to make sure your hardware us working. Use some simple servo code.

opkach

I eventually figured it out how to control the stepper motor and thought you may be interested in the results.

https://vimeo.com/45546225

opkachwt.blogspot.com
- opkach

Go Up