LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating ultrasonic sensor with motors (for wheels on the robot) to do obstacle avoidance

I am doing a project where I need to integrate the ultrasonic sensors (HC-SR04) with DC geared motor (connected to the wheels) such that when the sensors detect an obstacle it sends a signal to the motors to rotate the wheels backward to move away from the obstacle. I am using myRIO for the project.

Can anyone guide me or show me an example by which I can achieve this task?

 

I have attached the vi's for both the ultrasonic sensors as well as the motors. In the motor program there are 5 cases:

1st case: All wheels are in stop position

2nd case: Forward

3rd case: Backward

4th case: Left

5th case: Right

 

Would be really helpful if someone could guide me on this.

 

 

Download All
0 Kudos
Message 1 of 2
(2,606 Views)

Welcome to the forums, Vabhave!

 

There's a fair bit of documentation out there regarding using a HC-SR04 with a myRIO. Linked here is one piece of example code from the forums that should help get you going in the right direction. I would also look at the PWM Generation example in LabVIEW, and get that outputting to one of your motors, and then extend the functionality.

 

In general, going through some of the getting started tutorials (like this one: Getting Started With LabVIEW FPGA), can help give you ideas of how to architect your code as well.

Claire M.
Technical Support
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 2 of 2
(2,552 Views)