Showing posts with label lighting. Show all posts
Showing posts with label lighting. Show all posts

Wednesday, February 07, 2018

How I reprogrammed a Deltang Rx102 with a Prog3

Introduction

The Deltang Rx102 receiver can be reprogrammed to change the default servo outputs from the pins to on/off outputs. This means that......
  • LEDs connected to the receiver can be turned on and off remotely by a transmitter, 
  • other devices can be operated through a relay 
  • or sound effects on sound cards can be triggered 
 ....... by pressing buttons, flicking switches or wiggling joysticks on your transmitter.

In my case, I wanted to reprogram my Rx102 so that it could be used to trigger the additional sound effects on a MyLocoSound steam soundcard, including as the whistle and safety valve.

Most sound cards which have additional sound effects (eg the MTroniks DigiSound, the Dallee and the Phoenix sound cards) require their inputs to be connected to 0v to trigger these additional sounds (see How to interface sound cards with Deltang receivers). Some receivers, such as the Deltang Rx65b are already programmed to provide 0v outputs for sound triggers, but the Rx102 does not. However, with a Deltang Prog3, reprogramming the outputs of the Rx102 is relatively easy.

Before ploughing through the instructions set out below, I would suggest you watch the video which I have made, demonstrating the process. It should, hopefully, make what follows a lot more understandable.

Contents

  1. Preparations
  2. Binding the receiver to the Prog3
  3. Programming the Prog3
  4. Transmitting the instructions from the Prog3 to the receiver
  5. Checking
  6. Conclusion

1. Preparations

 i. Deciding what you want to do

The first job is to decide what you want the outputs from the receiver to do. You can change any of the outputs to give:
  • Servo outputs
  • On/Off outputs
  • Auto directional lighting outputs
The default outputs from the signal pins on the receiver are:
Pin 1 - Servo output in response to Channel 1 on the transmitter
Pin 2 - Servo output in response to Channel 4 on the transmitter
Pin 3 - Servo output in response to Channel 3 on the transmitter
Pin 4 - Servo output in response to Channel 2 on the transmitter
Pin 5 - Servo output in response to Channel 5 on the transmitter
Pin 6 - Auto directional lighting (forward)
Pin 7 - Auto directional lighting (reverse)
Pin 8 - Servo output in response to Channel 4 on the transmitter (Pin 8 is located on the side of the receiver)
So, any pin on the receiver can be reprogrammed to respond to any Channel in any way you choose.

I decided that I wanted my receiver to be reprogrammed to give:
  • 0v on Pin 5 when Channel 5 went low (ie when the Bind Button on my Deltang transmitter was pressed)
  • 0v on Pin 4 when Channel 3 went high (ie when the Direction Switch on my Deltang transmitter was clicked in reverse)
  • 0v on Pin 3 when Channel 3 went low (ie when the Direction Switch on my Deltang transmitter was clicked forward)
 My next task was to consult the programming chart for the Rx102 on the Deltang website to discover what codes needed to be sent to the Rx102 to effect the changes I wanted.

ii. Consulting the programming chart

At first sight, the chart on the website can look a bit daunting. However, it actually makes a lot of sense when you work out how the various columns map on to the things you want to change on the receiver.

The part of the chart which was of interest to me was the second row (shown in bold):

2. PROGRAMMING OPTIONS:

Level 1 Level 2
Output number
Level 3
Output type
Level 4
Channel number
Level 5
Other choices
Information
1 flash 1-8 flash = P1-8 1 flash = Servo 1-7 flash = Channel 1-7
(eg: 1,2,1,4 = P2, Servo, Ch4)






1 flash 1-8 flash = P1-8 2 flash = On/Off led 1-7 flash = Channel 1-7 1 flash = ON when Ch is low
2 flash = ON when Ch is mid
3 flash = ON when Ch is high

4 flash = OFF when Ch is low
5 flash = OFF when Ch is mid
6 flash = OFF when Ch is high
Off in other positions (eg: 1,3,2,5,1 = P3, On/Off, Ch5 Low ON)


On in other positions
(6 options from v110-3)


The first column just tells the receiver the menu from which we are selecting our instructions. For the Rx102 there is just this one menu (for the Rx65b there are 13 different menus). The first code number is therefore 1.

The second column determines which output pin we want to change. I decided to start off by changing Pin 5 as I wanted to use this to trigger the whistle sound effect when the bind button on the transmitter is pressed. So, the next number I needed in my list of instructions for the receiver was 5 (ie pin 5)

The next column tells the receiver what action you want it to perform on the chosen pin. I wanted the on/off option (rather than controlling a servo or have directional lighting) and so my next instruction code for the receiver was 2.

The fourth column determines which Channel the pin on the receiver will respond to. In my case, I was wanting Pin 5 to respond to Channel 5 (ie the Bind Button) and so my fourth instruction was 5.

The fifth column tells the receiver how it must respond when receiving a signal on the chosen channel. In my case, I wanted the pin to give 0v when the Bind Button was pressed. Pressing the Bind Button on the transmitter makes Channel 5 go low - so I needed to use instruction 4 (ie turn OFF the output from Pin 5 when the signal from the transmitter on Channel 5 goes low).

iii Working out the codes I needed to send to the receiver

This gave me the following series of codes for the receiver:

1, 5, 2, 5, 4
ie:
  • 1= Menu 1
  • 5 = Pin 5
  • 2 = On/Off
  • 5 = Channel 5
  • 4 = 0v when the channel goes low
For my the other changes I wanted to make to the receiver, the codes are:

 1, 4, 2, 3, 6
ie
  • 1 = Menu 1
  • 4 = Pin 4
  • 2 = On/Off
  • 3 = Channel 3 (Direction switch)
  • 6 = 0v when the channel goes high (ie when the direction switch is in reverse)
..... and

 1, 3, 2, 3, 4
ie
  • 1 = Menu 1
  • 3 = Pin 3
  • 2 = On/Off
  • 3 = Channel 3 (Direction switch)
  • 4 = 0v when the channel goes low (ie when the direction switch is forward)
You might need to take a little while to grasp the logic of this - particularly how the values in the fifth column relate to the response you want to get when a button, switch or joystick is operated on the transmitter. Just remember, that moving a joystick, flicking a switch or pressing a button will make a particular channel go high or low (or higher or lower if it is a proportional control).

2. Binding the receiver to the Prog 3

The Prog3 is very much a stripped down transmitter and so the bind process is similar to any transmitter.

The first job is to put the receiver into bind mode. I had an earlier version of the Rx102 which requires a manual approach to putting the receiver into Bind Mode.
1. The receiver was turned off.
2. The large (black) bind plug was connected to signal pins 5 and 7
3. The receiver was turned on
4. The LED on the receiver flashed rapidly showing it was in Bind Mode
5. The Bind Plug was removed
NOTE: If you have one of the later Rx102s (marked Rx102(AB)) then it will go into Bind Mode automatically. Make sure the transmitter and Prog3 are turned off. Turn on the receiver and wait ten seconds. The receiver should go into Bind Mode (ie the LED on the receiver should flash rapidly).

To put the Prog3 into Bind Mode, I:
  1. Held the Bind Button on the Prog3 down
  2. Turned on the Prog3 (with the button still held down)
  3. Released the Bind Button
  4. The LED on the Prog3 and the LED on the Rx102 flashed once a second
  5. When the LEDs stopped flashing the bind process was completed.
  6. The LED on the Rx102 started flashing three times, then pause, three times, etc to show it was communicating with the Prog3
NOTE: Sometimes the bind process doesn't work first time. If so, turn off the receiver and the Prog3 and try the process again, moving the receiver and Prog3 to a different orientation. Also make sure there are no other transmitters on close by.

I then turned off the Rx102 to make sure I didn't accidentally reprogram it before I was ready.

3. Programming the Prog3

The Prog3 needed to be programmed with the first of the codes shown above (ie 1, 5, 2, 5, 4)

The first five pins on the Prog3 represent the five columns (or Levels) on the programming chart. So, I needed to change the values on each of the pins to those needed to reprogram the Rx102.

The 'values' on each pin are shown as a series of flashes of the LED on the Prog3.
  • 1-flash means the value on that pin is 1, 
  • 2-flash means it's 2, 
  • 3-flash means it's 3,
  • and so on........
 To change the values on each pin, we use the Bind Plugs which come with the Prog3. The Large Black Bind Plug increases the number of flashes on the pin it's connected to. The Small Red Bind Plug decreases the number of flashes on the pin.

When a Prog3 is delivered new, the values on each pin are 1, and so the Large Black Bind Plug is needed to increase them.

To check the value on Pin 1, I connected the Large Black Bind Plug to Signal Pin 1 and Negative Pin 1.

The LED started by flashing once, then pausing, showing the pin had the expected value of 1. I quickly removed the Bind Plug so it wouldn't increase to 2. (If it had, I would have used the Red Bind Plug to reduce it - the Red Bind Plug is connected to Signal Pin 1 and Positive Pin 1 (ie the middle pin)).

To change the value on Pin 2, I connected the Large Black Bind Plug to Signal Pin 2 and Negative Pin 2.

The LED gave 1-flash when it was connected, it then repeated 1-flash and went on to 2-flash, repeated, then 3-flash, repeat, 4-flash, repeat, then 5-flash. At this point I removed the Bind Plug and the LED repeated its 5-flash before going out. This showed the value on Pin 2 was now 5, as required.

I repeated the process of putting the Large Black Bind on Pin 3 until it showed 2-flash. Then Pin 4 until it showed 5-flash and finally Pin 5 until it showed 4-flash.

To 'fix' these values, the Bind Button was pressed on the Prog3.

The Prog3 was now ready to transmit the information to the Rx102.

4. Transmitting the information from the Prog3 to the Rx102

I first checked that the transmitter to which the Rx102 had been bound was off. It's not essential, but it is advisable so that nothing untoward happens.

The Rx102 was switched on and I waited until it started flashing three times, pause, three times etc, to show it was in communication with the Prog3.

I then pressed the Bind Button on the Prog3 and the LED on the Rx102 flashed rapidly to show it was receiving the information.

I released the Bind Button and the LED on the Rx102 returned to 3-flash.

The programming was now completed.

I turned off the Rx102 to make sure the new instructions were processed and also turned off the Prog3

5. Checking

To make sure all was well, I wanted to check that the instructions had been correctly transmitted and also that they were giving the output I was expecting.

I turned on the transmitter to which the Rx102 had previously been bound (in my case a Tx20) and then turned on the Rx102.

Once the LED on the Rx102 was glowing steadily, showing it had 'found' the Tx20, I connected an LED to Pin 5 of the Rx102. I had wired up an LED to a servo plug, the white lead (yellow on other servo leads) to the +ve leg of the LED and the black lead (brown on other servo leads) to the -ve leg of the LED. There is no need to connect a resistor in series with the LED as the Rx102 outputs are buffered with suitable resistors. The middle red lead was left unconnected.

When initially connected, the LED glowed, showing it was receiving 3.2v from the receiver (ie the output from Pin 5 was on).

I then pressed the Bind Button on the Tx20 and the LED went out - showing the output from Pin 5 was dropping to 0v. As expected.

I then reprogrammed the other two pins in the same way

Conclusion

The ability to reprogram the outputs of the Rx102 makes them even more versatile. There is no need for additional circuitry connected to the output pins for switching on lighting or accessories or triggering sound effects.

NOTE: The switched outputs are non-latching and so some sort of circuitry will be needed if the switch on the transmitter is also momentary. A latching flip-flop module such as this (£3 each on eBay) can be connected to the pin to provide a latching output.

See - How I created latching on/off outputs from a Deltang Rx102 receiver or see How I used a latching flip flop switch with reed switches for lighting circuits in my coaches)



Sunday, May 21, 2017

How I installed lighting in my coaches



Introduction

 Having just finished detailing the interiors of my Leek and Manifold Railway (ish) coaches (see How I made interiors for my coaches) and modified some figures to sit inside them (see How I modified some cheap figures for the 1930s), I thought it might be opportune to install some lighting in them. I thought of various ways it could be done such as using a bus-bar as I had done on my Ford(ish) railcar (see How I bashed some Andel coaches into a railcar). However, some time ago I had bought some lighting boards cheaply on eBay which were supposed to work off track power, so I decided to use these as the basis for my lighting circuitry.


Preparing the lighting strips

The first job was to remove all the components from the perforated boards. For some reason, the LEDs were wired in series and so, as I wanted to run them from a 3v supply, I needed to rewire them. The components (ie rectifier, voltage regulator, capacitor) were redundant and so were relegated to the spares box.


The LEDs were wired in parallel and trailing leads added to one end.


I now needed to decide on which batteries I would use and how the lighting would be switched on and off

Batteries and switches

Option 1 - Alkaline batteries and manual switch

My first idea was to keep things very simple. Power the lights with two AAA alkaline batteries and switch them on and off with a latching push-button switch.

The lighting strips were fixed under the roof with BluTak and the switch contacts were soldered directly to the contacts on the battery box.

The battery box was then attached to the underside of the roof with BluTak.

NOTE: Subsequently, I discovered that when the sun shone (a rare occurrence in this part of the world), the BluTak softened and was insufficient to hold the battery box in place, and so the BluTak was replaced with Gaffa Tape.

Of course, this meant the roof had to be removed each time I wanted to turn the lights on or off, but it also meant that, as all the wiring was attached only to the roof section, there were no trailing wires between the roof and the rest of the coach body.

However,I was not entirely happy with this arrangement. Although I fixed the rood in place with magnets to make it easily removable, I wanted some way of turning the lights on and off without having to remove the roof each time. The magnets gave me an idea.


Option 2 - Latching reed switch and alkaline batteries

As I did not want the switch to be visible on the roof, and I didn't want wires leading down from the roof to the body of the coach, I needed a method of operating the lights remotely. Radio control was an option, but expensive, whereas reed switches could be triggered with a magnet. However, reed switches only provide momentary switching so I searched the internet for simple electronic circuit which would provide latching on/off switching. There were some available, but these were quite complicated affairs - I much prefer the simple (and cheap!).

My mate, Greg, in Australia drew my attention to some very cheap electronic modules which provided latching outputs from a momentary trigger.

At just over £1.00 each (including postage), they were a lot cheaper than I could make from discrete components - and so I sent off for a few.

There were other versions available and I also considered latching Hall Effect integrated circuit chips, but the residual current drain (ie how much current they consume when 'off') was 60uA, whereas the residual current drain on these modules is 'less than 2uA, according the blurb on the eBay page.

When they arrived (by slow boat, it seemed), I wired one up on a small piece of Veroboard with a reed switch connected between the 0v and Trigger inputs.

This was then connected to the battery box and the lights.

The wiring is minimal - the Veroboard is not essential but, as reed switches are very delicate, I wanted to provide some sort of protection against accidental damage.


In the coaches, there are six LEDs wired in parallel, but these have been omitted for clarity.

Option 3 - Magnetically operated switch with a 3.7v rechargeable li-ion cell

For the third (brake end) coach, I decided to explore the feasibility of using a rechargeable 3.7v li-ion cell. I made up a small circuit board as above, but included a 2A polyswitch to protect against accidental sort circuits.

This was wired-in between the positive lead from the li-ion cell and the +ve input leg of the flip flip module.

However, I realised I also needed to include a 1S li-ion battery protection board in the circuit, to protect the li-ion battery from becoming over-discharged. Li-ion batteries must never fall below a charge of 2.7v otherwise they become permanently damaged and so some form of electronic protection needs to be included to prevent this from happening.
 
A 1S protection board was acquired (via eBay) and wired-up - two leads to the li-ion cell and two leads to the flop flop module board.

The cell and protection board were then wired-up with the module and LED boards.

Once everything had been tested, I made a box for the li-ion cell from black 1.5mm plasticard .....

 A 2.1mm DC socket was included in one end of the box ........

 ...... and wired-up .......

....... so it could be used to recharge the battery. All the leads and the battery protection circuit board were shrouded in heatshrink sleeving to help avoid accidental short circuits.

The battery box was assembled .......

...... and then wired back into the main circuit,

The battery box was fixed beneath the floor of the coach ......

 ..... giving plenty of clearance between it and the track.



....... and the leads from it connected to the rest of the circuitry with a 2 pole micro JST connector ......

..... enabling the roof to be removed completely if the need should arise.

Conclusion

In all three coaches, the lights are now switched on and off by waving a magnet over the coach roofs.

The reed switches have proven to be very sensitive and the magnet needs only to be waved in its general vicinity for the lights to come on (see video below).

I may increase the value of the resistor in the LED circuits, to reduce the current to the lamps. In the dark, they seem to be a lot brighter than the lighting which would have been available in the original coaches. This will have the added advantage of increasing the 'life' of the batteries before needing replacement or recharging.

I will be interested to find out how long the batteries do last. I imagine they will last longer than a year given that the current drain on them is so low. However, field-testing will enable me to put a more definitive figure on that. In the meantime, I am very pleased with how the coaches look - I now need to consider ways of lighting the station buildings and platforms as I now have good reason to run night trains.

Monday, April 24, 2017

How I made interiors for my coaches

Having bashed some Bachmann Jackson Sharp coaches into something vaguely resembling Leek & Manifold saloons (see How I converted Bachmann coaches into Leek & Manifold saloons ), I have been running them for a couple of years with no interiors. However, the large windows made the absence of interior detail only too apparent, and so it was inevitable that I eventually got around to making interiors. As my coaches are somewhat smaller than the L&M carriages on which they are based, I couldn't copy the interiors exactly, but I used the layout of the seating as my inspiration.
From Tramway and Railway World, July 1904
The first job was to translate the layout from the plan to the arrangement of the windows in my coaches. I decided to try and keep the size of the seating as near as possible to the originals, but reduce the spaces between them. I figured that if I used figures which were slightly under scale sitting on the seats then the differences might not be too apparent.

I felt that the wooden panelling of the interiors needed to be modelled in some way and so inner liners of 3/32" balsa were cut, using the dimensions of the windows as a guide.

I made the window apertures 1mm too large all round to ensure they were not too obtrusive. End pieces .......

..... and a centre compartment divider were also cut out from the same material, taking the dimensions from the doors and windows of the end panels of the coaches. Door frames fashioned from strips of  1/16" thick balsa.

Card templates for the double seats were made - 48 x 44mm for the seat back, 22 x 28mm for the seat, and 20 x 10 x 24mm for the seat support.

The component pieces were then cut from 3/32" thick balsa wood.

These were then assembled, the supports being fixed to the seat back first (using Superglue)  .......

The seat was then attached - making a single sided seat - or ........

...... another seat was added to the opposite side to make a double-sided seat.

This process was repeated until four double-sided and four single-sided double seats were made.

Card templates were made for the single seats (half the width of the doubles). The balsa was then cut out and made into four single-sided and four double-sided single seats.

 The seats of the L&M coaches were upholstered, even in the third class compartments, and so I thought about various ways of representing the upholstery. In the end, I simply cut pieces of 3/16" thick balsa, 1.5mm smaller all round than the seats and seat backs and chamfered the edges with sandpaper.

For armrests, sixteen 18mm long pieces of 3/32" square section balsa were cut, and a 2mm hole drilled near one end. Into the hole was inserted a 6mm long piece of cocktail stick, held in place with a dab of superglue.

The upholstery was then painted maroon with acrylic paint, to which some talcum powder had been added to matt it down.

To simulate the patterning of the fabric, I speckled the maroon pads with blue and yellow blotches - applied by flicking the paint off the bristles of a stiff brush.

The upper parts of the armrests were painted to match the upholstery .....

The seats and the 'walls' of the coaches were given a couple of coats of oak stained varnish, making sure that both sides of the balsa were varnished to avoid them curling-up as the varnish dried. The floor was painted dark brown with talcum-matted acrylic paint.

Once the varnish had dried, the seat pads and the armrests were glued into place, .......

.... and the vertical posts on the armrests were given a coat of stained varnish.

The floor was then inserted into the coach .......

...... and the walls were glued to it.

The seats were then glued into place, their backs coinciding with the window pillars as in the original L&M coaches.

The seating and the upholstery in the First Class compartment of the composite (brake end) coach was considerably more luxurious and so, once the seats had been constructed, the upholstery was fashioned from over-hardening poly-clay (Fimo).

Firstly a marble-sized lump of clay was kneaded and rolled into a ball.

This was then flattened ......
 

....... and shaped into a rectangle with rounded corners roughly 18mm wide.

The rectangle was then cut into a square shape (18mm x 18mm) - with a bevelled edge.

The buttoning was simulated by drilling a 1.5mm depression into the end of a piece of 4mm diameter wooden dowel and then filing some notches with a triangular file.

 This was ten pressed into the clay seat pad several times.

 The backs of the seats were made in a similar way - the rectangle being 18mm x 24mm. The dowel 'press' tool was used as a rolling-pin to create a depression in the centre of each pad .......

..... and the tool then used to create the 'padded' effect.

 The pads were then baked in the oven for half an hour at 120C.

The seat pads were then painted dark brown ......

..... and glued to the seats .........

..... and armrests made and glued into place as with the third class seats.

 The seats were then glued into the first class compartment.

Once the glue had set, the longitudinal seats for the third class compartments were measured and glued into place. As I couldn't be certain as to exactly how much room would be left for these, I decided each of these seats would be measured and fitted individually.

 These were varnished and the seat pads painted as previously, before being glued into place.

The seat pads were then glued on top.

Figures were then painted and positioned on the seats. As space was tight, I bought some under-scale (1:25) figures from China, and modified them with the addition of hats and longer dresses or skirts to help make them look more in keeping with 1930s fashions (see How I modified some cheap figures for the 1930s - pending)

BEFORE .......

.... and AFTER.

The figures were then glued into place inside the coaches.

Lighting was then added to each coach (see How I added interior lighting to my coaches - pending) - ......

....... and some decals were made and added to the outside of each coach (see How I made a crest for my railway).

And then, of course, the coaches had to be tested to check their appearance, during the day and at night!

As with most of my handiwork, the interiors don't bear close scrutiny - but they are a lot better than the empty voids which were there previously. As the coaches flash past (at a scale 18mph!), it's quite pleasing now to see faces peering out of the windows and an impression of opulence on the inside.