Cutoff power to DC motor if it reaches certain RPM

Hi i'm doing a hobby project with DC motor...

I'm using a 12v, 40amps DC motor to run an electric vehicle. I need to know how to control the speed of the DC motor (like giving acceleration to the vehicle) with arduino.

Also if the motor reaches certain RPM (for example 600rpm) the power supply to the motor should Cutoff.

Please tell me how to do it and also help me with the codes.

That's a high power system, easily capable of killing and maiming people, you need to consider safety above all.

That almost certainly means using a commercially available motor controller which is designed for the purpose. The system has to fail safe and be reliable to vehicle standards...

You will find many 24V systems designed for wheelchairs, mobility scooters and golf carts, 12V, probably very little.

MarkT: That's a high power system, easily capable of killing and maiming people, you need to consider safety above all.

That almost certainly means using a commercially available motor controller which is designed for the purpose. The system has to fail safe and be reliable to vehicle standards...

You will find many 24V systems designed for wheelchairs, mobility scooters and golf carts, 12V, probably very little.

I'm going to use HHO PWM DC Motor Speed controller 12V 24V 36V 48V 40A 2000W Adjustable Regulator to control the motor. Link for the controller http://m.aliexpress.com/item-desc/32299455100.html

Now I need to know how to Cutoff the power supply to the motor if it reaches certain RPM. Can I do it with arduino... If so please tell me how to do it. Thanks in advance

You will need a high current DC contactor(*), they are not cheap.

(*) This is a very heavy current relay designed for breaking high power DC arcs.

Alternatively use a motor controller that is certified safe and kill the throttle input. It will probably be cheaper.

The motor contoller you mention seems to have a maximum 40A, so it won't be suitable for a motor with perhaps 200A+ stall current, which is probably the sort of value expected for a 500W 12V motor