RADIO STATION
My friends wanted to drive trains running near them!
Well ! You must do a radio control!
OK! I try.
The basic idea in in fig.1
Encoder+Tx to
Rx+decoder/DCC drive
Encoder
To select speed we wanted a pot, to quick select
addres thumbweels; the next project may
have displays and puls..we shall see!
I chose the
PIC 16F286, cheap,easily reprogrammable (how many time, my son).
The A/D conversion is made with the comparator.
Next version will drive two trains with the 2nd
comparator builted in.
Now the encoder/ decoder runs with 28 speed standard,
but it easy convert to select also 14 speed and 99 addresses.
I have also ,of course, the direction speed, and a
switch for FL, F1 ( is enough for us), a button for emergence stop and a button
for a 2nd speed.
The 2nd speed is usefull in some situation, ex when
train arrive in station, or you want switching cars; this 2nd speed is stored
in the EEPROM of PIC; you may adjust it by the following procedure:
-before switch on trasmitter, select a speed with the
address thumbweels... ex 01.. this is no address, but the new 2nd speed;
- than
you push the F1 button and switch on the trasmitter...wait some seconds and switch off the tx. Now 2nd speed is in
memory! Before to drive train, remember to select the rigth address!
For the TX and RX you may choose wath you want..I have
choose a ready to run wafer running at
433 MHz (by AUREL) ...speaking to a super reactive receiver.
This because for next step is necessary to have a
TX+RX in the driving set, and also this one is in the same little card!
(cheaper and easy to use than a sparate TX and RX at 866 MHz that runs better).
Well ... now i
have the base to drive 1 train (2 on next realise) with the base...but other
friends?
Other friends with slave TX running on same frequence.
The trasmission has a Tf (time of frame) ; in this
frame i may have some slots (Ts) for every trasmitter;this slots are different
for TXm, TXs1, TXs2 ecc.
The project may be changed with polled (from base)
Tx.. i will see next, but so we will need another TX in the base!
Is important that differents trasmitted slots don't
overlap each other; because precision and stability of quarze don't secure
this, i need syncro the trasmitter.
This is done by the master ( but can do it also a
slave!); when it transmits the code to drive trains, also resets the timers of
the slaves. If a slave is working
alone, occours a timeout and the slave runs happy!
Timing.
I must transmit: 8bits for address, 8 bits for speed
and Fx and direction and 8bits for checkbyte!
Because the bandwhidt of TX-RX i had (2 KHz), this
version go slow! I refresh the signal to base 4 times/sec ( Tf = 250 mS) and
every slot lasts about 70 ms.
So now you may have only 3 tx running together! (i
tried with 2! And is running well).
If I want more tx I may do the frame wider ( 400 mS
?), or shorting the slot time ( no checkbyte, but 1 or 2 parity bits or
shorting the HI-LO bits transmitted... now Hi bit=2 mS and LO bit = 0,8 ms).. i
will see in the next alpha version.. a.200034!).
TX
MASTER TX SLAVE
Note: pin
14 is 16! Pin without number on + 5V is pin 14;
RECEIVER
The receiver use a world famous PIC16F84 (you may
change with 16F628) for decoding signal and encoding to DCC Standard.
Next version will have also the pot and buttons to
drive a train, ex in station! For now i am hurry and want test it to see what
happens without other things!
RECEIVER
RECEIVER+POWER BOOSTER