Jump to content

infra red sensor


Guest mferolla
 Share

Recommended Posts

Guest mferolla

This is my first message here and Im starting my midi box im still waiting for the code to record the chip.

My question is if anybody try to replace a pot with an Infra red sensor so it can change the values from 0 - 5 V or 0-127 depending of your position from the led.

i saw this in some keybord like roland, thank you very much!

Mariano  ;D

Link to comment
Share on other sites

  • 4 months later...

hi everybody...

i ordered 2 of these ir sensors the other day, hoping they would be something we could work with.

http://rocky.digikey.com/WebLib/Sharp/Web%20Data/gp2d120.pdf

they pick up objects from 4-30cm, with output voltages from ~.4V - ~3.1V.  if i understand the concept of the PIC's A/D converters, this will result in a smaller range of possible values, thereby making the unit less accurate with a smaller range.  im a beginner in electronics, but i have a fair amount of programming experience.  is there anyone here that could lead me in the right direction on how to convert this analog signal from the (.4V-3.1V) range to (0V-5V) range?  im sure this is feasible, but i dont even know where to start.

if i get good results, ill be sure to share the information with the rest of the group.

thanks,

ffuzz

Link to comment
Share on other sites

It wouldn´t be to hard to increase the voltage to a certain amount (just using an OPAmp).

But the question is, if the latency is low enough. The Photodiodes in the Roland Synthies (I owned one once - sold it) are quite slow - just hope thats because of the firmware. Would be a cool advancement for MBHP!!  :D

Link to comment
Share on other sites

Yes - I've got one of these in a Roland Handsonic.  And I've been thinking about the same thing - I intend to make a MidiBox with one in.  I thought OpAmps needed +/- volts, rather than + and ground (e.g. a +5v supply and a -5v supply rather than +5v and 0v) and I think this is the problem with using them.  However, I think you know more about this than me, Pay_C, so feel free to correct!

In fact, why don't I share with you my idea for a MidiBox, because I'm going to have the same problems:

I want an IR sensor to wave my hands at

2 joystick controls (I like the idea of X-Y simultaneous control of midi parameters)

2 touch strips (again, like the Roland Handsonic and other Roland Stuff)

The IR sensors and the touch strips both have the same problem of output voltage range.  I think I will have the same problem with the joysticks because the Pots inside wont go through their entire range.

I was hoping there was some way of scaling the values in MIOS, but I haven't looked into it enough (at all!) to know if this is possible.

If I understand correctly, the PIC ADC converts 0v to 5v to a 10 bit number (0 to 1023 decimal) which is quite a bit bigger than the 0 to 127 usually required in midi control codes.  In fact, a change of 1V on the input will give a range of approximately 204 once converted.  So 0.4v to 3.1v should give a data range of approx. 81 to 330 decimal.  So it should just be a matter of doing some maths in the firmware to get the range you (and I!) want.

Heres another possible solution.  The PIC18Fxxx data sheet says that the reference voltage for the ADC is software settable.  I think this means you could tell it that 0.4v should be taken as zero on a conversion.

I've not tried any of this, and I've got to start building my cores before I can even try.  If I'm talking rubbish, please somebody shoot me  ;)

Steve.

Link to comment
Share on other sites

About the OPAmps:

There are OPAmps (I just forgot the name of them now... ... argh ... ... nope, forgot it for the moment) which are running on monopol voltage (0 and 5V). And again *there* are two different types. The first one just amplifies from 0 to 5V. The second one produces the negative voltage in the IC and so can go from -5V to 5V (with a 0 to 5V supply!).

So thats no problem.

The touch strip:

... is no problem because the most touch strips are just touch resitors and can so be used like a (or two) normal pot(s). There already were some topics about that in the forum. The only problem is the price of them. They´re not the cheapest.

The joystick:

Yes, there is a built-in routine in MIOS to correct this. Its called deadband-value or so. Just download one of the examples with AIN and there you will see it.

The range:

Also everything already in MIOS. But that firmware solution of the PIC18F?? ... TK? Anything about this?

The shooting:

Certainly I can help you with this point. Where do you come from?  ;D ;D LOL

Hope this was helpful.

Link to comment
Share on other sites

Certainly, didnt say this wont work...

It´s just better to gear up on the hardware side, because on the firmware side you´ll loose resolution (also this doesn´t matter to much if you dont stress that point to much).

But certainly this also works.

Link to comment
Share on other sites

OK, a couple of things I've found out.  There are a few variants, and one of them produces 8 bit serial data.  To get this to work, the input line has to be lowered, then the PIC will have to wait 70ms, then the detector has to be clocked 8 times (I guess once for each bit) to read the data.  I guess that's how Roland are doing it and why the latency isn't great.  I think it would be different with the analogue one, since MIOS will be handling everything in microseconds (amazing TK!!!)

There are two other things to bear in mind with the IR sensors.  First, within about 3cm the sensor will output a voltage as if the distance detected is far away.  Secondly, the output is non-linear.  But to be honest, waving your hands around is not exactly an accurate way to control anything anyway.  Certainly I've found that it's very hard to accurately repeat any movement for a consistent sound with my Handsonic.  Thats a limitation of my arms and brain rather than the sensor.

The real point is that people think it's really cool to see someone controlling a sound by waving their hands around.  It's not a way to be controlling a space shuttle, but it is fun.  Taken from this point of view, none of these things should be an issue.

However, whilst I was on this site I've had another idea for a crazy controller.   First check this out:

http://www.acroname.com/robotics/parts/R40-PG2033.html

Guess what I'm thinking?  How about a handheld controller (or two!) with 3 gyros in each - yes, really expensive, but fancy filter sweeps in response to your dancing, rather than the other way around??  I think this would be COOOL.  Mind you, I think I can dance  ;)

It's like being at school again....I'm learning all the time....THIS SITE IS SOOOOOO COOOOOOL!!!

OK, I'm just gonna get one, since it's part of the design of my Midibox, then I'll experiment.   ;D ;D ;D

Link to comment
Share on other sites

So, thats making the big latency times... thnx for that!

About this 3cm thing: Accuracy? Whatever, nobody needs that and nobody will use the infrared sensor for mixing, I think.

If you would be able to build it the analogue way, that would be such great. You can move your arm (hand) much faster than an pot.

Some sportstime coming up for the MBHP people! ;D

Link to comment
Share on other sites

0v-5v      

at 10 bit accuracy = 0-1023

.4v - 3.1v

at 10 bit accuracy ~= 81-635

81-635 = 554 discrete values for the sensor.

554 > 128 so there should be no discernable loss in quality.

software should handle the ir.

i still have no 10mhz chip, so i cant test this with mios yet.  as soon as i can get one, i will let you all know the results.

as for the distances--you could either:

A: mount the ir sensors inset in the unit 3cm or

B: let the software handle the values (0-81) just like a zero.

-ffuzz

Link to comment
Share on other sites

thanks for the info ffuzz, and the maths correction  :-[

I think mounting it deeper in the box is a good idea (except not sure I've got 3cm spare in mine!).  These sensors will say anything under 3cm is 60cm away (example), so it won't convert from 0 to 81, but will convert to 400-500 or something similar (I'm not risking accurate maths again!!!)

Look forward to your results ffuzz.

Some sportstime coming up for the MBHP people!

LOL :D Midi box olympics anyone??

Link to comment
Share on other sites

Hey fellas :)  if this comes to fruition, I'd love to include it on my sequencer (really I must think of a name for this thing!)...

Actually I've been thinking a little about a device with an array of beams like this, which would allow a grid to float in the air which could be used for traditional stuff like controllers, positioning notes (like a big piano roll in the sky heheh) or for triggering different sounds from different areas (Like air drums)...

I also recently saw a new device being made by some university students which used a magnetic array which works like the one I spoke of, with several metallic objects to mark the points... It also had a projector screen relaying info to the operator..nice.. ... But aaaanyway.... :-X ;)

If any help is needed or if anyone has some success which they'd like to share, it would be appreciated as always :)

Link to comment
Share on other sites

Your array of beams idea sounds like Jean Michel-Jarre's lazer harp, where he breaks a lazer beam with his hand to play a note.  Of course he has to wear asbestos gloves.  I guess infra red detectors/emitters might be safer and cheaper but I don't think the light from LEDs is coherent enough to prevent overlap of light from adjacent LEDs to the detectors.

Steve.

Link to comment
Share on other sites

IR LASER LED's with focussing lenses should do the trick, though it wouldn't be able to be anywhere near the size of JMJ's laser harp due to lack of power...

Yeh it is kinda like that, only instead of harp-like "strings", it would be drum-like plates, each defined and separated by the beams of light... Of course this way you could make three-dimensional zones, like invisible boxes, floating in the air which could act as triggers whenever they are entered etc...

I just thought of something...A spot of coding could involve moving them around...hmmm..... imagine sitting down to a chess board with little floating boxes of light you could move around as controllers.......

Link to comment
Share on other sites

Hello All!

I have been looking over your conversation, and I see that everyone is interested in utilizing infra-red.

As for the Grid Idea:

Roland MC-505/ MC-909 D-beams allow control of controller value, and note on/off messages. So making a grid like you said to have a piano roll would depend on the amount of notes that you would need to trigger.  As for the input for the infra-red and its actual values. I believe that an op-amp would be the easiest method of getting the values to 5v. I am unsure what to do for the lower end of the spectrum however.

Well Good luck guys, I will look around and see If I can find any info to help out.

I am interested in seeing some infra-red boxes in the gallery.

-Sephult

Link to comment
Share on other sites

*dreaming of crazy insane noises and filtering made with a device full of IR sensors*

hehehe

it would really rule to have some kind of matrix thing with, say, 3X3 IR sensors sufficiently spaced sending weird midi signal based on interaction between each IR sensors... dunno what that would give in reality but I think it would be quite fun to experiment with those...

We need to document experimentations with IR sensors on the MB :) I will join as soon as I finish my base midibox hehe

Link to comment
Share on other sites

  • 9 months later...

I know this is an old thread but.. I just needed to comment. JMJ's lazer harp didnt work. I know from a very reputable source... my brother has worked with him on his Lyon concert (Houston/Lyon album). The main problem was crosstalk between each receiver... It was fixed to get it working for note triggering, but the velocity never worked. It looked damn good though.

And the gloves were for better reflexion of the lazer.. not to protect his hands since the lazer was not strong enough for that. The beams were wide, and therefore not as powerful.

Marc

Your array of beams idea sounds like Jean Michel-Jarre's lazer harp, where he breaks a lazer beam with his hand to play a note.  Of course he has to wear asbestos gloves.  I guess infra red detectors/emitters might be safer and cheaper but I don't think the light from LEDs is coherent enough to prevent overlap of light from adjacent LEDs to the detectors.

Steve.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...