analog input alters voltage... doesn't read properly

It wouldn't be the first time I've been confused. So clear things up and tell me what are we talking about here?

...R

Grumpy_Mike:
That reffers to power transfer which is not what we are talking about here.

Grumpy_Mike:

In testing everything works 100% so I am not exactly sure why I need to add more components.

Because you are not testing it enough you are just going off functionality, this is not good enough when dealing with hardware.

You have to make sure that you are not stressing the components and that it will continue to work and not fail prematurely.
Read this:-
LEDs
Anything you don't understand I will be happy to explain, anything you disagree with, then take up a new hobby.

really was aiming for super simple lol

Super simple designs are good but they need to be right, repeatable and work under all reasonable circumstances.

I am not disagreeing- I am totally ignorant with most of this stuff.

I don't however feel that this needs to be repeatable- Id just like to get it working for my bike, don't really care if I could mass produce it or not.

But regardless- I'd like it to last- so if resistors are necessary than I wouldn't argue about that.

Two things-
What is meant by "mux'ing"?

Yes the LEDS are blue- I am using this: 7-Segment Display - LED (Blue) - COM-09191 - SparkFun Electronics
-These are running at 3.3v- but am I understanding now that they could pull 3.5 somehow?

pcguru000:
Two things-
What is meant by "mux'ing"?

Yes the LEDS are blue- I am using this: 7-Segment Display - LED (Blue) - COM-09191 - SparkFun Electronics
-These are running at 3.3v- but am I understanding now that they could pull 3.5 somehow?

"Mux'ing", short for multiplexing. If you can have two or more segments on at once, then they aren't mux'ed. If your sketch strobed quickly through them repeatedly, only one possibly on at any time, then they'd be mux'ed.
Anyway, you should have the CA wired to +5. If you use a 100? resistor for each segment they'll pull around 15mA [as (5-3.5) / 100 = 0.015], with 220? resistors they'll pull 6mA [as (5-3.5) / 220 = 0.006]. 100? and 220? are "standard value" resistors.

[I'm sure you get it, but with CA, the LED is [u]on[/u] when its corresponding Arduino pin gets a digitalWrite LOW.]

While several people have correctly said that you need resistors with LEDs nobody seems to have actually explained why.

The reason is simple. An LED needs a certain minimum voltage to get it to pass electricity and emit light (around 3.3v) but once the voltage is above that threshold the LED offers no resistance to the extra electricity and it could easily conduct too much current and burn itself out. The resistor limits the maximum current to a level that is safe for the LED. If you don't have a resistor the LED only survives by chance and will most likely fail when it is most inconvenient.

An LED is completely different from a regular light bulb because the light bulb can't take too much current if the voltage is correct.

...R

While several people have correctly said that you need resistors with LEDs nobody seems to have actually explained why.

Err. beg you pardon but what was that link about:-
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

Robin2:
It wouldn't be the first time I've been confused. So clear things up and tell me what are we talking about here?

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.

I don't however feel that this needs to be repeatable

So you only want it to work with your individual arduino and LEDs now, you do not care if it fails when the components age?

These are running at 3.3v- but am I understanding now that they could pull 3.5 somehow?

No voltage is not pulled, only current is pulled. Voltage is dropped when current flows. If you put a certain current down the LED ( it will say what this current is in the data sheet ) the LED will drop 3.5V across it. Or it takes 3.5V to pass that current. If you only have 3.3V available then you do not have enough voltage to correctly drive your LED. You have no way of controlling the current because you do not have enough voltage to drop across a current limiting resistor. In short you can't do it in a safe way. It might function but that does not mean it works. Are you fine with it working only at a fixed temperature?

So you project needs to be even more complex than just adding a resistor, you need a boost constant current LED driver.

Grumpy_Mike:
So you project needs to be even more complex than just adding a resistor, you need a boost constant current LED driver.

Absurd.

So I am open to suggestions as to how you control the current through an LED that drops 3.8V at operating current when you only have 3.3V available without using a boost converter.

Are you advocating using no current limiting resistor. I thought you knew better than that. Or do you have a smart solution? I am eager to know.

Grumpy_Mike,
pcguru has an Uno (it's there in his big darned PNG), there's 5V available on it - which I noted in my Reply_#37: "Anyway, you should have the CA wired to +5."
He was putting the 7-segment's CA to 3V in the belief, howbeit mistaken, that that would obviate any need for resistors.

And this 100% true- however, I still don't understand why i would need to move them to the 5v+ pin... this would overvolt the led's and damage them.

I understand now that LEDs once "lit" could essentially drag more current than they OR the system is made for... and so we put resistance inline to protect from that possibility.

Since in my situation the 3.3v (or 5v if I'm given a solid reason why) - see below ... line is powering a CA 7-seg. this to me means I could put a resistor in ONLY that + voltage line because this is the source voltage, the others (digital pins) just act as grounds.

Anyhow- I got my 9v regulators today, I just soldered them up but I ran out of daylight to go test this... i'll check it out tomorrow evening and report back- hopefully with better results :slight_smile:

I think i understand why a common resistor doesn't work now too:

http://arduino.cc/forum/index.php/topic,17251.0.html

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 its 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

I spelled all of that out in Reply#37. You're not reading.

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 :confused: 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...

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.

Thanks. I had overlooked the fact that you can feed a small water pipe from a large one.

...R

Grumpy_Mike:
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.

pcguru000:
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.

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- SV650 Arduino Based Gear Indicator - Pastebin.com

Glory!

Makes you wonder why they are not standard equipment.

...R

"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.