HC-SR04 Ultrasonic proximity Teensy 3.0 MIDI

Status
Not open for further replies.

Deadp1xels

Well-known member
Hey guys,

Been creating a midi controller for my project work

It's a synth controller with one available octave on 12 buttons and 2 octave increment and decrement

I have a button with an led flashing to my midi clock and a ADXL335 with 3 available axis of parameter control with a rgb led as output.

I showed it to a friend and he passed me a ultrasonic proximity sensor he had from a failed robotics project but I can't get it working...

Has anyone got one of these working on a teensy 3.0 sending midi?? I just can't get my head around how to implement it
 
I have to admit that I have a hard time to detemint what "that" is. What is it that you want to accomplish with the Proximity sensor ?

Would you ahve a link to a data sheet ?
 
I showed it to a friend and he passed me a ultrasonic proximity sensor he had from a failed robotics project but I can't get it working...

Without a link to technical info about this sensor, it's hard to give any advice.

Even just posting a photo of the sensor, if you don't have any info, might let someone recognize it?
 
Sorry folks

Don't seem to find much on it, seems to be a cheap fleabay item

I think it being digital is throwing me off.. I'm a simple kind of fellow Haha

So basically my guess is I send a pulse high and low with a delay on the trigger pin and read from the echo... it just seems unusual to me I have idea why

HC-SR04.jpg

http://elecfreaks.com/store/download/HC-SR04.pdf
 
Your guess is correct.

You send it a pulse on its "trig" pin that must be at least 10 uS long.
It will generate eight 40KHz sound pulses and based on what obstacles are reflecting sound
It will generate a pulse on its Echo pin and you need tom measure his long that pulse is.
Then you can use the simple number in the otherwise had to understand spec sheet to calculate the distance.


They recommend that you sent not more trigger pulse than one every 60ms.
 
Seem to get something out of it, certainly not an ideal response but it's something

Just need to work on getting something more usable for the output, I have a pretty cool idea on how I would implement these in my project :)
 
Those ultrasonic sensors are great at detecting walls and other hard surfaces.

People and animals don't reflect the ultrasonic sound nearly as well. It still can work, but the range is pretty limited and the performance isn't nearly as reliable.
 
Seems to be the case Paul, seems to pretty unreliable from testing

I can't seem to get any sort of range I would have hoped, unsuprising from such a cheap sensor and the conditions

Maybe I'll change it for an IR sensor
 
Here's a link to a thread on the topic.
http://forum.pjrc.com/threads/18393

Use Ping2 with the HC-SR04 which is basically the same as ping, but breaks out the send and receive on different pins.

Playing with one of these, I can get about 4-5 ft range on soft and angled objects, and up to 12 feet on flat hard surfaces.
 
Status
Not open for further replies.
Back
Top