ultrasonic sensor


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    johor,Malaysia
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    thank
    Melanie

    i cant understand..

    -this is a programming for DC MOTOR CONTROLLER (my final project)
    -i've run and test the programming but still have a problem at the circuit
    -i think the circuit is ok, but the programming for sensor is not ok!
    -below are my program




    'PIC BASIC PRO FOR DC MOTOR CONTROLLER
    'PIC16F84A

    TRISA = %00000000
    TRISB = %00000111

    loop:

    High PORTA.0 'this is to transmit the signal from sensor
    Low PORTA.1



    IF (PORTB.0=1) AND (PORTB.1=1) AND (PORTB.2=1) Then
    GoSub motorfast
    EndIF
    IF (PORTB.0=1) AND (PORTB.1=1) AND (PORTB.2=0) Then
    GoSub motormedium
    EndIF
    IF (PORTB.0=1) AND (PORTB.1=0) AND (PORTB.2=0) Then
    GoSub motorslow
    EndIF
    IF (PORTB.0=1) AND (PORTB.1=1) AND (PORTB.2=1) Then
    GoSub motorstop
    EndIF
    GoTo loop

    motorfast:

    High PORTB.7
    LCDOut $FE, 1,"No Object Found"
    LCDOut $FE, $C0,"MOTOR FAST"
    Return

    motormedium:

    LCDOut $FE, 1,"Object Detect I"
    LCDOut $FE, $C0,"MEDIUM SPEED"
    High PORTB.7
    Pause 2
    Low PORTB.7
    Pause 2

    Return

    motorslow:

    LCDOut $FE, 1,"Object Detect II"
    LCDOut $FE, $C0,"SLOW SPEED"
    High PORTB.7
    Pause 4
    Low PORTB.7
    Pause 4
    Return

    motorstop:

    LCDOut $FE, 1," WARNING! "
    LCDOut $FE, $C0,"SLOW SPEED"
    Low PORTB.7
    Return



    -the problem is the ultrasonic sensor didn't function after the circuit is ON
    -maybe it is cause by the programming and i'm not sure how to settle it
    -i think the problem is at ultrasonic trasmitter programming
    -can anybody help me to solve this...?

    i put my circuit in attached file
    Attached Images Attached Images  
    Last edited by PoTeToJB; - 15th April 2006 at 14:37.

Similar Threads

  1. Need a cheap touch sensor idea.. here it is
    By mister_e in forum Code Examples
    Replies: 20
    Last Post: - 16th April 2016, 22:42
  2. Ultrasonic distance sensor with PIC16F84A
    By MrRoboto in forum mel PIC BASIC
    Replies: 3
    Last Post: - 29th June 2009, 09:01
  3. PICBASIC PRO-coding for wireless sensor node
    By syazila in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2009, 00:05
  4. Water Level Detection using Ultrasonic Sensor
    By Balachandar in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th November 2007, 04:59
  5. sensor ultrasonic 8051&PIC
    By hd_uni_pro in forum Schematics
    Replies: 1
    Last Post: - 13th September 2006, 12:58

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts