Notes
Slide Show
Outline
1
2009 East Coast
Large Scale Train Show
2
Unique Electronic Devices You Can Make!
3
Unique Electronic Devices You Can Make!
4
My Focus

    • Using my electronics skills to enhance what can be done with a model railroad
    • Building unique & custom circuits for model railroads
    • Making presentations & writing articles about how to “roll your own” circuits to satisfy my need to teach!
5
Objectives
  • Show how microcontrollers are programmed and connected to interact with railroad equipment
  • (Hopefully) Excite you with the possibilities and enable you to begin experimenting!
6
Highly Recommended: PICAXE

  • Designed in the UK for use in schools
  • SUPERB support
  • Free manuals, tutorials and software
  • Active & helpful forums on their web page & elsewhere on the web
  • PICAXE manuals, especially “section 3- Interfacing Circuits” are super in helping to put it all together on your railroad
  • Book:  “Programming & Customizing the PICAXE Microcontroller”


7
PICAXE

  • Best choice in terms of:
    • Capability
    • Ease of use
    • Cost
    • Support
      • dave@davebodnar.com
      • Many PICAXE articles at Large Scale Online &
      • www.trainelectronics.com
8
First Project:
Flashing Crossing Lights
    • Design objectives:
      • Alternately flash two red LEDs
      • Operate from battery power
      • Alter timing and other characteristics from software
9
First Project:
Flashing Crossing Lights
    • Then we will modify the circuit to:
      • Start from a button push
      • Do other “flashing” things by making minor changes in hardware & software


10
Flashing Crossing Lights
    • Parts:
    • Cost:
    • Less than
    •  $10.00


11
Flashing Crossing Lights
    • Software: free from www.picaxe.com
12
Flashing Crossing Lights
    • Other items needed:
    • Any Windows PC with serial port (or USB to serial adapter)
    • Programming cable
      • Needs only 3 wires - can use an old mouse cable
      • http://www.allelectronics.com/cgi-bin/item/CON-243/search/3-PIN_CONNECTOR_W_HEADER,_.1%22#34;_.html
      • http://www.allelectronics.com/cgi-bin/item/DB-9S/search/D-SUB_CONNECTOR,_9_PIN_FEMALE_.html


    • Soldering iron & wire cutters, etc.
      • A Solderless Development Package is available from www.phanderson.com for < $20.00
    • 4.5 to 5.5 volt power supply (3 @ AA cells)
      • Can operate with as little as 2 volts
      • Higher voltage needed for programming


13
Flashing Crossing Lights
14
Flashing Crossing Lights


15
Flashing Crossing Lights


16
Flashing Crossing Lights
    • Program 1:





    • Notes:
    • “start” is just a label telling the “goto” where to go
    • the program remains in the chip’s memory until it is manually erased or overwritten.




17
Flashing Crossing Lights
    • Program 2: modified to flash for 10 seconds and turn
    • off for 10
    • seconds












18
Flashing Crossing Lights
  • Program simulation is built in!


19
Flashing Crossing Lights
    • Hardware modification for button or reed switch activation:
20
Flashing Crossing Lights
    • Program 3: modified to flash 5 seconds on each button push
21
Two Sensors for Crossing
  • Add a second sensor so that the light goes on when it passes one sensor…
  • …and goes off when it hits the other sensor.
22
Two Sensors for Crossing
  • Program 4:
23
Lighthouse or Airport Beacon
  • Design objectives
    • Gradually brighten a bulb or LED to near full brightness
    • Momentarily flash to full brightness
    • Gradually dim till off
    • Delay for a set time
    • Repeat
    • Able to use LEDs or incandescent bulbs
24
Lighthouse Beacon
25
Lighthouse Beacon
  • Parts
    • Adds one resistor and one transistor to the original flasher circuit so that the PICAXE can control a high current bulb
    • The most significant changes are to the software


26
Lighthouse Beacon – 4 LEDs
27
Lighthouse Beacon – Halogen Bulb
28
Lighthouse Beacon
  • Pulsed
  • Width
  • Modulation
29
Lighthouse Beacon
    • Program #6
30
Lighthouse Beacon
  • The transistor makes it possible to drive a very bright bulb
  • Substitute a motor for the bulb and you can control a train’s DC motor!
  • The size of motor is only limited by the size of the transistor


31
Flashing Crossing Lights on Steroids!
    • Program 5:
32
We Can Now Control
  • Lights
  • Motors
  • Turnouts
  • Relays
  • Most electrically powered devices
33
Going Farther . . .
  • The two sensor crossing light control can easily be modified to make a “safe crossing” that can be used by two trains


34
Going Farther . . .
  • When the first sensor is reached the power is removed from the secondary line
35
Going Farther . . .
  • Once the main line train has passed the second sensor the power is restored
36
Going Farther . . .
  • We substitute a relay for the LEDs.  It controls the power to the secondary line
37
Going Farther . . .
  • Clever placement of diodes allows one relay to control the train movement based on direction of travel
  • The train never
    stops after it has
    already passed the
    crossing, only
    before the crossing
38
Going Farther . . .
  • More sophisticated optical sensors only release the stopped train after sensing that the last car of the main line train has passed






39
Your Ideas?
  • Questions?
40