- Posts: 56
- Thank you received: 5
Arduino [or other uCPU] controlled.....
- TheWag
- Offline
- New Member
Anyone else playing around with these nifty devices?
Ben
Please Log in or Create an account to join the conversation.
- Kelley
- Offline
- Dispatcher
- Posts: 764
- Thank you received: 73
Please Log in or Create an account to join the conversation.
- TheWag
- Offline
- New Member
- Posts: 56
- Thank you received: 5
If you've got some ideas as to what you'd like to setup, I'd be glad to walk you through.
Ben
Please Log in or Create an account to join the conversation.
- markm
- Offline
- Senior Member
- Posts: 293
- Thank you received: 69
Check out the Parallax site (another type of uController) at:
www.parallax.com/Portals/0/Downloads/appnt/stamps/bs1Appnotes.pdf
Section 21: Fun with Trains.
They go into great deal in working with model trains. The examples are N scale, but fortunately since its programmable, all you need is change the maximum throttle voltage to 8V.
While this is not Arduino, the uC chip in the Basic Stamp works the same as the Arduino chip and all the principles are the same...just a different programming language.
I have a bit of experience with such devices, starting in 1973 and a silicon valley engineer for them for 25 of those years, so I'm willing to try to help anyone who wants to use these in model railroading.
Mark
Please Log in or Create an account to join the conversation.
- Kelley
- Offline
- Dispatcher
- Posts: 764
- Thank you received: 73
This is some good stuff and I hope because the components are used by many people for many applications, that they would be cheaper than stand alone items that is used exclusively for just model railroading. All I have planned at the moment are 2 sets of lighted crossings, and I would like them to operate bells as well.
I hope these things will help other people get more fun out of their railroad.
Please Log in or Create an account to join the conversation.
- stonysmith
- Offline
- Moderator
- Posts: 316
- Thank you received: 175
I did buy a "motor shield" for my Arduino, and it works rather well, except it's rather finicky when the track isn't pristinely clean. I really should take a video of this thing in operation. Hm.. Where's that video camera again?
Please Log in or Create an account to join the conversation.
- markm
- Offline
- Senior Member
- Posts: 293
- Thank you received: 69
You are correct about not having many electronic gadgets in Z, although that seems true in all the scales.
Mark
Please Log in or Create an account to join the conversation.
- CNz220
- Offline
- New Member
- Posts: 19
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- stonysmith
- Offline
- Moderator
- Posts: 316
- Thank you received: 175
What he did not do was tell me who any of these 'other' people were.
Please Log in or Create an account to join the conversation.
- Bill_O
- Offline
- New Member
- Posts: 23
- Thank you received: 6
www.bakatronics.com
BK213 Traffic Light Controller, $39.95
Traffic Light controller for Bulb or LED type traffic lights. Includes outputs for walk / Don't walk lights and night blinking patterns
Module:
- Eight Sequenced outputs for 4 way traffic control and walk / don't walk lights
- Micro-processor controlled circuit with pre programmed sequences.
- Voltage regulator on circuit board to enable voltages from 7 to 14 VDC to be used
- Sequences are programmed to turn on and off for a realistic Traffic Light look.
- Will work with Bulb type lights or LED's common anode LED lights
- Walk light output included in module, but can be used without walk lights
- Driver chip is included in the module and can operate lights up to 300ma per circuit
- Assembled circuit board is 1" x 2 3/8" x approx. 1/2" high
BILL
Please Log in or Create an account to join the conversation.
- markm
- Offline
- Senior Member
- Posts: 293
- Thank you received: 69
Circuitron has a circuit in the last catalog I downloaded. It looks like a PAL/GAL based unit.
But if you have the Arduino units build your own unit. It's only a couple dozen lines of code, max. Add a 74LS06 or '16 to drive the LEDs and you're ready to go.
I built my first traffic light controller like the MR story, with TTL logic. The next one using a Basic Stamp and the last one using a GAL. Sort of lost interest at the time because of the issues with getting Z scale LEDs.
Mark
Please Log in or Create an account to join the conversation.
- markm
- Offline
- Senior Member
- Posts: 293
- Thank you received: 69
/*
Traffic
Cycles through 2 banks of Red-Yellow-Green LEDs to simulate a traffic signal for model railroading.
M. Markham 1-27-13
This example code is in the public domain.
*/
// Define the pins that will drive the signal
const unsigned int REDW = 2; // West - Primary Direction
const unsigned int YELLOWW = 3;
const unsigned int GREENW = 4;
const unsigned int REDN = 5; // North - Secondary Direction
const unsigned int YELLOWN = 6;
const unsigned int GREENN = 7;
const unsigned int TICK = 500; // Cycle clock
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pins as an outputs.
pinMode(REDW,OUTPUT);
pinMode(YELLOWW,OUTPUT);
pinMode(GREENW,OUTPUT);
pinMode(REDN,OUTPUT);
pinMode(YELLOWN,OUTPUT);
pinMode(GREENN,OUTPUT);
// Initialize all pins with red signal in both directions
digitalWrite(REDW,HIGH);
digitalWrite(YELLOWW,LOW);
digitalWrite(GREENW,LOW);
digitalWrite(REDN,HIGH);
digitalWrite(YELLOWN,LOW);
digitalWrite(GREENN,LOW);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(GREENW, HIGH); // turn the wesr green LED on red off
digitalWrite(REDW,LOW);
delay(5 * TICK); // wait
digitalWrite(YELLOWW, HIGH); // turn the yellow LED on green off
digitalWrite(GREENW,LOW);
delay(2 * TICK); // wait
digitalWrite(REDW, HIGH); // turn the yellow LED off red on
digitalWrite(YELLOWW,LOW);
delay(TICK); // short wait to present all red
digitalWrite(GREENN, HIGH); // Cycle north direction
digitalWrite(REDN,LOW);
delay(5 * TICK); // wait
digitalWrite(YELLOWN, HIGH); // turn the yellow LED on green off
digitalWrite(GREENN,LOW);
delay(2 * TICK); // wait
digitalWrite(REDN, HIGH); // turn the yellow LED off red on
digitalWrite(YELLOWW,LOW);
delay(TICK); // wait
// Ready to start the loop again
}
Please Log in or Create an account to join the conversation.
- Zcratchman_Joe
- Offline
- Senior Member
- Posts: 281
- Thank you received: 41
@@@ Radio Shack still sells electronics????? Who knew?
Please Log in or Create an account to join the conversation.
- stonysmith
- Offline
- Moderator
- Posts: 316
- Thank you received: 175
Please Log in or Create an account to join the conversation.
- TheWag
- Offline
- New Member
- Posts: 56
- Thank you received: 5
Please Log in or Create an account to join the conversation.
- markm
- Offline
- Senior Member
- Posts: 293
- Thank you received: 69
Zcratchman_Joe wrote: @@@ Radio Shack still sells electronics????? Who knew?
Yeah but they're trying hard not to. They've been selling components for "robotics experimenters" for some time starting with the Parallax Basic Stamp (which is one of the reasons I recommend it), motion and proximity sensors, even a GPS module. But as far as local availablity, I would describe it as spotty. The Shack near me has downsized to a phone and stereo store. But if I'm willing to do the "3 hour tour" down to Sacramento, a Rancho Cordova store is well stocked and the owner quite helpful.
As for the DIY books I haven't found one yet that I would recommend. The Arduino uses a programming language called C++: very powerful but not the easiest to learn. IMHO the books I looked at in B&N gloss over important concepts for a beginner and diverge into topics not really related to the Ardiuno. To me this is important when the books cost more than the system! If you know the C++ language, I would say that nearly every book I looked at will do. When I find an appropriate book for the group, I'll certainly post it.
I do find it a bit amusing that a chip I worked on nearly 20 years ago is the heart of a 21st century product.
Mark
Please Log in or Create an account to join the conversation.
- TheWag
- Offline
- New Member
- Posts: 56
- Thank you received: 5
markm wrote: Joe,
As for the DIY books I haven't found one yet that I would recommend. The Arduino uses a programming language called C++: very powerful but not the easiest to learn. IMHO the books I looked at in B&N gloss over important concepts for a beginner and diverge into topics not really related to the Ardiuno. To me this is important when the books cost more than the system! If you know the C++ language, I would say that nearly every book I looked at will do. When I find an appropriate book for the group, I'll certainly post it.
I'm partial to the adafruit tutorials. Got me up and running. Arduino Lesson 1 - Blink
Please Log in or Create an account to join the conversation.
- Zcratchman_Joe
- Offline
- Senior Member
- Posts: 281
- Thank you received: 41
Yes, this is pretty good, however they also mention Lesson 0, which I could find nowhere on the site.TheWag wrote: I'm partial to the adafruit tutorials. Got me up and running. Arduino Lesson 1 - Blink
How about www.ladyada.net/learn/arduino/index.html for the beginner that needs that extra - getting started - kind of help.
Joe
Please Log in or Create an account to join the conversation.
- TheWag
- Offline
- New Member
- Posts: 56
- Thank you received: 5
Zcratchman_Joe wrote: How about www.ladyada.net/learn/arduino/index.html for the beginner that needs that extra - getting started - kind of help.
Yeah, same folkz. I guess when they "upgraded" to the new system they missed something.
Please Log in or Create an account to join the conversation.
- markm
- Offline
- Senior Member
- Posts: 293
- Thank you received: 69
Just as an example of what is missing, the blink example uses the definition:
int led = 13;
const unsigned int led = 13;
#define led 13
While the differences are not important on a PC, knowing when to use each one can be critical on a uC.
As I posted ppreviously, I've not found a source I'd recommend, but if anyone has any other documentation, I love to learn about it.
Mark
Please Log in or Create an account to join the conversation.