Im trying to do something which is probably quite simple to you guys but Im really struggling with it in my complete ignorance of Arduino!
Basically, I have one of these:
And I want to connect it to my Ardunio Board, in order to sense proximity.
Eventually I want to take the input information and use MAX/Jitter to create a visualization, but for the moment I just want to know how to get the sensor up and running.
I am a complete and utter beginner, I dont understand any of the jargon and I dont even know which wires to put into which pin!
I realize there is alot of info out there, almost too much, but I really dont have enough time to do random tutorials, and I cant find a tutorial which specifically relates to what I want to do.
On the sensor:-
Pin 1 to the +5V of the Arduino
Pin 2 to the GND of the Arduino
Pin 3 to the Analogue input 0 of the Arduino
Then look in the playground at the program that is used to send signals from a potentiometer (pot) to the serial port and use that, it will behave just the same only you will be getting a signal proportional to the distance.
Something to note: while most IR sensors get messed up when in indirect or direct sunlight , the Sharp IR sensor emits a modulated signal and does not get messed up in sunlight. I've even used it in direct sunlight outside and it worked OK for relatively short distances.
The sun emits IR light which is what screws up the IR sensor.
Ok now Ive managed to get my readings from the sensor into MAX MSP to drive a Jitter visualization and it's working reasonably well, although Im still tinkering with the preset values to make the visualization a bit more responsive.
What I want to do now is introduce 2 further sensors so that I have an array, then I will have 3 jitter visualizations which should be able to track the movement of a hand across them.
How do I link 3 sensors to the board? Do I need a breadboard, since there is only one GND pin?
That worked like a charm. I was searching to find a way to test my sensors to make sure they were still working. I am new to this all as well so that helped out a lot!
excellent post! I've been doing some searches on how to interface IR sensors into max msp using the arduino as I am attempting a very similar project.
however rather than creating light/imagery I am attempting to use my sharp IR sensor as a MIDI controller for music applications within reason/ableton etc.
how did you go about sending the output of your IR sensor to MAX? did you need to convert this information into MIDI and then send to MAX or did you go about it another way?
So far I have been able to successfully connect the sensor with my arduino by using this following code:
I used this code to see if the sensor was working and used the serial monitor which showed that the sensor was indeed communicating the Arduino because a new line of code was being written as I moved my hand in front of the IR sensor - with the number changing depending how close or far away from the sensor my hand was.
I'm just at abit of a loss as what to do next/how to communicate with MAX MSP so I can send this information to my music software like Reason etc
Thanks alot for any help you can offer ...much appreciated!