ultrasonic sensor

Digital Fiber, Photoelectric, Laser Range, Optical, Temperature, Rotary Encoder, Ultrasonic, Gas, Gyro, Accelerometer, FlexiBend, Flexiforce, Compass......

ultrasonic sensor

Postby fzul90 » Sat Dec 08, 2012 1:08 am

hi,
what is the output of the ultrasonic sensor SN-LV-EZ1 if use RS232 Serial Output. i want to use it to detect water for 8 different level and use vhdl coding to program it. what is the sequences for the first 8 output in ascii code? thanks
fzul90
Newbie
 
Posts: 9
Joined: Sun Nov 11, 2012 7:16 pm

Re: ultrasonic sensor

Postby zhenning » Sat Dec 08, 2012 1:25 am

Did you read this: http://tutorial.cytron.com.my/2011/08/0 ... ge-finder/

CASE 3 : UART READING

Maxsonar-EZ1 in UART mode are directly given an ASCII value to the microcontroller which start with an “R”, then follow by 3 value of range such as 255-inch in “2”, “5”, “5” and then lastly is the carriage return which is totally of 5 data to be received.

If (RCREG == ‘R‘) data[k=0] = RCREG;
Check if the RCREG are ASCII value ‘R’. if yes then save the data at data[0] by reset the k = 0.

if (data[0] == ‘R‘) data[k++] = RCREG;
After make sure the data[0] is ‘R’. Then next step is to save the next RCREG value in data[1], data[2], data[3] by increasing k by 1 at the time.

send_lcd_data(1,data[1]);
By referring to LCD library, by sending a 1 will toggle ON the RS of the LCD which is read as an character for LCD. Then send the ASCII data that given by the Maxsonar-EZ1 to the LCD.
zhenning
Enthusiast
 
Posts: 351
Joined: Thu Dec 30, 2010 12:32 am

Re: ultrasonic sensor

Postby shahrul » Sat Dec 08, 2012 8:30 am

MaxSonar output in UART. You can see output on serial monitor ex Maxsonar Lesson.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: ultrasonic sensor

Postby fzul90 » Sun Dec 09, 2012 10:56 am

i'm using VHDL to program the output. do i need to convert the output to binary first. for example i want to set '000' as level 1 and so on until '111' as level 8
fzul90
Newbie
 
Posts: 9
Joined: Sun Nov 11, 2012 7:16 pm

Re: ultrasonic sensor

Postby yonghui » Sun Dec 09, 2012 11:34 am

i think it has the analog output also that u can use ADC to read it.
VHDL means ur using FPGA board?
u need to check whether ur FPGA development board has the RS232 or UART module or ADC converter.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: ultrasonic sensor

Postby fzul90 » Mon Dec 10, 2012 1:38 pm

i'm using de2 board. it has rs232 port. so i think iwant to use rs232 serial output as the input. but my concern is can i receive the data from the sensor if i connect directly to de2 board?
fzul90
Newbie
 
Posts: 9
Joined: Sun Nov 11, 2012 7:16 pm

Re: ultrasonic sensor

Postby robosang » Tue Dec 11, 2012 8:54 am

Not really use the ultrasonic in that way because I do not have RS232 port any more on laptop :)

Anyhow, it should work :mrgreen:

But the VHDL in the FPGA is not my field.... sorry.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: ultrasonic sensor

Postby yonghui » Tue Dec 11, 2012 10:38 am

i think u need to find the usermanual of DE2 board then look into RS232 part and see how to read from the port. the data from sensor should be 8 bits data. probably u will need to write some code to read from the buffer of the port, so seek also the address.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: ultrasonic sensor

Postby chingfa » Sun Oct 20, 2013 12:27 am

Hi, anyone know how to simulate the ultrasonic SN-HC-SR04 in protues??? :cry: HELP!!!
chingfa
Newbie
 
Posts: 11
Joined: Tue Oct 15, 2013 1:13 am

Re: ultrasonic sensor

Postby chingfa » Sun Oct 20, 2013 12:30 am

Hi, anyone know how to simulate the ultrasonic SN-HC-SR04 in protues??? :cry: HELP!!!
chingfa
Newbie
 
Posts: 11
Joined: Tue Oct 15, 2013 1:13 am


Return to Sensor

Who is online

Users browsing this forum: No registered users and 6 guests

cron