Connecting Motor Driver L298 Module with FEZ SPIDER

hello guys… i’m working on a distance detecting system using fez spider and HC-sr04 sensor,now i’m planing to add some vibration motor to drive when the obstacle is identified but i have no idea to how to pass the signal through from sensor to the motor, i mean when it detect some obstacle the vibrator must start and vibrate for while think 5 sec, can anyone help me on this?

Check this link:

http://gizmolab.pbworks.com/w/page/5686102/Arduino%20Tutorial%203%3A%20Motors

You will need resistor, transistor and a diode to hook up the vibrator motor.

thnx architect , any other suggestion… i’ll connect my motors in that way… anyone try any same thing using FEZ
spider?

There are basically two challenges. First, how do recognize an obstacle. Second, how do cause
the motor to vibrate. There is no real “passing of the sensor data”.

Attack each part separately, and then putting them together will be obvious.

hello… i have connect a HC-SR04 sensor with my FEZ SPider and now i can read the distance to the obstacles, now what i want to do is i want to run motor when the distance is less than 25 inches does anyone have an idea to how to do this?

@ Niyomal - Architech pointed you at an URL earlier which answers your question.

Do you have a question about the referenced information?

hey guys … does any one have a sample code for working with motor controller and distance sensor… i have done the distance sensor connectivity and now i can read the distance from it… now what i want to do is i need to run the motor when the distance is less than 25 inches, but the problem is i cannot imagine how to start the mortor connectivity does anyone try or have any sample code please let me know this is for school project…help me…

What have you done so far?

i have connect the HC-SR04 sensor to the board and now i can read the distance using it ( i did this with ur help architect thank you again :slight_smile: ), and i have made the circuit to connect the vibrator to the motor controlling module as mention in the above link u post , now what i want to do is i need to run the motor when the distance read by the sensor is less than 25 inches what i have to do?

You have to check the distance and if it is less then 25 inches turn on the pin that controls the motor.

@ Architect - hi i have made the circuit as in the link you provide, do you have any sample code on driving motor… if you have can you post it for me than you…!!

Start with a simple program that turns motor for 5seconds and then turns it off to test you circuit.