Ultrasonic situation

Hi,

Im fairly new to arduino, and electronics (started about 3 weeks ago). When I ordered my board, I asked the company to add a few components and sensors that they think would be a nice "starter pack". One of the items I received in here was an Ultrasonic sensor. However, it does not contain any information regarding part number, or even manufacturer. Its only the transmitter and receiver. The only markings on it is the Tx and Rx on the bottom. Now, Im trying to construct a board, but I am unable to find schematics anywhere, except for this : EDIT - Unable to post my link here due to me being new to the board. Will try and post it on a reply /EDIT. However, with my noobness with electronics and arduino, I am uncertain if this will work with the arduino. From what Im assuming, I connect the PWM to my pin 8/9, and the PULSE on my pin1. I should manage to change the code supplied on the site to the arduino (I dont have a problem with coding). Will this work? Am I going to right way? Or should I hold a fire extinguisher ready before I try this?

Thanks in advance,

Skoll

As mentioned above, here is the only schematic I found

For that to work, you'll have to generate your own pulse of 38-40kHz - the PWM frequency is very much lower than this at around 400Hz.
Getting accurate loop timings at that speed is tricky (one cycle is aabout 25us long).

Well, what would you suggest? All I want from this, is a way for my bot to be able to detect obstacles. By the sound of it PING((( is the answer, but getting hold of that in South Africa is a nightmare. How about infrared? Can I do some form of obstacle detection with that? And why would I want to go IR, or not, instead of US?

By the sound of it PING((( is the answer

Pun alert! :slight_smile:

It isn't impossible, but changing the PWM frequency isn't easy for a beginner.
I don't know how easy it will be to get sufficient sensitivity, but echoes are weak unless you can get lots of oomph into the outgoing pulse.

How about the Devantech range?
http://www.robot-electronics.co.uk/acatalog/Ultrasonic_Rangers.html

I've been doing a little thinking about a similar problem: using an IR LED to simulate a consumer remote. The LEDs want much more than the 20mA an Arduino pin can supply, and generating the 38kHz is a pain (as others have pointed out). So my plan is to set up a 555 timer as a 38kHz oscillator, and use a TI 75451 to drive the LEDs. That way, the Arduino only has to generate an "IR on/off" signal on one of the digital pins.

You could do the same thing to drive the "Tx" transducer. If it doesn't need much current, you could use a regular TTL/CMOS AND gate, instead of the 75451.

Ran

You could do the same thing to drive the "Tx" transducer

Good point: Some designs I've seen use MAX232 chips to drive the ultrasonic tx.

Skoll, give us some idea of what you can get hold of, and we may be able to help better.
I've got some circuits somewhere that use op-amps and 555s - I'll see what I can dig out.

Hmmm. Well, prebuilt "kits" like the PING((( is almost out of the question. When checking the local guys for anything "ultrasonic" related, all I get is the tx and rx I already have.

Im not sure how to answer you, to be perfectly honest. I can give the three main suppliers sites, if that will be of any help :

Rabtron : http://www.rabtron.co.za/
Yebo : http://www.fort777.co.za/
Communica : http://www.communica.co.za/

Thanks for your help so far! Greatly appreciated
:slight_smile:

I'd have to say that unless you have access to an oscilloscope, the roll-your-own approach may prove very frustrating.

Ive spoken to a few engineering friends of mine, and they told me the same thing ... without an oscilloscope, Ill just be taking shots in the dark. It would appear that ultrasonic is not the way to go. Im looking at infra red solutions now, and it seems to be much simpler and cheaper. However, none of the suppliers stock IR detectors. groan. I have an old madBot lying around with an IR detector on it. Maybe Ill just salvage that.

Any other solutions or ideas is more than welcome

If you have IR-led you can use it as IR-detector
You need to amplify the signal of course with an op amp.
I did try this approach from this site:

Does not the servo library have pwm that is in the 40 khz range?
It is worth a try.

D.

Does not the servo library have pwm that is in the 40 khz range?

No, about two orders of magnitude lower.
And it's PPM, not PWM.

Sorry, my mistake :smiley:
Not used the servo in my projects, just on my rc-plane :wink:
Just used steppers.

  • I am just doing my Bahelors degree final year in process-chemistry not electronics :-[
    (that's why my projects are mostly a bit chemistry oriented)

D.

Yeah, I'm going to have to agree, without an oscilloscope you're going to have a really hard time with this.

I recently did a project for school in which I had to create an ultrasonic remote control based on very similar Tx/Rx components. I ended up using a 555 circuit to produce the 40kHz pulse on the Tx end, and that was actually the easy part. On the Rx side, you definitely have to amplify it because it'll give you a sine wave of about 50-500mV. I amplified mine once and then used a comparator to give me a square wave that I could read with a microcontroller. The whole thing was pretty complicated to build, and there's no way I could have done it without an oscilloscope.

Oscilloscopes have become less expensive with technology offering more features and can be purchased from companies importing from manufacturers directly at reasonable prices. You can try Test and Measurement Instruments C.C. (TMI) in Johannesburg.