Page 1 of 1

Ultrasonic sensor(SN-LV-EZ1)

PostPosted: Wed Dec 01, 2010 10:56 pm
by bmhong
I use the TX output connect to RC7(PIC16F877A),but the lcd show some strange symbol!Can tell me what is the problem?

Re: Ultrasonic sensor(SN-LV-EZ1)

PostPosted: Thu Dec 02, 2010 12:21 am
by yonghui
hi,

what LCD u are using? what did u send to your LCD?


regards,
yh

Re: Ultrasonic sensor(SN-LV-EZ1)

PostPosted: Thu Dec 02, 2010 2:07 am
by bmhong
The lcd i also bought from cytron ,the product code is DS-LCD-162A and send asynchronous serial.Got any idea can decode the symbol into digit number?

Re: Ultrasonic sensor(SN-LV-EZ1)

PostPosted: Thu Dec 02, 2010 10:22 am
by yonghui
hi,

simply sending values to LC wont work.the value need to be converted to BCD. then coverted to ascii code to be sent to LCD. the LCD accept only ascii code. refer to usermanual of the LCD for the code need to be sent to LCD. so u will need careful coding in the conversion. or else download the library available from cytro's DIY project. and remember that BCD conversion is need to display properly on the screen.

for example if u wan to display number 11. u are not goin to send 11 to the LCD. u are goin to send two digits of '1' to the screen. if u send 11 to screen, the LCD will display unknown symbol on screen.

11/10=1;
11%10=1;

convert 1 to ascii, send to LCD;
convert 2nd 1 to ascii, send to LCD;


regards,
yh

Re: Ultrasonic sensor(SN-LV-EZ1)

PostPosted: Fri Dec 03, 2010 5:46 pm
by ober
bmhong WROTE:I use the TX output connect to RC7(PIC16F877A),but the lcd show some strange symbol!Can tell me what is the problem?


The Tx output of Ultrasonic Range Finger is not UART, it is 0-5V RS232 standard. You can refer to PR23's schematic for the sample interface.

Re: Ultrasonic sensor(SN-LV-EZ1)

PostPosted: Sun Dec 05, 2010 7:45 pm
by shiyan
bmhong WROTE:I use the TX output connect to RC7(PIC16F877A),but the lcd show some strange symbol!Can tell me what is the problem?


Woh... there is 2 things here need to be clear.

1. The transmit from ultrasonic, it is UART? If not, surely you cannot connect to PIC' RX pin directly. The ultrasonic does not have datasheet or User's Guide? Oh... the Maxbotix? OK, I got it now, most of their ultrasonic Tx output is RS232 but half standard only. Because it is 0-5V. It do state in the datasheet, look carefully.

2. And the program you written for the whole "translation", have you tested it? a quick way is to use any terminal program on computer, connect to your microcontroller, and type any key. If the program is correctly written, you should see something. Yes, it might also be the LCD problem :)