This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

i want help abt program

sir, i want a help on program i w2ant to run cctv motor in 120 degree actually camera is affix on motor
an there are three camera
as u select the camera bye a selector you could get video of that lab and camerra will rotate as soon as motor will rotate by us of selector.
i am using 89c51

  • Power on = motor rotates.
    Power off = motor does not rotate.

    Now, you have to figure out exactly how you will connect the motors to the processor. That will decide how you turn on/off the power.

    And you will have to figure out how you know which angle the camera has, so you know when to stop the motor and reverse to rotate in the other direction.

    You may use end switches to detect when it reaches a limit. You can measure time to figure out how long it has turned.

    Or you may use a servo solution that can pick any angle. Either by you measuring the angle with a potentiometer, or a servo that you control with a pulse-width-modulated (PWM) signal to specify what angle it should turn to.

    Or you may use a stepper motor and "tick" the motor a number of steps in either direction.

    But in the end: This is a job for you. Not for the forum. If you get stuck with a specific problem, you may return with more information about where you got stuck.

  • More likely:

    power off = motor does not rotate;
    power on with one polarity = motor rotates in one direction;
    power on with opposite polarity = motor rotates in opposite direction.

    "you will have to figure out how you know which angle the camera has, so you know when to stop the motor and reverse to rotate in the other direction."

    Possibly, this could just be down to the user to stop pressing the button when the required view is reached...

  • Except that it should stop the motor if the user is stupid enough to keep the button pushed, and the camera isn't mounted to allow any number of turns in the same direction.

    It would be bad to burn the motor or rip the video cable because of bad programming and possibly missing sensors.

  • Surely, it can all be done just with switches?!

    In fact, it looks like you probably should do it just with switches first so that you actually understand what's going on...

    Once you've got it working and understood it with just the switches, then you could think about what improvements and advantages a microcontroller might bring...