PDA

View Full Version : A few questions about schematic


maverick99
Nov2-05, 05:20 PM
In one of my design classes, I'm building an ultrasonic radar. I looked online and found a decent schematic for it and I have a question about it. In the schematic I circled two things that I have no clue why they are there. I'm not sure how to connect the Vcc and ground to that part of the nand gate. I have no clue where or how to connect them in my circuit. Can someone explain to me why they are there and how to hook them up?

http://i27.photobucket.com/albums/c180/maverick9900/22.gif

Here is the original site

http://www.electronics-lab.com/projects/sensors/007/

mugsby
Nov3-05, 02:07 AM
i think your getting the symbol of the nand gate confused. pins 7 & 14 don't belong to the input of any of the nand gate but is the power supply for all the gates. just hook pin 14 up Vcc show as the circled 1 and hook pin 7 to ground shown as circle 2.

it's weird that you would have a problem with the nand chip but don't ask about the op-amps. also what does the darlington npn collector connect to circled pin 9. :confused:

maverick99
Nov3-05, 08:36 AM
i think your getting the symbol of the nand gate confused. pins 7 & 14 don't belong to the input of any of the nand gate but is the power supply for all the gates. just hook pin 14 up Vcc show as the circled 1 and hook pin 7 to ground shown as circle 2.
it's weird that you would have a problem with the nand chip but don't ask about the op-amps. also what does the darlington npn collector connect to circled pin 9. :confused:

I am wondering about that npn transistor pin too. Anyone know? Or could someone supply me with a better schematic?

berkeman
Nov3-05, 10:07 AM
I am wondering about that npn transistor pin too. Anyone know? Or could someone supply me with a better schematic?
That's not a very good ultrasonic radar circuit. The Darlington output stage looks like you would hook up some output indicator to it, like an LED or buzzer or something. The output collector of the Darlington probably pulls low when the received US signal varies too much.

But having the transmitter piezo and the receiver piezo so close together on the same PCB will severely limit the sensitivity of the "radar". A better design would seperate the TX and RX parts of the device, at least by a meter or two. And it seems like it would be better to have two RX units, and compare their outputs to determine if there was movement going on....

maverick99
Nov3-05, 02:59 PM
That's not a very good ultrasonic radar circuit. The Darlington output stage looks like you would hook up some output indicator to it, like an LED or buzzer or something. The output collector of the Darlington probably pulls low when the received US signal varies too much.
But having the transmitter piezo and the receiver piezo so close together on the same PCB will severely limit the sensitivity of the "radar". A better design would seperate the TX and RX parts of the device, at least by a meter or two. And it seems like it would be better to have two RX units, and compare their outputs to determine if there was movement going on....

Do you have or know of any other designs I could use? Anything at all would be helpful :smile:

berkeman
Nov3-05, 03:36 PM
Do you have or know of any other designs I could use? Anything at all would be helpful :smile:
Depends on what you want the "ultrasonic radar" to do. Do you want it for rangefinding, or for motion detection like for an alarm system?

maverick99
Nov3-05, 08:19 PM
Rangefinding

berkeman
Nov3-05, 10:09 PM
Rangefinding
Wow. Then the original circuit definitely isn't what you want. I googled the following:

ultrasound rangefinding circuit design

and got lots of hits. This first one looks like a great place to start:

http://www.stanford.edu/class/ee122/Final_Projects/Bens_Ultrasound_Dossier.pdf

Have fun!

maverick99
Nov4-05, 12:48 AM
Is this what I want?

http://www.technobots.co.uk/index.html?lang=en-uk&target=d695.html

or maybe this site???

http://www.interq.or.jp/japan/se-inoue/e_pic6_6.htm

Edit: Here is the info from my worksheet about this project:

For this project you will create a radar set using an ultrasonic transmitter/receiver received from the instructor. Radar operates on the principle of sending out a pulse and then timing how long it takes before the echo is received. The longer the time, the further the distance. The initial pulse needs to be fairly fast. The counter also needs to be fast.
The ultrasonic transmitter/receiver will be mounted on a shaft attached to a stepper motor. The stepper motor needs to be able to sweep across 180 degrees as the radar is transmitting.

Grade based on, Distance Ranging (25ft), Stepper Sweep (0 to 180deg), Display on Oscope.

berkeman
Nov4-05, 11:50 AM
Yeah, those both look like good learning kits. I especially like how the first one made it a point to improve on the Polaroid rangefinder.

Since your prof is going to be providing the transducers, will you be allowed to use a canned kit, or do you need to build it from scratch, using the kit as a learning tool to guide your own design? What uC are you supposed to use? Do you have the stepper motor part figured out already?

maverick99
Nov4-05, 02:41 PM
Yeah, those both look like good learning kits. I especially like how the first one made it a point to improve on the Polaroid rangefinder.
Since your prof is going to be providing the transducers, will you be allowed to use a canned kit, or do you need to build it from scratch, using the kit as a learning tool to guide your own design? What uC are you supposed to use? Do you have the stepper motor part figured out already?

I'm supposed to basically build it from scratch. My professor gave me the transducers, the stepper motor, and two chips for it. The first chip is the L298 Dual Full-Bridge Driver.
http://tinyurl.com/e42un

The other is the L297 Stepper Motor Controller.
http://tinyurl.com/bzokx


Edit:
Another person showed me this schematic.
http://www.leang.com/robotics/info/articles/minison/minison.html

It's supposed to be for a robot but he said it should work and it looks easier then the previous schematics. Your thoughts?

berkeman
Nov4-05, 04:22 PM
I like the LM567 in the MiniBot schematic. The piezos are probably pretty narrowband, though, so I don't know how much more noise rejection the 567 will give you overall.

What is the output of the range supposed to be? Are you supposed to use a microcontroller to do the stepper motor control and calculate range versus bearing? How are you supposed to present the information? Do you need a USB connection to a PC to display the data, or are you supposed to drive a small display? Sounds like a fun project. How long do you have to get it done?

maverick99
Nov4-05, 04:44 PM
I like the LM567 in the MiniBot schematic. The piezos are probably pretty narrowband, though, so I don't know how much more noise rejection the 567 will give you overall.
What is the output of the range supposed to be? Are you supposed to use a microcontroller to do the stepper motor control and calculate range versus bearing? How are you supposed to present the information? Do you need a USB connection to a PC to display the data, or are you supposed to drive a small display? Sounds like a fun project. How long do you have to get it done?

What is the output of the range supposed to be?[/e]
I'm not sure about that.

[i]Are you supposed to use a microcontroller to do the stepper motor control and calculate range versus bearing?
I wasn't given any info on that. All I know is that the stepper motor has to sweep 180 degs back and forth.

How are you supposed to present the information?
I'm guessing that I'm just supposed to make it sweep the 180 deg and while it is doing that, It should detect objects within it's path.

Do you need a USB connection to a PC to display the data, or are you supposed to drive a small display?
My professor never said anything about a USB connection, so most likely the small display, such as a led or a few 7 segment dispays.

How long do you have to get it done?
Until the end of the semester, which is around a month and a half.

berkeman
Nov4-05, 04:57 PM
How long do you have to get it done?
Until the end of the semester, which is around a month and a half.
Well in that case, you should start experimenting with driving the TX piezo, and see what the best way is to get a short loud wavelet pulse out of it, and start experimenting with input preamp and filtering stages to see what kind of RX sensitivity you can get. Do all this experimenting with an oscilloscope and simple components, and then use those results to guide what you do for the rest. And ask your prof the questions I was asking -- it may be that he's leaving out that part of the assignment to see how creative people get. Like, you might get extra credit if you did use a microcontroller like a PIC that also has a USB port, and you graphed the data real-time with a Tcl or C program on your laptop or something. Maybe even make it look like a real radar display, with the line sweeping through bearing, and blips staying persistant where you are getting echos. Maybe even designate them as targets, with little airplane symbols and friend/foe and ....... oops, sorry about that. Sometimes I get carried away :-)

maverick99
Nov4-05, 05:15 PM
First of all, what are piezos? :)

Second, how should I go about putting a 9V and 5V High in the circuit? Do I just use two separate power supplies?

berkeman
Nov4-05, 05:30 PM
First of all, what are piezos? :)
Second, how should I go about putting a 9V and 5V High in the circuit? Do I just use two separate power supplies?
I can't tell by the smiley if you're kidding or not, so I'll answer about the piezos. Piezoelectric transducers are what is used for the ultrasonic TX and RX elements. A piezoelectric crystal (or sometimes polymer) changes size with an applied voltage. Piezoelectric crystals are used for clock generation (like the 32kHz crystal in your watch, or the 10MHz crystal on many microcontroller boards), and when made big enough, they can be fairly efficient at coupling ultrasonic sound waves into the air. I don't know if your ultrasonic transducers have built-in oscillators or if you need to drive them at their resonant frequency, but it the prof gave you the datasheets, it will talk about how to use them. Come to think of it, start with the part datasheets and see if they have application information on them. Or go to the manufacturer's website and look for application information. They will show you the optimum TX and RX interface circuits.

And on the power supply question -- initially just use two outputs from a bench supply. Eventually you will need to include a power source and voltage regulators on your final project assembly.

Also, look around some for application info on whether it's worthwhile to have a directional antenna structure for the RX piezo. Like, even just a few inches of plastic tubing. That will give you better resolution on the bearing of echos.

maverick99
Nov5-05, 11:12 PM
And on the power supply question -- initially just use two outputs from a bench supply. Eventually you will need to include a power source and voltage regulators on your final project assembly.


Why would I have to include a power source and voltage regulators on the final project assembly? Wouldn't it work fine if I just used the 5 Volt line from my power supply and used the other output for 9V?

berkeman
Nov6-05, 10:41 PM
Sure, whatever. Real world verusus the lab.

maverick99
Nov6-05, 11:49 PM
Sure, whatever. Real world verusus the lab.

Alright, cool. Thx for all the help. I will be sure to post results and pics once I finish it here within a month. That is, if I don't have anymore questions during that time :rofl:

maverick99
Nov7-05, 09:07 AM
Well I'm back again. Since I have to order parts online, I have to wait a few days to work on the reciever/transmitter circuits. I figure I might as well make the stepper motor circuit while I have this free time. Could anyone supply me with a circuit in which I could do this?

The stepper motor is supposed to sweep 180 deg, back and forth. The first my professor gave me was the L298 Dual Full-Bridge Driver.
http://tinyurl.com/e42un

The other is the L297 Stepper Motor Controller.
http://tinyurl.com/bzokx

Edit: Here is the data sheet for the stepper motor
http://www.jameco.com/wcsstore/Jameco/Products/ProdDS/213321.pdf

berkeman
Nov7-05, 12:59 PM
You're going to need at least a CPLD or a microcontroller to drive the stepper motor circuit & process the sonar returns. What is your strategy for that part of the circuit?

maverick99
Nov7-05, 01:09 PM
You're going to need at least a CPLD or a microcontroller to drive the stepper motor circuit & process the sonar returns. What is your strategy for that part of the circuit?

I plan on separating the two circuits. The stepper motor circuit will turn back and forth 180 degrees. Thats all it will do. I will have the transducers hooked up with long wires and mount them to something fairly sturdy to put on the motor to turn.

maverick99
Nov8-05, 06:01 PM
Could anyone supply me with a schematic for the stepper motor with the chips that I was given?

berkeman
Nov8-05, 06:21 PM
Could anyone supply me with a schematic for the stepper motor with the chips that I was given?

The link you supplied for the L297 has an Application Note link underneath it. It looks to be a pretty complete tutorial. Just click through your link and look for the Application Note link:

The other is the L297 Stepper Motor Controller.
http://tinyurl.com/bzokx

maverick99
Nov8-05, 06:55 PM
The link you supplied for the L297 has an Application Note link underneath it. It looks to be a pretty complete tutorial. Just click through your link and look for the Application Note link:

In that pdf files, what is the MCU?

berkeman
Nov8-05, 07:02 PM
Any general purpose microcontroller could be used. That's why I asked earlier in the thread what CPLD or uC you planned on using. You will need at least some logic to provide those control signals to the stepper driver. It would be a good idea to also have limit switches at the ends of your 180 degree travel, to help your uC do some sort of initialization routine after power up or other reset.

You can start off playing with the motor by just using switches to provide the input signals....

maverick99
Nov8-05, 07:23 PM
When testing the motor, do i need any current limiting components?

maverick99
Nov9-05, 01:16 PM
On the schematic that was given, what is the purpose of the 8 diodes? Would rectifier diodes work for the schematic?

berkeman
Nov9-05, 01:38 PM
On the schematic that was given, what is the purpose of the 8 diodes? Would rectifier diodes work for the schematic?
Look at the currents in figures 15 and 17 for your answer. Any diodes should work as long as they have adequate current and power ratings.

maverick99
Nov9-05, 02:20 PM
Alright cool, sounds good. I tested out the motor and got it working right with just a dip switch. I will need to program a chip to count the way i need it to, too. My question is, do i even need the l297 and l298 in the circuit? Couldn't I just simulate the dip switch counting with the programmable chip and have that going to the motor? If not, then what are the l297 and 298 doing in the circuit?

berkeman
Nov9-05, 03:04 PM
You could probably drive the correct waveforms from your uC into the power transistors that drive the motors -- might even get you extra credit in the project. You need to make the correct waveforms for the stepping and holding currents, but yeah, the uC could do that if you program it right.

Ouabache
Nov16-05, 02:12 AM
Why would I have to include a power source and voltage regulators on the final project assembly? Wouldn't it work fine if I just used the 5 Volt line from my power supply and used the other output for 9V? If you did want to make a real world design as berkeman suggested, using a voltage regulator to step down a 9v supply to 5v is not hard. On the bench, you could determine how much current is drawn by your design and then decide if a 9v battery could work for the high supply..

Ouabache
Nov16-05, 02:23 AM
I plan on separating the two circuits. The stepper motor circuit will turn back and forth 180 degrees. Thats all it will do. I will have the transducers hooked up with long wires and mount them to something fairly sturdy to put on the motor to turn.
How will you mount the transducers so they will be turned by the stepper motor? Will transducers be on the same board as the rest of your circuit? I am trying to get a 3-dimensional idea of your final setup. Are you going to go with a circuit like the minibot one you posted at the end of #11 (http://www.leang.com/robotics/info/articles/minison/minison.html) of this thread?

Ouabache
Nov16-05, 07:56 PM
How about the range of your Ultrasonic Design. The spec for the project is 25feet. Only one of the circuits referenced on this thread are rated for that distance.

SRF04 Ultra Sonic Ranger (http://www.technobots.co.uk/index.html?lang=en-uk&target=d695.html)
max range is 3m (x 3.28 ft/meter) = 9.84 ft
Ultra Sonic Rangemeter (http://www.interq.or.jp/japan/se-inoue/e_pic6_6.htm)
max range 3.6m (x 3.28 ft/meter) = 11.8ft
Sonar Ranging System for Minibot (http://www.leang.com/robotics/info/articles/minison/minison.html)
max range 5-6ft
Ultra-Sonic Ranging Design (http://www.ottawarobotics.org/articles/ultrasonic/ultrasonic.html)
max range 10.7m (x 3.28) = 35 ft

If you did go with one of the other designs, is there a way to improve gain of the circuit?
Perhaps use more sensitive transducers?? (see below)
Scientific Technologies, Inc. (http://www.globalspec.com/FeaturedProducts/Detail/ScientificTechnologies/New_Ultrasonic_Sensors_for_Carwash_Applications/3542/0)
Sensors with range 25ft
NEMA6 Acu-trac (http://www.ssitechnologies.com/dislev6.htm)
Sensors 8m (25ft)

maverick99
Nov17-05, 04:41 PM
I will most likely use the circuit that has a max range of 5-6 feet basically because I already ordered the parts for it. I will be building it tommorow so I will test it out to see how far I can get it to go. On a side note, I got my stepper motor working from the 2 chips that I was given. The question I have is how to get it to stop at 180 deg, because it just keeps going 360 deg over and over. I noticed that there is a clockwise/counterclockwise pin on it but it does absolutely nothing when I put it to Vcc or ground. Any thoughts?

Ouabache
Nov17-05, 08:11 PM
I'll just toss out some ideas as if I was in your design group and we were brain storming a bit.. I suspect you are using a microcontroller. How about programming it with a "lookup table" with each "binary input" equivalent to a "unit of angular displacement" (e.g. 1deg, 5deg.) Since you can count positive and negative numbers in binary, maybe you can use positive binary to translate 0 to +90deg and negative binary for -1 to -90 deg.

Berkeman had a suggestion of using limit switches at the ends of your 180 degrees of travel. I am guessing he means some sort of conductive pin to catch the rotor at the endpoints. With a conductive pin, it could trigger a switch (limit switch) to let your microcontroller know (closed circuit = voltage or logic level), that it has reached a boundary. If you used limit switches, all you would need is a counter to increment (step the motor), then when it reaches a limit switch, the counter could change to decrement, then when it reaches next switch, change to increment again, and so on..

I am wondering how you will mount your transducers & stepper motor (see my post #33 this thread). I am trying to get a 3-dimensional image of your setup..

maverick99
Nov17-05, 09:40 PM
A couple days ago, I hooked up the stepper motor windings to a dip switch. After messing with it, I got it to turn clockwise by shifting to the left.
0001
0010
0100
1000....


...and counter-clockwise by shifting to the right.
1000
0100
0010
0001

Couldn't I make a program that would just shift so many times then shift counter-clockwise and put it on a microchip?

Ouabache
Nov17-05, 09:56 PM
Yes your program is a valid approach!! Were you given a specification on how fast it should sweep from -90 to +90? Is your setup going to be stationary or mobile?

Whatever controls the motor, how will it know where a reference point is (example -90, 0, or 90 degrees)? For lab purposes, you could put it at a reference point. But wouldn't it be nice for your circuit to find the starting reference? That is another good reason to have at least one limit-switch.

maverick99
Nov28-05, 10:55 AM
I hooked up the finalized circuit to the o-scope and i'm getting a good square wave from the transmitter circuit. Unfortunetly, my receiver circuit is still having problems. According to this site where I got the circuit from; http://www.leang.com/robotics/info/articles/minison/minison.html
It shows that I should have a square wave for my receiver circuit, but I'm getting a distorted sine wave. Any thoughts on what I should do?

berkeman
Nov28-05, 12:47 PM
Does it appear to be the return ping coming back? Like, does its time delay from the TX ping vary with the distance to the reflector? Does the amplitude of the distorted RX sine wave (before any final comparator stage) vary with reflector distance? I haven't looked at the circuit lately, but assuming there is an output comparator stage, are you saying that the output of the comparator is a distorted sine wave, or the input to the comparator?

maverick99
Nov28-05, 01:36 PM
Does it appear to be the return ping coming back? Like, does its time delay from the TX ping vary with the distance to the reflector? Does the amplitude of the distorted RX sine wave (before any final comparator stage) vary with reflector distance? I haven't looked at the circuit lately, but assuming there is an output comparator stage, are you saying that the output of the comparator is a distorted sine wave, or the input to the comparator?

Edit: Ok the sine wave that I had was screwed up because of the 2nd line in the oscope. I plugged it into another and its working ok now. Here is a picture of what my oscope is showing now with my crappy camera phone.
http://img184.imageshack.us/img184/6643/picture0132kd.jpg

The top square wave is my pulse from the transmitter.
The bottom square wave is the pulse from the receiver.
I'm still having trouble with it though. When I put my hand in front of the sensors, the bottom pulse doesn't do anything until i'm maybe 6 inches away from it. When I do get close enough, it just shows the same waveform but flicking in different positions. The transmitter wave also gets affected a little too for some reason.

berkeman
Nov28-05, 04:12 PM
I didn't read the theory of operation at the leang website that you list, but IMO, you should be seeing something like this:

-- A 40kHz drive signal across the TX transducer for the duration of the 200us PING signal. A 40kHz signal has a 25us period, so you should get about 8 cycles of drive at 40kHz into the TX transducer for each PING. The 555 frequency should be tuned to the resonant frequency of the TX transducer. You can hand-tune the frequency in the next step...

-- Put an RX transducer directly in front of the TX transducer, and only connect your oscilloscope across the RX transducer (nothing else yet). Maybe separate them by 1mm or so. As the PING signal pulses, do you see a small signal on the RX transducer? I don't know how big the signal will be with only the oscilloscope input amp to magnify it, but I would think that you should be able to see it with such a small TX-RX separation. Worst case, you can touch the TX and RX transducer faces, but that will make the fine tuning of the TX frequency less valid. Assuming you see a small RX signal at 1mm spacing, fine tune the 555 frequency to maximize the amplitude of the RX signal. That fine tuning will help to maximize your sonar range.

-- Next, reconnect the RX transducer in your Receiver circuit, and watch the output of the first opamp stage. It should be an amplified version of the 8-cycle sine wave signal that you were seeing on your oscilloscope when you watched the output of the RX transducer alone. If it is not, then there is something wrong in the first stage amplifier circuit. If it is working right, then your gain will be set to barely get a good tone through the first stage when the reflecting object is at max range. With the gain set like that, the output of the first stage amp will be saturating into the rails when the reflecting object is very close. You might want to look into putting a soft saturation clamp circuit on the first stage to be sure that it doesn't slow down too much to keep up with return echoes from close objects. I'll leave that part as an exercise for the reader. Also, verify that the return echo of about 8 cycles at 40kHz (it may take a couple cycles for the RX transducer to ring up to full amplitude) get smaller in amplitude and more time-delayed as you increase the spacing between the TX and RX transducers (or increase the distance to the reflecting object). Remember that the speed of sound is about 340m/s at sea level, so expect about a 3ms delay for each meter of separation (ignoring circuit delays and ringup time factors, which you will need to calibrate out of your final answer).

-- Assuming the first stage is working okay, trace the signal through the 567 tone decoder. The 567 should provide some noise immunity against other noises that the RX transducer picks up. You should tune the 567 to be most sensitive to the frequency that you found from the earlier tuning that you did to maximize TX-->RX throughput. I've never used a 567, but it looks from the circuit like it will output a pulse when it sees a tone that is the same one it is looking for. I don't know how many of the 8 cycles it will take before the 567 drives its output, but you can probably figure that out from its datasheet.

Have fun!

maverick99
Dec7-05, 08:39 PM
I got a question on finding the range using the oscope; tell me if this is the wrong approach in calculating the distance.

I measure how long the lag time is between the transmitter pulse and the echo. I multiply that by the period(50us). Then I multiply that by the speed of sound, which is around 300m/s. Would this work?

Integral
Dec7-05, 11:30 PM
I got a question on finding the range using the oscope; tell me if this is the wrong approach in calculating the distance.
I measure how long the lag time is between the transmitter pulse and the echo. I multiply that by the period(50us). Then I multiply that by the speed of sound, which is around 300m/s. Would this work?

The speed of sound in air is about 300m/s at 0C! In your much warmer lab the speed will be closer to 345m/s.

An RF radar transmitts a short pulse, then listens for a period of time fixed by the desired range. The amout of time between the transmitted pulse and the return gives the range. Keep in mind that the return time is 2 twice the time required for the pulse to reach the target.

berkeman
Dec8-05, 09:29 AM
I got a question on finding the range using the oscope; tell me if this is the wrong approach in calculating the distance.
I measure how long the lag time is between the transmitter pulse and the echo. I multiply that by the period(50us). Then I multiply that by the speed of sound, which is around 300m/s. Would this work?
The period of the pulse has nothing to do with the distance calc. the round trip time is just t=2*V/d. So d=2*V/t.

As Integral said, be more precise about V (and maybe include temperature and barometric pressure as inputs to your calculation, if appropriate). And you will need to calibrate out several other delay factors as well, if you want to increase your accuracy. You will need to measure what the RX delay through your input piezo and amp circuit is, since that will be an additional delay (which will likely change with distance, because it will change with gain and saturation effects in the input amp). There is also the ringup time of the TX piezo, potentially.

If you are using a microcontroller to operate the whole system, you can code up some calibration tables based on your oscilloscope measurements, and then fine tune them by working with test reflector objects. Remember, the 40kHz ultrasonic wavelet that you launch from your TX piezo will come back to your RX piezo as a much smaller 40kHz wavelet, and that's what you are picking up and amplifying. Part of the delay that you need to calibrate out is how the weaker the RX wavelet (farther distances), the farther into the wavelet your RX discriminator circuit will generally have to go before it trips to say that there is a valid echo.

maverick99
Dec11-05, 02:31 PM
The period of the pulse has nothing to do with the distance calc. the round trip time is just t=2*V/d. So d=2*V/t.


Is V the velocity or voltage?
What do I use for t?

berkeman
Dec12-05, 10:00 AM
No, velocity of propagation of the sound wavelet. Sorry for the ambiguous notation.