Arduino Security System

To start, I am a complete novice to Arduino, but I want to do something really complicated. Maybe you guys could help me :slight_smile:

You see my friend keeps on having his milk stolen and he suggested to me that I should build a robot because I am quite into robotics, so that is what we are doing.

We have the structure of the security bot finished but the code is fairly impossible so this is what I need help with, if that is OK.
Here is the basic diagram of the Robot in the attachments.
This is all fine, but the code I hear is more difficult and I have no Idea what I am supposed to do.

What we want the robot to do is take a picture when the milk is taken. The robot can sense the milk with the PING))) sensor,when it arrives at 4:30 am,
but I do not know how to use the if or the else functions well enough to make it only move the servo to take a picture when the milk is taken, not when it arrives, or on constant when there is no milk.

We believe it is the Village tramp, in which case he can receive a donation instead of stealing others milk.

Thanks a lot for helping!

:open_mouth: :open_mouth: 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8)

If you can detect the presence of the milk, then you can take a picture when it changes from 'absent' to 'present' (to prove that the milk did actually arrive) and again when it changes from 'present' to 'absent' (to record what happened when it was taken).

If you get that working I would suggest taking several pictures at (say) one second intervals since you can't rely on a single picture giving everything you need.

I don't know what sort of camera you're envisaging - are you sure the whole thing won't just get stolen?

If you had a wireless webcam (and a means to power it) you could do the job from your PC using standard freely available motion detection software.

OP - do NOT cross-post.

Duplicate post removed.