DC Motor count with reed switch

Hi I am very new to programming with Arduino but have done the below with a PLC.

I am looking at controlling a DC motor with an Ardunio. The unit has a reed switch and I am wanting to count the number of turns the motor does before stopping/starting etc...

It is to position a satellite dish

Do i need a motor board?

Sorry i'm not very good at explaining myself.

I couldn't find any projects out there.

Thanks

You could use an interrupt pin to count the number of pulses from the reed switch.

Here's a post that goes over this topic, but let me know if you have any questions.

http://forum.arduino.cc/index.php?topic=92624.0

You could use an interrupt pin to count the number of pulses from the reed switch.

Avery poor idea as all switches bounce look up de-bouncing of switches.

Using a switch of any kind to count rotations is a poor idea.

Mark

holmes4: Avery poor idea as all switches bounce look up de-bouncing of switches.

Using a switch of any kind to count rotations is a poor idea.

Mark

In all fairness... not so bad if you are rotating slowly, and (as you noted) you de-bounce the switch, which can be done in software.

Given what he's working with, de-bouncing the switch and counting should get him pretty close to where he wants to be.

If the count gets off over time, maybe a 'reset' function to go to home and then start counting again.

Thanks for the reply. Will have a look later after work.

holmes4: A very poor idea as all switches bounce

As far as I know reed switches do not bounce at all.

They bounce, sometimes a lot. So now I know better, sorry.

Mikeparry15: Do i need a motor board?

You need some shield or external hardware to control the motor. It depends on the used motor.

So please add voltage, amperage, type, model number, datasheet, all information you have.

You can use a couple SPDT relays, best in a shield or breakout board so that all the required circuit is pre-built for you (fly back diodes, resistors, transistors).

Here's a step by step article on using an arduino to control a DC motor. It's targeted towards controlling a linear actuator. This is applicable whether it's just a DC motor or a complete linear actuator.

http://shiftautomation.com/control-linear-actuator-with-arduino-and-relays

You can use a relay board from any number of vendors, just make sure it's 5V and has (at least) two SPDT relays.

Hi

Thanks for your replies. It was my mistake sorry, it’s an Hall switch that I wish to use to count the motor rotations.

The product I am using is an Irte Omnisat Satellite dish positioner, but the PIC controller that It uses has broken. I have successfully counted with a PLC, but unsure where to go with an Arduino.

Unfortunately i cannot access the hall switch because it’s within the unit, the DC motor is 24v.

Thanks for everybodies help

Whandall: As far as I know reed switches do not bounce at all.

They bounce, sometimes a lot. So now I know better, sorry.

You may be thinking of mercury wetted relays, which for obvious reasons, aren't seen very much any more.