The Rusty Spike

A Railroad Fan's Website

By

Completion: 1:24 Model of a Whelen Liberty Lightbar

And that’s a wrap. Well, almost. I need to bump up the amplification on the headlights and decal the model, but other than that, it is finished! The entire point of the exercise was a proof of concept on an accurate modern emergency vehicle lightbar, and boy oh boy did I learn a lot along the way. I’ll list those things after the video.

As the prototype of what is sure to be many incarnations to come, I dub this ’07 Ford Shelby GT500 my ‘Demonstrator‘! Please ignore the 8xAA battery pack on the side. Normally, this car can be powered by a 9V that fits nicely into the engine compartment, but I was plumb out of 9V batteries. Yes, there’s some in the house smoke detectors, but Murphey’s Laws have taught me a thing or two, so I left those 9Vs where they were 🙂 Anyways, using a 8xAA power supply tested the circuitry against a 12V source, so it’s all good! Enjoy:

Demonstrator: 1:24 Model Whelen Liberty Police Lightbar from claymore1977 on Vimeo.

Read More

By

Chasing Lights (74HC595 Register + TI Launchpad)

Okay ladies and gents, here’s a Chasing Light project using a single Shift Register (74HC595) and a TI Launchpad. (I’m currently following a line of research using the Shift Registers, but there is an easier way to do this with just a Launchpad alone.) It can be easily adapted for many uses. Examples include, but not limited to:

  • Theatre Signs
  • Airport Landing Strip
  • Eat At Dave’s Signs

This particular Launchpad project uses an external device called a Shift Register. Simply put, it’s a device that remembers the 1 or 0 you just put into. If you put another 1 or 0 into it, it shifts all the existing saved 1’s and 0’s over one slot and adds your newest value in. It can hold 8 values, hence the term 8-bits.

Here’s what it looks like when its all put together on a breadboard:

Chasing Lights v1.0 from claymore1977 on Vimeo.

Read More

By

Update: 1:24 Model of a Whelen Liberty (44″) lightbar

The lightbar project work continues!ModelWhelenLightbar-Crop01 All the proper ohm value SMD resistors *finally* arrived in the mail, and a few short evening work sessions later, the resistors are in place, dud LED light modules replaced and leads carefully soldered in… we have an operational Lightbar!

Now, the front 3 Red and 3 Blue are electrically different than the rear 3 Red and 3 Blue, so add in the working center takedown and 2 alley lights, there are 15 independent LED modules on this bar. However, the software that was on the MSP430 I hooked them up to only was written for the front 3 Red and 3 Blue only, so the bar is not flashing at its full potential…. yet!

Here’s a short video that’s a bit out of focus. I didn’t catch the focus issue when I uploaded it because it was well past midnight 🙂 Once I update the software I’ll film a higher quality version.

1:24 Model Whelen Liberty Police Lightbar from claymore1977 on Vimeo.

By

In Lieu of a Breadboard: PCB LED Test Harness

PCB LED Test BoardHere is a project idea for some of you. If you are anything like me and you are experimenting with an Arduino or TI Launchpad for the purposes of your model railroad, then you likely find yourself adding and removing LEDs and associated resistors to/from breadboards over and over again. So it dawned on me: Why not solder some LEDs and appropriate resistors for a 3.3V source onto a spare PCB project board and slap some headers on there? Well, since I was waiting for some parts for other MSP430 projects, I did just that!

 

Read More

By

Basic Electricity 101: Intro

Welcome to Basic Electricity 101, a course for model railroaders. The aim of this series of tutorials is to teach basic fundamentals in a real language, not ‘geek’. That being said, each fundamental will be used in a real world application or two so as to help convey its usefulness. Well, enough talk, lets get to it.

 

Section 1.1: Terminology

To kick things off, I think we need to first just grit our teeth and nail down some good old fashioned boring definitions. There are only 6 definitions that I think are required knowledge for a model railroader to claim mastery over Basic Electricity:

  • Voltage: Voltage is electrical potential. Think of this as the pressure aspect of a piping system. Measured in Volts(V, mV, uV, KV, MV, etc) and is represented equationally by the Letter E.
  • Resistance: Resistance is a measure of resistance a circuit offers to the flow of current. Think of this as the Head Loss aspect of a piping system. Measured in Ohms (Ω, KΩ, MΩ, etc.) and is represented equationally by the letter R.
  • Current: A measure of the flow of electrons due to Voltage and resistance. Measured in Amperes, or Amps for short(A, mA, uA, KA, MA, etc) and is represented equationally by the Letter I.
  • Power: Electrical power is a measure of Work (or work lost, aka, inefficiency) that a component performs. Real Power is measured in Watts (W, mW, uW, KW, MW) and is represented equationally by the letter P.
  • Capacitance: The measure of an electrical components ability to resist a change in Voltage. Measured in Farads (F, mF, uF, KF, MF, etc.) and is represented equationally by the letter C.
  • Inductance: The measure of an electrical components ability to resist a change in Current flow. Measured in Henry’s( H, mH, uH, KH, MH, etc) and is represented equationally by the letter H.

Measures of the above parameters can be expressed using the metric system:

  • Micro(u): 1/1,000,000
  • Milli(m): 1/1,000
  • Kilo(K): 1,000
  • Mega(M): 1,000,000

To tie these terms together, lets examine a circuit:

Example1.1.png

 

In this schematic, a battery is supplying 12 volts worth of electrical potential and a resistor is offering 1 ohm of resistance to the flow of current. The voltage will then push current through the circuit in the direction labeled by I. We now need to stop and examine a typical misconception of current flow.

As humans, we understand things like gravity. Gravity causes water to flow from a high altitude to low altitude. As such, we typically want to think that electrons flowing through a wire will flow from a positive pole on a battery to the negative one. In reality, its exactly opposite. The positive side of a battery is positive due to the LACK of electrons and the negative side is negative due to the EXCESS of electrons. So they are indeed flowing from negative to positive. Weird eh? Tracking the electrons as they flow is called electron current flow, where as tracking the opposite of that, aka, the holes the electrons used to fill in the atoms, the you get a flow in the opposite direction, aka, hole flow. We also call this ‘hole flow’ conventional current flow.

 

Hole Flow:

Example1.1.png

Electron flow:

Example1.1a.png

Due to our nature as human beings and for reason beyond the caring of the average model railroader, the human race has adopted the ‘conventional flow’ methodology as common practice. Flowing from positive to negative makes more sense anyway 🙂

 

Well, back to this schematic:

Example1.1.png

So the questions abound now: How much current is being drawn? How much power is being consumed by the resistor? Well, let Mr Ohm answer that for you:

 

Section 1.2: Ohm’s Law

Ah yes, you’ve probably heard of it, dreaded it, feared it… but here it is. And let me tell you, this is as simple as math can get. Plus Ohm’s law answers nearly 99% of the electrical oriented questions you may have asked over the years:

OhmsLaw.png

I = E / R

Where E = Voltage(Volts), R = Resistance(Ω), and I = Current (Amps).

Ohm’s law can be re-written to solve for any of the parameters:

I = E / R     Solved for Current

R = E / I     Solved for Resistance

E = I * R     Solved for Voltage

 

Now, understanding that this is still moderately meaningless, lets put it to use.

Example #1.1:

Example1.2_off.png

Given the circuit above, solve for I:

I = E / R     Ohm’s Solved for Current(I)

I = 12V / 1Ω     E = 12 Volts, R = 1 Ohm

I = 12A

Current is expressed in Amps, so our answer is 12 Amps.

Example1.2_on.png

How much voltage should we expect to see if we were to measure ‘across’ resistor R1?

Example1.3_on.png

Almost obviously, 12 volts.

Something to understand when analyzing a circuit is the assumptions you will have to make. A very safe assumption, when dealing with simple circuits such as these, is to assume that the positive pole of your power source is at full voltage, for us 12V, and the negative side is at 0 (zero) volts. (We do this for analytical purposes only. In reality, its slightly different for an ungrounded DC or floating ground System!) Zero volts is also referred to as ‘ground state’… not be confused with ‘an electrical ground’. We will discuss this later.

So if we start with 12V at the positive side, by the time we trace our circuit all the way back to the negative side of our battery we have ‘lost’ all of our voltage. This is called ‘voltage dropping.’ Since there is only one component in our circuit above, then Resistor R1 must be ‘dropping’ all 12V.

Section 1.3: Power

The most famous measure of electrical power is the Watt, and since its the most common throughout model railroading, we will discuss it exclusively (with the exception of a brief excursion into Volt-Amps). Power has many different equations suitable for many different situations, but for a simple 12V DC application, power is simply this:

Power = Volts * Amps

P = I * E     Power is easy as PIE… snort snort, sorry, geek joke.

Now, its also easy to use Ohm’s Law to adapt this equation to whatever parameters you have available:

P = I * E     Used when you only have the Voltage and Current components

P = (E)2 / R     Used when you only have the Voltage and Resistance components

P = I2 * R     Used when you only have the Resistance and Current components

 

Example #1.2:

You have a 60W light bulb in your hand. You know it runs off of 120V household voltage. Approximately how much amperage will it draw?

P = I * E     Initial Power EQN

I = P / E     Power EQN solved for Current

I = 60W / 120V     Value substitution

I = 0.5 A     Answer in Amps

 

 

Example #1.3:

Example1.3_on.png

Back to this circuit. How much power is resistor R1 using? Well, there are several different was to approach this, but since we have already solved for current in an earlier example, we can just use:

P = I * E     Initial Power EQN

P = 12V * 12A     Value substitution

P = 144W     Answer in Watts

 

Or:

P = (E)2 * R     Initial Power EQN

P = (12V)2 / 1Ω     Value substitution

P = 144W     Answer in Watts

 

Or:

P = (I)2 * R     Initial Power EQN

P = (12A)2 * 1Ω     Value substitution

P = 144W     Answer in Watts

 

So as you can see, there are several ways to skin the Power cat!

 

Example #1.4:

Example1.4_off.png

Lets change up the parameters a bit. Given this circuit, solve for Current and Power.

I = E / R     Ohm’s Law solved for Current

I = 12V / 6Ω     Value substitution

I = 2A     Answer in Amps

 

P = I * E     Initial Power EQN

P = 12V * 2A     Value substitution

P = 24W     Answer in Watts

Example1.4_on.png

Ah, now doesn’t that feel good to exercise those equations a tad? As a note of interest, the resistor in all of the previous schematics represents ‘any given load’ on an electrical system. Motors, lights, LED’s, servos, electro-magnets, etc.. all have resistance and therefore can schematically be represented as a resistor. Granted its probably more intuitive to a schematic reader to see a light represented as a light. 🙂

 

Example #1.5:

Example1.5_off.png

Oh ho ho, getting crazy now! Not really, its just the addition of several more voltmeters and one more resistor.

Adding resistance can be easy, but it can also be quite difficult. Resistors in series are simply added up. What is shown in example #1.5 is 3Ω + 3Ω = 6Ω. Parallel resistors are a tad more difficult, and we will address them soon, but not now.

What we are seeing here is the illustration of voltage dropping as it happens. The voltmeter measuring A to C is registering a full 12V, where as the ones measuring A to B and B to C are only measuring 6V each. Calculating the voltage drop of a component can be an exercise in the ‘chicken or the egg’ scenario as explained here:

We can use Ohm’s law to calculate the voltage drop of a component:

I = E / R     Ohm’s Law solved for Current

E = I * R     Ohm’s Law solved for Voltage

E = I * 3Ω     Value substitution. Note this is the resistance of the component we are solving for (3Ω) NOT the overall circuit resistance(6Ω)

But wait, we haven’t calculated overall circuit current yet!

I = E / R     Ohm’s Law solved for Current

I = 12V / 6Ω     Value substitution

I = 2A     Answer in Amps

Back to calculating the voltage drop of R1:

E = I * 3Ω

E = 2A * 3Ω     Value substitution

E = 6V dropped across R1.     Answer in Volts

Example1.5_on.png

Being able to calculate current and voltage drop is VITAL if you want to custom tune brightness and life span of any light bulbs you may have / want to put on your layout.

Example #1.6:

Given the schematic in example #1.5, consider R1 a resistor and R2 a light bulb:

If R2 is a bulb rated for 6V at 0.01A, then what is the required rating for R1 if you want to have the bulb drawing ‘rated’ current?

Firstly, solve for the light bulb’s resistance:

I = E / R     Ohm’s Law solved for Current

R = E / I     Ohm’s Law solved for Resistance

R = 6V / 0.01A     Value substitution

R = 600Ω     Answer in Ohms

And just for curiosity, solve for power of the light bulb:

P = E * A

P = 6V * 0.01A     Value substitution

P = 0.06W or 60mW     Answer in MiliWatts

 

Okay, we know we have a light bulb rated for 6V with an internal resistance of 600Ω, so now how do we make a 12V source give us only 0.01 amps? Well, we first should solve for the overall circuit resistance requires to limit 12V to pushing 0.01A:

I = E / R     Ohm’s Law solved for Current

R = E / I     Ohm’s Law solved for Resistance

R = 12V / 0.01A     Value substitution

R = 1200Ω     Answer in Ohms

Ah good, we see that a 12V power source needs 1200Ω of resistance to limit current to 0.01A (10 mA). So if we need a total of 1200Ω, and the light bulb has a calculated 600 ohms internal resistance…we need a 600Ω external resistor to keep our light bulb from blowing up! Simple eh? 🙂

But wait, after rummaging through your box of resistors, you can only find a 660Ω! How will this affect your light bulb?

I = E / R     Ohm’s Law solved for Current

I = 12V / 600Ω(lightbulb) + 660Ω(resistor)    Value substitution

I = 12V / 1260Ω(resistor)    Simplify

I = 0.0095A (or 9.5mA)     Answer in Amps

Well it looks like that by using a 660Ω resistor instead of our calculated 600Ω, current flowing through our bulb dropped from 10mA to 9.5mA! The bulb should glow ever so slightly dimmer and the bulb lifespan should be ever so slightly longer.