Go Down

#### pcguru000

#45
##### May 03, 2013, 02:42 amLast Edit: May 03, 2013, 02:54 am by pcguru000 Reason: 1

You have to connect the CA to +5, and NO, doing so will NOT "overvolt and damage them" - unless you don't use a resistor!
When the LED is ON it's forward voltage is "3.5V"
So, the balance of the 5V will be across the resistor - 1.5V
That 1.5V across the resistor will determine the LED current
1.5V / 100? = 15mA

PERFECT i am starting to understand! Thank you for this confirmation, i had just read this:

And now I am going to put a 102 ohm resistor (brown - black - red - gold) [right ? hehe] on each ground wire for this display.

zzzz.. think i read this wrong- 4band vs 5 band resistors :/  guess brown black red gold is actually 1000 ohms lol

Looks like ill have to get to radioshack for some 80-100 ohm resistors...

How can I test that the resistors are working? Should i just use a spare LED? I don't want to fry a segment on this display...

#### Runaway Pancake

#46
##### May 03, 2013, 03:23 am
Get 100? (brown-black-brown) resistors - or my head will explode.

"How can I test that the resistors are working?"
The only way to KNOW is with a voltmeter.
+5 to CA, one lead of one resistor to any segment (cathode) with the other lead to Gnd.
There will be approx 1.5V across that resistor.

If the "spare" LED is a blue LED, you can use that.
If the "spare" LED is another colour then it will have a different forward voltage and skew the results.
"You gotta fight - for your right - to party!"
"Who is like unto the beast? who is able to make war with him?"
It's "bipolar transistor" or "junction transistor" - "BJT" is stupid.
When all else fails, check your wiring!

#### pcguru000

#47
##### May 03, 2013, 04:49 am

Get 100? (brown-black-brown) resistors - or my head will explode.

"How can I test that the resistors are working?"
The only way to KNOW is with a voltmeter.
+5 to CA, one lead of one resistor to any segment (cathode) with the other lead to Gnd.
There will be approx 1.5V across that resistor.

If the "spare" LED is a blue LED, you can use that.
If the "spare" LED is another colour then it will have a different forward voltage and skew the results.

Sounds good thanks- yeah I was expecting that the spare would have to be a blue one, and I figured it'd have to be tested with voltmeter.

I'll check this out tomorrow. THANK YOU everyone.

Hopefully this solves the issues I was having initially w/ the analog input voltage being skewed once plugged into my bike.

#### Robin2

#48
##### May 03, 2013, 08:46 am
Thanks. I had overlooked the fact that you can feed a small water pipe from a large one.

...R

Power transfer involves maximizing the product of voltage and current in the load. When you do the maths it turns out the maximum transfer is when the output impedance of one device matches the input impedance of the other. However, here we do not want to transfer power but transfer voltage. To do this requires that the output impedance be very small compared to the input impedance. With an arduino the input impedance is very high and if you supply it from an output impedance of 10K then you get virtually perfect voltage transfer.

The point about an impedance is that in most cases the value is frequency dependent so when quoting an impedance you should also specify the frequency where that impedance applies.

Two or three hours spent thinking and reading documentation solves most programming problems.

#### Runaway Pancake

#49
##### May 03, 2013, 02:42 pm

Hopefully this solves the issues I was having initially w/ the analog input voltage being skewed once plugged into my bike.

The analog trouble's solution will be changing the source/"Vin" to 9V.
"You gotta fight - for your right - to party!"
"Who is like unto the beast? who is able to make war with him?"
It's "bipolar transistor" or "junction transistor" - "BJT" is stupid.
When all else fails, check your wiring!

#### pcguru000

#50
##### May 04, 2013, 04:18 amLast Edit: May 04, 2013, 04:22 am by pcguru000 Reason: 1
Thank you everyone!!! - I uploaded a updated version of my diagram to the OP. And also- check this out:

I am going to tweak the software a bit more to just stay blank in between gear shifts.

Other than that- this is ROCK solid, displays my gears accurately even at high RPMs.

Current code for those interested- http://pastebin.com/iGiK8iQy

#### Runaway Pancake

#51
##### May 04, 2013, 01:56 pm
Glory!
"You gotta fight - for your right - to party!"
"Who is like unto the beast? who is able to make war with him?"
It's "bipolar transistor" or "junction transistor" - "BJT" is stupid.
When all else fails, check your wiring!

#### Robin2

#52
##### May 04, 2013, 07:41 pm
Makes you wonder why they are not standard equipment.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

#### lockinamp

#53
##### May 10, 2013, 06:09 pm
"why not standard equipment"
patent it and sell to bike mfr.
Seriously, patentability is a squirrely thing.
message me for that strategy. You can get "pat pending" for \$100. Move it onto a chip and approach a mfr
with a "black box." Hide the code in chip memory.

BTW, if you ride that thing - I hate to pee in the punch-bowl, but if you get in a serious accident, you can adapt the gizmo
to a wheel chair shifter.

Nice work though, all you had to do was tolerate some abuse.

AND - here is a plain english explanation of why an led needs a resistor.
An led has something called a "band-gap." It is like a dam holding water back. If you raise the water too far, (over voltage)
it will torrent over the dam and cause a tidal wave. A resistor limits the current flow, like a constriction in a pipe when you have the faucet all the way on.

An attempt...I'm sure will provoke laughs.

Go Up

Please enter a valid email to subscribe