Shop OBEX P1 Docs P2 Docs Learn Events
ultrasonic transmitter — Parallax Forums

ultrasonic transmitter

CenlasoftCenlasoft Posts: 265
edited 2013-05-06 08:19 in Propeller 1
hello,
I am trying to make an ultrasonic range finder without using the ping. my research suggest that a max232 can be used to produce a +10v and -10v system that can power a us transducer to 20 vpp. Can anyone lead me to a way to do this?
Thanks,
Cenlasoft

Comments

  • CenlasoftCenlasoft Posts: 265
    edited 2013-05-05 11:34
    Let me state the question more clearly, I know how to produce to square wave with one of the waves 90 degrees out of phase. I want to use a max232 as a driver for the ultrasonic transducer to achieve 20 vpp. The problem is that the prop pin is 3.3 v and I need 5 v for the max232. Can I use a transistor connected to 5 v and the the 3.3 pins to turn on and off the transistor to solve this. Any other solutions would be great.
    Thanks
    Cenlasoft
  • frank freedmanfrank freedman Posts: 1,983
    edited 2013-05-05 12:08
    TI has a line of chips that can do level shifting. Forgot what the series is called, but it does exist. Check their site out, there is a doc that provides list/comparison of all their logic families.


    Cenlasoft wrote: »
    Let me state the question more clearly, I know how to produce to square wave with one of the waves 90 degrees out of phase. I want to use a max232 as a driver for the ultrasonic transducer to achieve 20 vpp. The problem is that the prop pin is 3.3 v and I need 5 v for the max232. Can I use a transistor connected to 5 v and the the 3.3 pins to turn on and off the transistor to solve this. Any other solutions would be great.
    Thanks
    Cenlasoft
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-05-05 12:21
    Do you know about the Max3232? It's the 3.3V version of the Max232.

    I have no idea about how it would work to drive an ultrasound.

    Have you tried the Max232 with 3.3V logic? I haven't found many TTL devices which do not read 3.3V as logic high.

    Based on JonnyMac's advice I usually use the 5V of the RS-485 (did I get those numbers right?) chips since they cost less then the 3.3V versions (and work just fine at 3.3V).

    Edit: It does look like the Max232 will work with 3.3V logic. They're also a lot less expensive than the Max3232 versions.
  • CenlasoftCenlasoft Posts: 265
    edited 2013-05-05 12:50
    Thanks everyone, I had a few 74hct240 ic. I used 3.3 v in the input pin and 0v to see if I would get a high or low on the output of the inverter and it worked. The inverter runs on 5v and 3.3 can produce a high or low. Now I will use the max232 to give me a 20vpp to transmit ultasound. I have spin code to produce two square waves 180 out of phase.
    Thanks
  • caskazcaskaz Posts: 957
    edited 2013-05-05 15:42
    Hi.
    I drived sonic-transmitter on 5V.

    Connection;
    P0 - Transistor - Pullupresistor - capacitor - sonictransmitter

    Connecting max232 between Pullupresistor and capacitor is no good?

    Curcuit diagram is #58 below;
    http://forums.parallax.com/showthread.php/146693-Propforth-v5.5-is-available-for-download/page3
  • CenlasoftCenlasoft Posts: 265
    edited 2013-05-05 20:31
    I got the transmitter working with the inverter ic and the max232. I get 16 vpp on one output, the other is very noisy. Here is some spin code I used that someone gave me for 25% off phase. How can I make it 90 degrees out of phase with the first squarewave?
    Pub SQW_Two
    
      dira[0..1]~~
      ctra := constant(%0_00100_000 << 23 | 0)          ' NCO
      ctrb := constant(%0_00100_000 << 23 | 1)          ' NCO
    
      phsb := $4000_0000                                 ' 25% shift
      frqa := frqb := 2_147_483                          ' 40 khz
    
      waitpne(0, 0, 0)                                   ' keep cog alive
    
    Thanks,
    Cenlasoft
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-05-05 22:07
    Cenlasoft wrote: »
    How can I make it 90 degrees out of phase with the first squarewave?

    Do you want the second signal to be 90 degrees out of phase or 180 degrees out of phase?

    I notice you've used both 90 and 180 degrees phase difference. I'd think you'd want the second signal 180 degrees out of phase from the first in this application.

    Sorry, I don't know the answer either way.

    Wouldn't using an inverter on the first signal produce a signal 180 degrees out of phase automatically? As I mentioned previously, I'm pretty sure the MAX232 chip will treat 3.3V as logic high so you could drive one channel of the chip directly from the Prop pin and drive the second channel from the inverter (using the same Prop Pin as the input to the inverter). Assuming, you want two signals 180 degrees from each other.
  • CenlasoftCenlasoft Posts: 265
    edited 2013-05-06 06:51
    Thanks Duane,
    I never thought about the inverter. I actually want the first signal to be a squarewave and the second one to be 180 degrees out of phase. the reason I am using an inverter is to get it 5 v and the the max232 to get about 16 vpp to drive the ultrasonic sensor.
    Thanks again,
    Curtis
  • CenlasoftCenlasoft Posts: 265
    edited 2013-05-06 08:19
    Hello,
    I used the "squarewave" object and produced two squarewaves with one 180 degrees out of phase. I then sent each signal from pin 0 and 1 to the inputs of a max232 to increase the vpp. I got 16 vpp as was intended. now I want to add to the code listing below to create pulses .5 ms long and a waiting period of 20 ms between the next pulse.
    Code listing 1:
    CON
       
      _clkmode = xtal1 + pll16x                     ' Crystal and PLL settings
      _xinfreq = 5_000_000                          ' 5 MHz crystal
    
    OBJ
    
      sqw : "SquareWave"                            ' Square wave object
    
    PUB SQW_Test
      repeat
        sqw.FreqDiff(0, 1, 0, 40_000)                         
     
    

    Thank you,
    Curtis
Sign In or Register to comment.