Robot Arm Progress and Servo Testing

At today’s meeting of the Intermediate / Advanced group of Computer Club we began testing servos and controlling the movement of part of a robot arm using the Arduino microprocessor.  Our teams were successful in moving the servo and arm from 0 degrees to 90 degrees and then 180 followed by a sweep back and forth.

 

mrcampbell / October 14, 2016 / Computer Club

Arduino to detect Valid Audio from Bridgecom Repeater

We are using a Bridgecom Repeater that we wanted to try linking to another site.  Based on the documentation we used the DB25 port on the back of the repeater to get audio in, audio out and trigger the PTT through use of a Signalink  USB.  We found out that the repeater audio output emits all audio regardless of whether or not it had a valid PL tone (CTCSS).

Pin 17 of the DB25 port of the repeater is documented as COS (Carrier Operated Switch).  We found that the pin outputs random voltages until a valid signal is detected at which point the voltage drops to zero.  Using analog pin 0 of the Arduino we read the voltage.  Once the voltage is 0 we turn on the relay which causes audio to pass through to the Signalink.

Here is a diagram of our wiring:

Bridgecom Repeater COS Detector

Click on image to enlarge.

 

Below is the code we are currently running to implement this operation:


//Connect pin A0 to Pin 17 on repeater
//Connect Ground of arduino to ground of repeater
//When sensor is 0 key radio

const int analogInPin = A0; // This is the COS output on the repeater.
int sensorValue = 0; // value read from the pot

const int relayPin = 2; //This relay is used to connect the audio output of the repeater to
//Audio input on the computer.

void setup() {
     // initialize serial communications at 9600 bps:
     Serial.begin(9600); //We will use the serial line to debug this program
     pinMode(relayPin, OUTPUT); // set pin as an output
}

void loop() {
     // read the analog in value:
     sensorValue = analogRead(analogInPin);
     // map it to the range of the analog out:
     // change the analog out value:

     Serial.print("sensor = ");
     Serial.println(sensorValue);
     if (sensorValue==0){ //When the value goes to 0 that means a valid signal is detected.
     
          Serial.println("Relay On");
          digitalWrite(relayPin, HIGH); // turn the relay on
     
          do{ //Keep the relay on until the the COS is not 0
               delay(500);
          }while(analogRead(analogInPin)==0);
     
     }
     digitalWrite(relayPin, LOW); // turn the relay off
     delay(2);
}

 

mrcampbell / July 20, 2016 / Computer Club, KM2ARC