Detecting servo movement with Arduino

Hi everybody!
I was just wondering if it was possible (using an Arduino Uno) to detect if a servo motor is moving or not. I need to detect if a servo is sitting still in one position and I don't know how. Any help? I also wanted to know if it's possible to make sure that if the servo's not moving for a certain period of time (eg. 5 seconds) the Arduino board will send an analog signal to a led turning it on.
Sorry if I wasn't clear, I'm open to all suggestions/critics
Have a nice day

To give you a suitable answer, you need to tell us why you need to check if this servo is moving. What is controlling the servo now? A normal servo keeps it's position when powered on and not getting told to move anywhere, so it won't move anywhere under normal conditions.

If you just need to monitor the position of a shaft, you use a simple potentiometer, not a servo.

// Per.

There is no standard way of doing that... It's not a normal feature of a servo. The servo itself "knows" if it needs to move and just does it without "reporting" what it's doing.

You'd probably some kind of [u]rotary encoder[/u].

Or, there is a pot built-into the servo and you might be able to hack the existing circuit. But, the schematics aren't usually published and it may be difficult to disassemble it, etc.

I guess I won't be able to do it without buying an additional servo. Is there any way to create something like this using just two hc-rs04 modules, a servo and a led? I already got these things and I'm trying to find a way using just the things I got at my disposal. If there isn't a way than I guess I'll have to do some shopping!
Thanks

I appreciate the fact that you took your time to help me out but I don't think that's what I was looking for (or that or I'm a complete noob, which it's very likely). I wanted to find a way to detect if a servo is not moving at all. I want to achieve a similar result to what was in the video that I posted above but making sure that the turret doesn't fire as soon as it detects an obstacle but it waits for example 5 seconds before "shooting". I know it's complicated but I would really love to make it.

I wanted to find a way to detect if a servo is not moving at all. I want to achieve a similar result to what was in the video that I posted above but making sure that the turret doesn't fire as soon as it detects an obstacle but it waits for example 5 seconds before "shooting".

You do not need to detect if a servo is not moving to implement that function. That is indeed what that video shows, it finds the target, it says "there you are", it finishes saying it, and it then shoots. So it doesn't fire as soon as it detects an obstacle, if you want to say nothing then you just delay 5 seconds.

That is what I had in mind. The problem is how to do that. He (the guy from the video) is using different hardware and, consequently, a different code. It's too complicated and full of unnecessary things for what I'm planning to use it for (eg. I don't want it to play sounds).

It's too complicated and full of unnecessary things for what I'm planning to use it for (eg. I don't want it to play sounds).

So what hardware are you using? Arduino code is talking directly to the hardware and without knowing what hardware you are using you can only talk in generalities. However, the sensors only detect an object when it is pointing at it, so as long as you only fire when the sensor tells you there is a target then you have to be pointing at it. If the servo is moved in small increments before checking the sensor then you are bound to be pointing at the target.

Asking how to detect if the servo is moving is a typical X-Y Problem

*That then opens up the discussion of using delay() or doing a pause which doesn't block any other code which may be running.

No don't over complicate things. The OP is a beginner, he is not going to want to run any code during a delay.
All to often here we make things more difficult than things need to be.

There is far too much emphasis on debouncing inputs and writing state machines when 90% of the time there is simply no need and all it does is to confuse / drive away beginners by making things too complex.

Grumpy_Mike:
No don't over complicate things. The OP is a beginner, he is not going to want to run any code during a delay.
All to often here we make things more difficult than things need to be.

I actually thought that I had to use a delay() command, but apparently there's an easier way to do that... If so, how? I, once again, thank you all for your generous help.