Trying to complete this project but can't solve a problem. Using a Bescor-MP101 ptz controllerhttp://www.21best.com/21_best/electronic/security/video/pan_tilt/MP-101b-pan-tilt.html, RadioLink RC remote and receiver and Arduino Nano to pan and tilt my Canon Camcorder.
Using Yvan / Wireless Arduino controlled PTZ Camera System (brainy-bits.com) project and code. Could not get the RC remote he used but thought this Radiolink should be the same. But can't get it to use both pan and tilt channels together. Can only use one or the other. If I remove the pan connector from pin D2 on the nano it will tilt. Or if i remove the tilt connector on pin D3 it will pan. But if both connectors are connected it will only tilt does not pan. This project will also zoom but haven't got that far.
I'm new at all this, never used any of these parts before. Electronically and computer literate Just trying to build a pan/tilt remote system for our camera.
Using a breadboard to make all the connections.
Power is coming from the Bescor-mp101 using extension cable cut the female connector off soldered breadboard wires onto each wire.
6.2v pin 4 purple wire to nano 5v pin
Then the following wires, verified all wires are correct to proper pins on Bescor mp-101
Left pan pin 2 yellow wire to nano D11 pin
Right pan pin 6 white wire to nano D10 pin
Down tilt pin 3 blue wire to nano D12 pin
Up tilt pin 5 black wire to nano D9 pin
Ground pin 1 red wire to nano GND pin
RC receiver is powered using breadboard 5v pin
Checked the receiver using the Radiolink app and the channels are being outputted correctly.
CH 1 is connected to nano pin D2 (right joystick Left/Right) Pan
Ch 3 is connected to nano pin D3 (right joystick Up/down) Tilt
Here is the code I'm working with below
/* Arduino RC controlled PTZ camera mount
Created by Yvan / https://Brainy-Bits.com
This code is in the public domain...
You can: copy it, use it, modify it, share it or just plain ignore it!
Thx!
Modified slightly by Billh
*/
#define left 11 // Nano Pin D11 controls left pan
#define right 10 // Nano Pin D10 controls right pan
#define down 12 // Nano Pin D12 controls down tilt
#define up 9 // Nano Pin D9 controls up tilt
#define zoomin A0 // Nano Pin A0 controls Zoom In
#define zoomout A1 // Nano Pin A1 controls Zoom Out
#define channel4 4 // Nano Pin D4 connected to RC receiver channel 4 which controls Zoom
#define channel1 2 // Nano Pin D2 connected to RC receiver channel 1 which controls Pan
#define channel3 3 // Nano Pin D3 connected to RC receiver channel 3 which controls Tilt
// Note that Pin D5 is connected to RC receiver channel 5 but is not used in this code
// Variables to hold the RC Receiver received values
int ch1 = 0;
int ch2 = 0;
int ch3 = 0;
int ch4 = 0;
void setup()
{
// Set the Pin modes
pinMode(channel1, INPUT);
pinMode(channel3, INPUT);
pinMode(channel4, INPUT);
pinMode(left, OUTPUT);
pinMode(right, OUTPUT);
pinMode(down, OUTPUT);
pinMode(up, OUTPUT);
pinMode(zoomin, OUTPUT);
pinMode(zoomout, OUTPUT);
//Write all pins LOW at start
digitalWrite(up, LOW);
digitalWrite(down, LOW);
digitalWrite(left, LOW);
digitalWrite(right, LOW);
digitalWrite(zoomin, LOW);
digitalWrite(zoomout, LOW);
}
void loop() {
// Get current values of RC Receiver Channels
ch1 = pulseIn(channel1, HIGH, 20000);//Pan
ch3 = pulseIn(channel3, HIGH, 20000);//Tilt
ch4 = pulseIn(channel4, HIGH, 20000);//Zoom
// Tilt based on the input from the Right (Up-Down movement) joystick from the RC Transmitter
if (ch3 < 1200) // Transmitter Joystick pushed UP
{
digitalWrite(up, HIGH);
//analogWrite(up, 255); // Move the Bescor MP-101 Camera Tilt UP
}
else if (ch3 > 1700) // Tranmitter Joystick pushed DOWN
{
//analogWrite(down, 255); // Move the Bescor MP-101 Camera Tilt DOWN
digitalWrite(down, HIGH);
}
else // Put pins LOW to stop Tilt movement of Bescor MP-101
{
digitalWrite(up, LOW);
digitalWrite(down, LOW);
}
// Pan based on the input from the Right (Left-Right movement) joystick from the RC Transmitter
if (ch1 < 1200) // Transmitter Joystick pushed Left
{
digitalWrite(left, HIGH); // Move the Bescor MP-101 Camera Pan LEFT
}
else if (ch1 > 1700) // Transmitter Joystick pushed RIGHT
{
digitalWrite(right, HIGH); // Move the Bescor MP-101 Camera Pan RIGHT
}
else // Put pins LOW to stop Pan movement of Bescor MP-101
{
digitalWrite(right, LOW);
digitalWrite(left, LOW);
}
// Zoom based on the input from the Left (Up-Down movement) joystick from the RC Transmitter
if (ch4 < 1000) // Transmitter Joystick pushed UP
{
digitalWrite(zoomin, HIGH); // Simulate pushing the Zoom IN tact switch on the eBenk LANC remote
}
else if (ch4 > 2000) // Transmitter Joystick pushed DOWN
{
digitalWrite(zoomout, HIGH); // Simulate pushing the Zoom OUT tact switch on the eBenk LANC remote
}
else // Put pins LOW to stop ZOOM
{
digitalWrite(zoomin, LOW);
digitalWrite(zoomout, LOW);
}
}
