|
1
|
|
|
2
|
|
|
3
|
- Retired from public education
- Garden railroader for less than four years
- Electronics, ham radio, woodworking, computers & programming have
been hobbies for decades
- Garden railroading is a nice way to utilize those other interests in one
hobby
- Primarily interested in using my electronics skills to enhance what can
be done with a garden railway & teaching others to do the same!
- Much of this material in articles on LSOL
|
|
4
|
- Provide an overview of hobbyist microcontrollers
- Show how microcontrollers are programmed and connected to interact with
railroad equipment
- Demonstrate various devices & projects that utilize microcontroller
operation
- (Hopefully) Excite you with the possibilities and enable you to begin
experimenting!
|
|
5
|
- We all have an interest in how things work and many of us have enough
of a knowledge of basic electronics to know that something can be
done
- we just need a bit of
help putting all of the parts together to make it happen!
|
|
6
|
- We Know About:
- Batteries & power supplies
- Track wiring & motors
- DC & polarity
- Voltage & amperage & resistance
- LEDs (what an improvement we have seen in the last 5 years!!)
- Series / parallel circuits
- Switches SPST (on/off), SPDT, DPDT, transistors
- Programming
|
|
7
|
- Inexpensive
microcontrollers allow us to optimize the basic electronics and
programming knowledge that we have so that we can do some amazing
- (and personally
satisfying)
- things!
|
|
8
|
- They have been around for about 15 years
- Usually dedicated to a single purpose
- Small
- Inexpensive (lately!)
- Programmed in BASIC
- Programming requires nothing more than a computer with a serial or USB
port
|
|
9
|
- 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
- Book: Programming
& Customizing the PICAXE Microcontroller
- PICAXE manuals, especially section 3- Interfacing Circuits
are super in helping to put it all together in your garden
|
|
10
|
- Best choice in terms of:
- Capability
- Ease of use
- Cost
- Support
|
|
11
|
- Design objectives:
- Alternately flash two red LEDs
- Starts flashing when powered on or when a button is pushed
- Battery power
- Alter timing and other characteristics from software
|
|
12
|
|
|
13
|
- Other items needed:
- Software from www.PICAXE.com
- Any Windows PC with serial port (or USB to serial adapter)
- programming cable
- Needs only 3 wires - can use an old mouse cable
- Soldering iron & wire cutters, etc.
- A Solderless Development Package is available from www.phanderson.com
for < $20.00
- 4 to 5 volt power supply (3 @ AA cells)
|
|
14
|
|
|
15
|
|
|
16
|
|
|
17
|
- Program 1:
- Note: the program remains in the chips memory until it is
manually erased or overwritten.
|
|
18
|
- Program 2:
- Note: start is just a label telling the
goto where to go.
|
|
19
|
- Program 3: modified to flash 10 seconds and turn off for 10 seconds
|
|
20
|
- Hardware modification for button or reed switch activation:
|
|
21
|
- Program 4: modified to flash 5 seconds on each button push
|
|
22
|
|
|
23
|
- 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 accommodate LEDs or halogen lights
|
|
24
|
|
|
25
|
- Parts
- Adds one resistor and one transistor to the flasher circuit so that the
PICAXE can control a high current bulb
- The most significant changes are to the software
|
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
- Transistor makes it possible to drive a very bright bulb
- Substitute a motor for the bulb and you can control a trains DC
motor!
- Size of motor only limited by the size of the transistor
|
|
32
|
- Add a DPDT relay and you have complete speed and direction control
|
|
33
|
- IR control with TV remote
- The capacity to interpret IR codes is built into the PICAXE 08M!
- All you have to add is a single $2.00 device, the IR receiver (PNA4602)
|
|
34
|
- My first major project with the PICAXE
- Robot Train
- Battery operated, PICAXE controlled train
- Forward / reverse / gradual acceleration / deceleration
- Stop & reverse when it found magnets on the track
- Random pause between reversals
|
|
35
|
|
|
36
|
- Gadget to measure track length
- Grew out of a desire to know how much track I had in my main loop
- Needed an inexpensive counter that would count wheel rotations during
one lap around the layout
- Remembered using a calculator to do that in a science classroom
|
|
37
|
- Try this on a calculator: 1
+ 1 = = = =
- Reed switch under truck & magnet on wheel connected to
= key on calculator
- Wheel diameter X number of rotations = length of track
- December 2005
- Garden Railways
- Magazine
|
|
38
|
|
|
39
|
- Laps completed counter
- Wanted to count laps completed by my Robot Train
- Could have used calculator but they auto-off after 7 or 8
minutes
- Noticed a $4.00 pedometer
- at Wal-Mart with a 5 digit
- LCD display
|
|
40
|
- Pedometer for laps completed
- Extended the wires from the bounce switch to a reed
switch
- Each time the train passed, a magnet on the engine stimulated the reed
switch and the count incremented
- Does not automatically shut off or reset like most calculators
|
|
41
|
- The mechanism that is used in an electrically operated switch is either
a motor or a solenoid
- This allows us to use the same type of circuitry to control switches as
we use with motors.
|
|
42
|
|
|
43
|
|
|
44
|
|
|
45
|
- Idea from the ECLSTS
- 2 alternately flashing LEDs
- Not just on/off
- One brightens as the other dims
|
|
46
|
- Most microcontrollers support only one PWM channel
- Wiring two LEDs back-to-back allows one channel to control
one up & the other down in brightness
|
|
47
|
|
|
48
|
- PWM output pin on PICAXE takes the place of the potentiometer
|
|
49
|
|
|
50
|
- Advantages:
- More program memory (10+ single spaced pages of code!)
- More capable programming languages
- Faster executing programs
- Higher chip clock speeds
- Can directly drive an LCD display
|
|
51
|
- Disadvantages:
- Require a separate programmer
- Software NOT free
- Can be more difficult to work with
- Less support
- More research / experimentation required
- But
- Expanded capabilities make it worth the effort!
|
|
52
|
- Grew out of a discussion about another article for Garden Railways
- Experimented with repurposing other things as a train
speedometer (i.e. bicycle speedometer, counter, etc)
|
|
53
|
- Final design:
- 4 line x 20 character backlit LCD display
- Supports scales from 1:1 to 1:220
- Common scales identified by name
- Track-side sensors
- Counts laps
- Gives speed in real & scale MPH
- Option to beep out speed
- English or Metric units
|
|
54
|
- Wireless option:
- Uses radio transmitter on a modified car
- Senses train speed and sends it to the display unit
- Also can report voltage and current on a battery operated engine
|
|
55
|
- Voltage and Current can also be included in the packet that is
transmitted
|
|
56
|
- Originally designed to operate the motor on my holiday incline
- Repurposed the Speedometer by adding a power transistor, relay and
additional control buttons
|
|
57
|
- Grew into a more capable unit:
- Time between reversing up to 8 minutes
- Random time option
- LED readout of time till reverse
- Timed deceleration point
- Variable top and bottom
speed settings
- Remembers settings if powered down
|
|
58
|
- BARC
- 2 Potentiometers to adjust time / speed
- 2 Buttons to set options
- Mosfet to handle high (10 amp+) current motors
- 3 LEDs to show time & laps completed
- 176, 172, 167, 163, 158, 154
|
|
59
|
|
|
60
|
|
|
61
|
|
|
62
|
|
|
63
|
- Eggliner prototype with commercial detection unit
|
|
64
|
- Areas for enhancement
- 9+ volts needed to operate sensor
- Relay gave full on or full stop
- Size makes concealment difficult
- Rapid oscillation between on / off
- Option to put beacon on car in front
|
|
65
|
- Using PICAXE to build on and enhance Ralphs idea
- IR LED flasher (38 kHz)
- IR sensor high when it sees 38 KHz
- Relay / resistor for speed control
- Timed delay to avoid choppy movement
- Addition of a beacon on forward train to extend distance (FRED)
|
|
66
|
|
|
67
|
- IR sensor high when it sees 38 kHz
|
|
68
|
- Relay / resistor for speed control
|
|
69
|
- PICAXE sends out pulses, detects them and controls the motor in response
to what is sees
- Prototype:
|
|
70
|
|
|
71
|
|
|
72
|
|
|
73
|
- Idea from the LSOL forum request
- 7 LEDs light in a specific order to simulate a Mars lights
pattern
- One goes dim as the next brightens
- Utilizes higher speed PIC that can generate its own PWM pulses
|
|
74
|
|
|
75
|
|
|
76
|
|
|
77
|
|
|
78
|
|