Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

min. distance in ultrasonic distance meter

Status
Not open for further replies.

Maryam

New Member
hello,
I am workng on an ultrasonic distance meter.it is based on this project:
**broken link removed**
the minimum distance that my circuit shows is 279mm,I changed the delay of minimum distance in software but I still have 279mm min distance instead of a smaller output .
now my question is:
Is this limitation due to hardware(my ultra sonic sensors) or I should change my software in order to measure shorter distances?
 
Maryam said:
hello,
I am workng on an ultrasonic distance meter.it is based on this project:
**broken link removed**
the minimum distance that my circuit shows is 279mm,I changed the delay of minimum distance in software but I still have 279mm min distance instead of a smaller output .
now my question is:
Is this limitation due to hardware(my ultra sonic sensors) or I should change my software in order to measure shorter distances?

It's a bit of both really, when the ultrasonic transducer transmits it has two bad effects, one it carries on ringing for a little while, and secondly it overloads the receiver. So the minimum distance is governed by waiting for the transducer to stop ringing, and waiting for the overloaded receiver to recover.

But both of these conditions will cause false triggering if the delay is too short, I suspect your minimum distance may well be set elsewhere in the software.
 
Hello

Thanks for your reply.

This is part of my codes whitch defines the value of delay in receiving signal,I changed the value of 240 to a lower one but I didn't see any difference.
Code:
RECEIVE  movf MASK,W
         btfsc STATUS,Z
         goto DEFMASK          ;if mask 0 do default delay
         movf MASK,W
         movwf LOOPB
         goto MASK1            ;perform mask delay

DEFMASK  movlw D'240'
         movwf ANSA1
         movlw D'2'
         movwf ANSA2
DEFMLP   decfsz ANSA1,F
         goto DEFMLP
         decfsz ANSA2,F
         goto DEFMLP
         goto MASK0

MASK1    movlw D'2'               ;masking delays
         movwf ANSA2
         movlw D'48'
         movwf ANSA1

MASK2    movlw D'4'
         movwf ANSA3
MASK3    decfsz ANSA3,F
         goto MASK3

         decfsz ANSA1,F
         goto MASK2
         decfsz ANSA2,F
         goto MASK2
         decfsz LOOPB,F
         goto MASK1

MASK0    bcf INTCON,RBIF       ;clear RB4-RB7 interrupt change flag
         bcf ZERO,0

am I doing true correction on the program?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top