Repeater Controller

FM, Analogue, DSTAR, C4FM, etc Repeater discussion
Post Reply
VK2XSO

Repeater Controller

Post by VK2XSO »

I have built the world's most complex repeater controller.
I had a few spare minutes and a few spare components on the bench and the need for brain for the new local repeater.

This is the result.

Not withstanding any RF requirements like diplexers and cavities etc. To make a working repeater you will need the following.

* Two radios of your choice.
* One PIC 12F510, (yes it's an 8 pin DIL - I prefer the SMD version) cost ~$0.70
* One 100uF capacitor, ~$1.50
* One 10K potentiometer, ~$2.00
* Firmware for 12F510 which is listed below. Free.
- You'll also probably want an LED with an appropriate current limiting resistor. It has purpose but isn't required.

The software performs the bare minimum of requirements.
That's basically a simple time out function and a morse ID.
Oh and tail with a cute little beep at the end of each over.

When the repeater is turned on, the power LED comes on and flashes 3 times and then remains on.
The time out is set for roughly 3 minutes because so of you old buggers can waffle on, and I'm no exception.
If the repeater does time out, it will beep 5 times on the output audio and then inhibit the PTT and the LED will constantly flash until the timeout is reset.
The timeout is only reset if the chip itself is reset or the carrier detect is released.
There is a 7 second delay. No need to punish everybody for longer (unless you feel the need to lengthen this time)
The repeater will then ID in morse and go back to normal operation as if you had never upset it. (it's very forgiving).

This repeater won't annoy you with a morse ID every 10 minutes.
If you want to annoy repeater users with such a legality then you can change the code to suit your needs.
Otherwise if you leave it as it is, it will ID roughly one hour after the last transmission.

I had considered having it ID at the end of the first over in an idle period like most other repeaters.
I just decided to keep the code simple and if required that can be added in later.

----

You will need to change the morse ID in the source code to suit your needs.
If you look at the code where the callsign is located you will see that it is very simple to modify.
subroutines DIT, DAH and SPCE (space). There is no need for spaces between elements, this is automatic.
Of course a space is required between characters.
As an example: V = DIT DIT DIT DAH (as SPCE is required) K = DAH DIT DAH (another SPCE)

There is no limit to how much morse code you would like to send. Well, it's only a small PIC so the actual limit is program memory.

When you have modified the source code you will need to compile it with the MPLAB IDE (which is free) from microchip.
The compiled file will be a .hex file which then needs to be uploaded to the PIC chip.

----

So how to wire it all up....
It's not too difficult and a circuit diagram of the radio you use for the receive radio will help, else you will just need to use a multimeter and trial and error.
First thing is to find the part of the circuit that opens the squelch or is an indication that the squelch is open. Some radios have a "Busy" light or a carrier detect which makes the task very easy. Else you will just has to open and close the squelch manually while watching suspect points in the circuit. It's not actually hard to find several places in the radio that respond with a change in DC levels.
The controller can respond to either positive or negative carrier detect though it is currently set to respond to 0V = carrier detect and floating is muted.

This line is connected to pin 7 on the PIC.

The PTT of the transmitting radio is connected to pin 3 on the PIC.
The PIC pulls the PTT low to transmit, but it can be changed if required.

Most radios run on 12V but a lot do have internal +5V rails. While the PIC can run on 12V, it is easier and more reliable on 5V.
Pin 1 = +5V
Pin 8 = 0V

All that is left to be connected is the audio output of the receive radio to the microphone input of the transmit radio.
I put a lot of thought into this one and it was the most productive 3 seconds of my life.
I selected a 10K pot, the brush (center pin) is connected to the microphone.
On end of the 10K pot is connected to the speaker output of the receive radio

Pin 5 of the PIC is connected to the other end of the potentiometer via a 100uF.
This provides the morse, warning beeps and tail pips to the audio circuit and the potentiometer adjusts the bias of how loud the tones are compared to the audio. The audio gain is controlled by the volume on the receiver. The squelch on the receiver also needs to be set to mute the repeater.

The indicator/power LED connected to pin 2 with a current limiting resistor
A reset push button can also be connected to pin 4 which is the reset pin for the PIC.

Set the frequency on each radio, add any external hardware and your done.

I've tested this with a couple of combinations of radios and it's

Code: Select all


; Ultra simple repeater controller by Trash VK2XSO
;
;
;                   PINOUTS
;                   =======      PIC 12F510
;                                ____  ____
;                               |    \/    |   
;         5 Volts         Vcc --| 1      8 |-- GND
;                               |          |
;       POWER LED      GPIO,5 --| 2      7 |-- GPIO,0 AN0   RX INPUT
;                               |          |
;             PTT      GPIO,4 --| 3      6 |-- GPIO,1 AN1   SPARE
;                               |          |
;      RESET      GPIO,3 MLCR --| 4      5 |-- GPIO,2 AN2   TONE 
;                               |__________|
;
;
;                   +-------+
;    TX  <---PTT----|3     7|<---Squelch--- RX
;                   |       |
;                   |   5   |
;                   +-------+
;                       |
;                      === 100uF
;                       |
;                      <|
;                       |> 
;    TX  <---MIC------><|  10K pot
;                       |>
;                      <| 
;                       +-------Speaker----- RX 
;
;
;
; Programer socket DIP8
;


#include <P12F510.inc>
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _IntRC_OSC

OPTIN		EQU		001h		;OPTION register

DEL1		EQU		011h		;delay counter 1
DEL2		EQU		012h		;delay counter 2
DEL3		EQU		013h		;delay counter 3
DEL4		EQU		014h		;delay counter 4
DEL5		EQU		015h		;delay counter 5
TEMP		EQU		016h		;temporary register
FLAG		EQU		017h		;flag register

#DEFINE		TTT		FLAG,0		;TONE ENABLE
#DEFINE		RX		GPIO,2		;RX
#DEFINE		TONE	GPIO,1		;tone output pin
#DEFINE		PTT		GPIO,0		;PTT
#DEFINE		PWR		GPIO,5		;Power LED
#DEFINE		CARRY	STATUS,0	;CARRY
#DEFINE 	DC		STATUS,1	;DECIMAL CARRY (busy flag)
#DEFINE 	ZERO	STATUS,2	;ZERO
#DEFINE		PAGE0	STATUS,5	;RP0

;--------------------------------------------------------

ORG		0000h				;Reset Vector

INIT	bsf		STATUS,5	;page 1
		movlw	0C0h		;OPTION register
		movwf	OPTIN		;write register
		bcf		STATUS,5

;		movlw	b'00110000'	; outputs
;		movlw	0B1h		;b'10110001' configure AN[1:0] as analog inputs
;		movwf	ADCON0	
		movlw	000h
		movwf	ADCON0

		bcf		CM1CON0,3	;disable comparitor
		bsf		CM1CON0,6	;disable output

;		movlw	008h		;GPIO,3 input only
		movlw	00Ch
		tris	GPIO

		clrf	OSCCAL

		call	LDELAY
		bsf		PWR			;POWER LED ON flash 3 times
		call	LDELAY
		bcf		PWR
		call	LDELAY
		bsf		PWR		
		call	LDELAY
		bcf		PWR
		call	LDELAY
		bsf		PWR		
		call	LDELAY
		bcf		PWR
		call	LDELAY
		bsf		PWR

;		call	CALSGN
;		goto	MAIN


;---------------------------------------------------------------

CALSGN	bcf		PTT				;PTT ON
		call	SPCE			;VK2RAA   ..._   _._   .._ _ _  ._.  ._  ._ 
		call	SPCE			;VK2RQH   ..._   _._   .._ _ _  ._.  _ _._  ....
		call	SPCE			;==============================================================
		call	DIT				; V
		call	DIT
		call	DIT
		call	DAH
		call	SPCE			;-----
		call	DAH				; K
		call	DIT
		call	DAH
		call	SPCE			;-----
		call	DIT				; 2
		call	DIT
		call	DAH
		call	DAH
		call	DAH
		call	SPCE			;-----
		call	DIT				; R
		call	DAH
		call	DIT
		call	SPCE			;-----
		call	DAH				; Q
		call	DAH				
        call	DIT
		call	DAH
		call	SPCE			;-----
		call	DIT				; H
		call	DIT
		call	DIT
		call	DIT
;		call	DAH				; ======= end of the call sign ==========  Change the morse letters to suit your repeater. It's that simple.
		call	SPCE
		call	SPCE
		call	SPCE
		bsf		PTT				;PTT OFF

;		goto	MAIN
		goto	RSTOT
;		retlw	0

;------------------------------------------------

DIT		bsf		TTT
		call	SDELAY
		bcf		TTT
		call	SDELAY
		retlw	0

;-----------------------------------------------

DAH		bsf		TTT
		call	SDELAY
		call	SDELAY
		call	SDELAY
		bcf		TTT
		call	SDELAY
		retlw	0

;-----------------------------------------------

SPCE	bcf		TTT
		call	SDELAY
		call	SDELAY
		call	SDELAY
		retlw	0

;===========================================================

RSTOT	clrf	DEL1			;reset (idle) time out counters
		clrf	DEL2
		clrf	DEL3
		movlw	0BBh			;set idle ID to 1 hour	
		movwf	DEL4
;		clrf	DEL4
;		clrf	DEL5			;not used

MAIN	incfsz	DEL1			;increment idle timer
		goto	NORX	
		incfsz	DEL2			;increment idle timer
		goto	NORX
		incfsz	DEL3			;increment idle timer 52 seconds loop
		goto	NORX
		incfsz	DEL4			;increment idle timer 
		goto	NORX
;		decfsz	DEL5			;increment idle timer
;		goto	NORX

		goto	CALSGN			;No activity time out - time to ID

NORX	btfsc	RX				;is RX on
		goto	MAIN			;no
		bcf		PTT				;PTT on
		call	LDELAY

RESTX	clrf	DEL1			;reset time out counters
		clrf	DEL2
		clrf	DEL3
		movlw	0FCh			;3 minute timeout   256-4=FC
		movwf	DEL4
;		clrf	DEL5			;not used

REPTX	incfsz	DEL1			;increment idle timer
		goto	YESTX	
		incfsz	DEL2			;increment idle timer
		goto	YESTX
		incfsz	DEL3			;increment idle timer 52 seconds loop
		goto	YESTX
		incfsz	DEL4			;increment idle timer 
		goto	YESTX
;		decfsz	DEL5			;increment idle timer
;		goto	YESTX

		goto	TIMOUT			;Transmit Time Out has occured

YESTX	btfss	RX				;is RX off
		goto	REPTX			;no
;		bsf		PTT
		call	LDELAY			;delay between tail and roger beep
;		call	LDELAY
;		call	LDELAY

TAIL	bsf		TTT				
		call	SDELAY			;tail beep
		bcf		TTT
		bsf		PTT				;release PTT

;		goto	MAIN
		goto	RSTOT


;--------------------------------------------------------

TIMOUT	bsf		TTT				
		call	SDELAY			;beep
		call	LDELAY				
		call	SDELAY			;beep
		call	LDELAY			
		call	SDELAY			;beep
		call	LDELAY
		call	SDELAY			;beep
		call	LDELAY			
		call	SDELAY			;beep		
		bcf		TTT

		bsf		PTT				;disable PTT

TOTAL	bcf		PWR				;flash the power LED to signal timeout
		call	LDELAY
		bsf		PWR		
		call	LDELAY

		btfss	RX				;timeout
		goto	TOTAL			;RX not released

		clrf	DEL1			;reset timer
		clrf	DEL2			;reset time
		movlw	020h			;about 7 seconds
		movwf	DEL3			;

TTOUT	nop						;Time out release
		incfsz	DEL1			;increment idle timer
		goto	TTOUT	
		incfsz	DEL2			;increment idle timer
		goto	TTOUT
		incfsz	DEL3			;increment idle timer 7 seconds loop
		goto	TTOUT

		goto	CALSGN			;reset the repeater

;----------------------------------------------
; Long Delay

LDELAY	movlw	002h		;~1/3 second
		movwf	DEL3		;outside loop
LOOP3	movlw	0FFh		;256
		movwf	DEL2		;middle loop
LOOP2	movlw	0FFh		;256
		movwf	DEL1		;inside loop
LOOP1	nop
		decfsz	DEL1		;decrement loop 1
		goto	LOOP1
		decfsz	DEL2		;decrement loop 2
		goto	LOOP2
		decfsz	DEL3		;decrement loop 3
		goto	LOOP3
		retlw	0

;----------------------------------------------
; Short Delay

SDELAY	movlw	002h		;~1/3 second
		movwf	DEL3		;outside loop
SLOOP3	movlw	02Fh		;256
		movwf	DEL2		;middle loop
SLOOP2	movlw	0FFh		;256
		movwf	DEL1		;inside loop
SLOOP1	nop
		decfsz	DEL1		;decrement loop 1
		goto	SLOOP1
		btfss	TTT			;tone enable ?
		goto	NOTONE		;no
		movlw	002h		;generate tone
		xorwf	GPIO
NOTONE	decfsz	DEL2		;decrement loop 2
		goto	SLOOP2
		decfsz	DEL3		;decrement loop 3
		goto	SLOOP3
		retlw	0

		goto	MAIN

END


VK2GFR
Frequent Poster
Posts: 78
Joined: Mon Sep 20, 2010 8:21 pm
Location: Sydney, NSW

Re: Repeater Controller

Post by VK2GFR »

TRASH
I had a few spare minutes and a few spare components on the bench and the need for brain for the new local repeater.
Man if that's what you do for a few minutes for kicks, I'd hate to see what you'd do for a few hours/days therapy.
Mark, VK2GFR
Seven Hills
QF56LF
VK2XSO

Re: Repeater Controller

Post by VK2XSO »

Actually, that would be the APRS PIC digipeater project and PIC tracker.

I've written a lot of code for both and some new protocols for it, but I just don't have a lot of time to solve all the problems in a reasonable time frame.
I have other aspects of life to enjoy as well as ham radio and work.

Hang gliding takes up a little bit of time when the weather is good ... but APRS flies with me. :)
http://aprs.fi/#!mt=roadmap&z=8&call=a% ... ange=43200

That and of course expanding the APRS digi network .. a fringe benefit of working and travelling at the same time.
And there's always time for a bit of ATV. Yes.. on the hang glider too.
http://www.youtube.com/watch?v=HZNgdUBo ... AAAAAAAAAA
some of the video from the same flight as above.

23cm ATV gets out real well at 4000ft. :)
The repeater above is light enough to fly too. I just need to find some light small radios for the job :D
User avatar
VK3MEG
Forum Diehard
Posts: 344
Joined: Wed Sep 07, 2011 7:39 am
Location: melton,vic

Re: Repeater Controller

Post by VK3MEG »

awsome vid trash I assume its manilla nsw?
thanks for sharing
cheers
Steve now known as vk3ktt
QF22GG
VK2XSO

Re: Repeater Controller

Post by VK2XSO »

yep.
That's Manilla.
Ron VK2HRD was doing a Tandem on that day, so it was an excuse to fly.
There are a few other videos I've been playing with under my account on youtube. The anti shake software on youtube has done some weird stuff to some of them.
http://www.youtube.com/watch?v=mT5CbebxnVk

VK2LK
Forum Diehard
Posts: 250
Joined: Sun Jan 15, 2012 11:00 pm
Location: Sydney, Australia

Re: Repeater Controller

Post by VK2LK »

Whats the beeping noise for?
Matt, VK2LK
VK2XSO

Re: Repeater Controller

Post by VK2XSO »

The beeping is the vario.
It's just a vertical airspeed indicator.
So when you're climbing it beeps. When you're climbing fast, it beeps faster.
When it beeps really fast you usually start to make a similar noise !

Sometimes it will also give a low tone if you're descending. But often this is turned off.

I haven't decided what to do about the wind noise. Most other videos just add music to the audio and ditch the wind noise.
For ATV I was thinking of just patching in the microphone audio, but there is still a reasonable amount of noise.
VK2GFR
Frequent Poster
Posts: 78
Joined: Mon Sep 20, 2010 8:21 pm
Location: Sydney, NSW

Re: Repeater Controller

Post by VK2GFR »

Wouldn't a throat mic (old aircraft) style be the answer. At least we'll hear you reasonably well without the air noise? But then there'd be no "beep" on the height indicator.... :(
Mark, VK2GFR
Seven Hills
QF56LF
VK2XSO

Re: Repeater Controller

Post by VK2XSO »

I've been working on that. Some mics are better than others. Until today I had not found a suitable one.
My new Quangshen radio came with one and it kicks a***. I sound like darth vader !
"YOU UNDERESTIMATE THE POWER OF THE DAAAARK SIDE !!!"

The problem even with voice is that as the pilot I normally don't say anything. I tend to take a lot for granted so I have to force myself to talk.

More stuff to play with.

I noticed that I also have some of the pin configurations around the wrong way in the drawing. But nobody has picked them up yep.
The source code is correct, the ascii pin outs are incorrect.
VK2GFR
Frequent Poster
Posts: 78
Joined: Mon Sep 20, 2010 8:21 pm
Location: Sydney, NSW

Re: Repeater Controller

Post by VK2GFR »

"And on the left hand side you can see trees, trees & more trees...... oh and here comes the ground at a great rate of knots.... thump.
Well, a hard landing is a good one especially if ya don't hurt yourself."
Now that would be riveting stuff.... :mrgreen:
Mark, VK2GFR
Seven Hills
QF56LF
VK2XSO

Re: Repeater Controller

Post by VK2XSO »

I'm not actually moving that fast, and that landing is a bit uncharacteristic of a normal landing. I could have handled it better.
I had a little bit of a tailwind. You can see the windsock I flew past didn't have much to say about it.
The landing in the other video is a better example of a typical landing.

With a bit of luck I'll get to try out the new dual band radio tomorrow.
Maybe get the new aprs tracker running before next weekend when there will be about 200 gliders flying.
User avatar
VK5ZD
Forum Diehard
Posts: 700
Joined: Tue Feb 17, 2009 7:18 pm
Location: PF95ih
Contact:

Re: Repeater Controller

Post by VK5ZD »

Well, a hard landing is a good one especially if ya don't hurt yourself.
Any landing you can walk away from is a good one.
If you can still use the aircraft it's an excellent one :lol:

Iain
73
Iain Crawford - VK5ZD
Munno Para West, SA - PF95ih
VK2XSO

Re: Repeater Controller

Post by VK2XSO »

I have to walk away from all of them ! My undercarriage got no wheels !
And the aircraft stuffs into a bag, so I have to carry it.

I tried out the new Quangshen radio today with the throat mic. It works a treat. I'm really happy with it.
VK2GFR
Frequent Poster
Posts: 78
Joined: Mon Sep 20, 2010 8:21 pm
Location: Sydney, NSW

Re: Repeater Controller

Post by VK2GFR »

VK2XSO wrote: I tried out the new Quangshen radio today with the throat mic. It works a treat. I'm really happy with it.
There you go... Captain Trash @ 500mtrs.
Mark, VK2GFR
Seven Hills
QF56LF
VK2XSO

Re: Repeater Controller

Post by VK2XSO »

It's this particular mic, mark. The last throat mic was crappy.
This one is a BIG improvement. It's also kind of cool. I sound a bit like darth vader.
Post Reply