|
1
|
|
|
2
|
|
|
3
|
- Retired from public education (science / math teacher then technology
training & administration)
- Garden railroader for less than four years
- Electronics, ham radio, woodworking, computers & programming have
been life-long hobbies
- Primarily interested in using my electronics skills to enhance what can
be done with a garden railway & teaching others to do the same!
|
|
4
|
- Provide an introduction to microcontroller interaction with electronic
devices
- 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
|
|
14
|
|
|
15
|
|
|
16
|
|
|
17
|
- Program 1:
- Note: the program remains in the chip’s 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
- The most significant changes are to the software
|
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
|
|
32
|
- Transistor makes it possible to drive a very bright bulb
- Substitute a motor for the bulb and you control a train’s DC
motor!
|
|
33
|
- 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
|
|
34
|
|
|
35
|
- 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
|
|
36
|
- 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
|
|
37
|
|
|
38
|
- 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
|
|
39
|
- 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
|
|
40
|
|
|
41
|
|
|
42
|
|
|
43
|
|
|
44
|
|
|
45
|
|
|
46
|
|
|
47
|
|
|
48
|
|
|
49
|
|
|
50
|
|
|
51
|
|
|
52
|
|
|
53
|
|
|
54
|
|
|
55
|
- 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
|
|
56
|
- 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!
|
|
57
|
- 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)
|
|
58
|
- 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
|
|
59
|
- 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
|
|
60
|
- Voltage and Current can also be included in the packet that is
transmitted
|
|
61
|
- Originally designed to operate the motor on my holiday incline
- Repurposed the Speedometer by adding a power transistor, relay and
additional control buttons
|
|
62
|
- 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
|
|
63
|
- 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
|
|
64
|
|
|
65
|
|
|
66
|
|
|
67
|
- Eggliner prototype with commercial detection unit
|
|
68
|
- 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
|
|
69
|
- Using PICAXE to build on and enhance Ralph’s 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)
|
|
70
|
|
|
71
|
- IR sensor – high when it sees 38 kHz
|
|
72
|
- Relay / resistor for speed control
|
|
73
|
- PICAXE sends out pulses, detects them and controls the motor in response
to what is “sees”
- Prototype:
|
|
74
|
|
|
75
|
|
|
76
|
|
|
77
|
|
|
78
|
|
|
79
|
- Idea from the ECLSTS
- 2 alternately flashing LEDs
- Not just on/off
- One brightens as the other dims
|
|
80
|
- 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
|
|
81
|
|
|
82
|
- PWM output pin on PICAXE takes the place of the potentiometer
|
|
83
|
|
|
84
|
|
|
85
|
- Idea from the LSOL forum request
- 7 LEDs light in a specific order to simulate a Mars light’s
pattern
- One goes dim as the next brightens
- Utilizes higher speed PIC that can generate its own PWM pulses
|