Sensors > Arduino > Raspberry Pi > Pure Data

I was wandering if possible ( I guess the answer is yes) and how complicated is the following:

Using an Arduino to receive a data from outside world(sensors). The data from the Arduino to be send to pureData which will be installed on a Raspberry Pie 2.

I have a project involving playing multiple audio files at once. My go to option was to use WavTrigger but I might need extra manipulation on the audio files rather then only a volume control and play/pause/stop the files. This is the reason I think about using Raspberry Pi with Pure Data instead of the WavTrigger.

What do you guys think?

I must say I have never used either Raspberry Pi nor Pure Data, but I do have some experience in the software Max/MSP.

Thanks

I have use Pure Data in this Mag Pi article
Magnetic bounce Therimin

This builds on the original application from the previous month
Magnetic Bounce

Thanks for those links!

What is this chip you are using to get the sensors data to the PD installed on the Raspberry Pi ?

In arduino in order to received the data from the outside world(sensors) you need to write the code in the arduino ide .
When using max msp with arduino I could either use Maxuino or using the Serial object. Either way I needed to use the Arduino.

How you can get the data from sensors into PD installed on the Raspberry Pi without using an arduino?

Edit:
Does a Raspberry Pi 2 Model B 1 GB is enough to run pd and doing some audio stuff (such polyphonic synth or playback multiple audio files with some audio effects?)

See post #6 for this question.

Note you need an Audio I to USB adaptor to get the sound into PD. The type that are sold for recording audio into any computer when you don't want to use the built in microphone.

It certainly can generate audio and record it as well as adding effects. If it can handle everything you need is another matter.

How did you pass the data from the sensors to pure data?
Did you use the Raspberry Pi pins? Does it got analog pins(like in the Arduino A0,A1 etc) or it got only digital pins (GPIO) ?

Yes only digital pins.

In the Magnetic bounce article I say where about the A/D converter, I say can be found:-

This circuit connects to two Analogue to Digital converter channels connected to the Raspberry Pi's GPIO pins. If you don't have one already then you can simply use the one described in the Drum sequencer project in MagPi 68.

So that will be:-
Drum sequencer

There is no need to use an Arduino connected to the sensor, you need to connect it to an A/D converter on the pins of the Pi.

There is no need to do so but is an option?

I have a little confusion, I hope I will try to explain it.

In the arduino if I am connecting the middle lug of a potentiometer to A0 and the other two lugs to +Vcc and GND I could read a continuous data of voltage between 0 and +5V that is represented as numbers between 0 and 1023 (10 bit number)

how does it work in the Raspberry pi using the ADC that is connected to the pin called "spi gpio" (what is that?)

the ADC is converted the variable voltage between 0V and +5V to on off state that later on will be represented again in the Raspberry pi (or in our case in the pure data software) as continue numbers between 0 - 1023 ?

if I want to use the arduino for reading the analog data from sensors how can I pass it to the Raspberry pi (and to pure data)? connecting the arduino TX pin to one of the spi gpio at the raspberry pi?

hope my confusion is clear enough.. (strange selected of words, I know )

The SPI and other pins on the Pi are the interface to the A/D converter. You connect your sensor to the 3V3, the GND and the input of the A/D converter.

Yes.

Yes connect the USB of the Arduino to the USB of the Pi and send the numbers over serial.

If I would like to use the USB port for powering the arduino and the Raspberry pi, is there other way to pass the data from arduino to Raspberry Pi? TX from Arduino to ?_ on the Raspberry pi?

You can't power the Raspberry Pi from the USB, it doesn't work like that because the Pi is a host USB not a client USB.

So connecting the USB from the Uno to the Pi will power the Uno.

Yes you need to use the Serial data GPIO pins, but you have to cut down the 5V TX from the Arduino down to 3V3 before it is connected to the RX pin of the Pi. Use a potential divider with a 1K and 510R resistor. But you still need to power the Pi with its own power supply so there is no point.

Is it possible to power it via the micro USB port using a phone charger(5V) ?

if so, so I can power the Pi via the micro USB port, then connecting the Pi +5V pin to the Arduino Vin pin and then use the Arduino pico mini USB port or the arduino uno USB port to connect to the Raspberry Pi USB port for communication between the two?

No.

NO.
Phone chargers are nominally 1A capable, you need 2A or more to power the Pi.

No - that will under power the Arduino, you could connect it to the Arduino 5V pin.

Come on be serious. Plugging the Arduino's USB into the Pi's USB will power the Arduino like I said before.

Please read about the raspberry Pi, and how to set it up.
Powering the Pi

EDIT: MY MISTAKE - the ability to charge via the micro USB port using 5V @2A is not true to the Raspberry Pi 2 MODEL B

In the link to the page you shared Powering the Pi it shown a possibility to power the Pi from the Micro USB using 5V 2A charger isn't it?

Assuming I have a charger that is capable delivering 2A @5V I will be able to power it that way

Why it will under power the arduino? is it because the Vin pin is passed through the on board regulator and therefore should be a voltage higher at least 2V above 5V?

Yes, it also has a series diode that removes a further 0.7V.

Yes.

I am seeing that the Raspberry Pi 2 Model B got no sd card slot. edit: there is a micro sd card slot on the back of the Raspbbery Pi2 model B.

If I would like to run pure data on it and playback some audio files. how can I do it?
Can I place the audio files on the Pi desktop and read those files in pure data from a buffer or something similar?

Look at this online book. Section3 deals with audio including loading an playing files.

PD tutorials

Well putting them in a directory would be much better than the desktop. But in essence you can do this.

By saying directory you mean a folder? if so - that folder could be placed on the Desktop?

Does the internal 1GB memory of the Pi 2 model B is enough for running Pure Data and reading audio files (that could be up to 512MB size) or I should installed the pure data and placed the audio files on external micro sd card?

Yes but in the Linux world they are called directories.

Yes but why? It s a very immature thing to do.

No idea, try it.
But your SD card can store that size of stuff. You would be, in my opinion, better off getting a larger SD card than adding an extra card reader.

Thanks. I just ordered the Pi 2 model B and an 16 GB micro sd card

Is there any tutorial you are recommending for setting up the OS and general stuff to read/watch for new people in the field ?

Try this first:-

Then there is always my book:-
Raspberry Pi for Dummies 4th edition

And Phil King's book
Raspberry pi beginners guide

But any search for

raspberry pi getting started

Will bring in lots to read.