View Single Post
Old 06-16-2013, 04:20 AM   #62 (permalink)
Occasionally6
Master EcoModder
 
Join Date: Apr 2013
Location: World
Posts: 385
Thanks: 82
Thanked 82 Times in 67 Posts
Quote:
Originally Posted by jeff88 View Post
So, of that list, I won't have any problems (at least for this project)? Some DMMs I have found say 20M ohms, is that going to cause a problem? You mentioned with the voltage divider, having more than 10M ohms could cause an issue with the circuit being too resistive. Would this be the same problem with a 20M ohm DMM?
Part of the reason I don't want to say one is "good" or not is that I would have to wade through the DMM specs. to form an opinion. That takes too long for me to want to do it.

As long as it is greater than 10M Ohms (which is a recommended/required DMM spec. for automotive/electronics use I have seen enough times to be confident of it being a useful guideline) it's OK. It will be described somewhere as "impedance". Often with cheaper meters it is 1M.

My understanding is that it is due to the way in which DMMs measure voltage i.e by placing a resistance - a shunt - in parallel with the circuit being measured and measuring the current through the shunt to determine the voltage.

At the extreme, with very low resistance, the shunt would be a short around the load that the voltage drop you are trying to measure is occurring across. That alters the voltage dropped through the load and increases the current flowing through the rest of the circuit, to at least some degree. The higher the shunt resistance (impedance) the less like a short the shunt is.

Quote:
See attachment. I think if you open it in a new window, it might be a little easier to see. Let me know if any of it is wrong. It assumes a Mega2560 board (more about that later, see below )
Without checking the currents that circuit looks OK to me.

Quote:
I am going back and forth between the Mega and Uno. I am trying to figure out if all of my future projects will take up all the pins of the Uno, thus necessitating the Mega. The other reason why I would want the Mega is processing power/memory, being that it has more of it. I am also worried about having too much total current, thus possibly necessitating 2 or 3 Uno boards. This page says the Mega can handle 800mA, but I'm not so sure about that. Total Current (The Uno is on top, the Mega is at the bottom). It's possible I am just misreading it, but it seems to be able to handle more amps. If the total amps is indeed 800mA, then I might go with the Mega, just for the reason of not overpowering the board.
Have you tried playing with a few sketches in the Arduino IDE? That will give you some idea of the size of the sketch. (It's displayed at the bottom of the IDE window after compiling.)

There is some scope to reduce the size of the sketch with sensible programming, for example, by not doing things like declaring float variables(which take up a lot of memory) globally and by reusing the same variable for intermediate calcs., unlike in the really rough sketch I posted previously.

The current limit will be the lowest of individual pin, total or component current limits so maybe you will have a better idea if you look at what you have already. If you use 10mA as an acceptable supply limit for each Arduino pin there will be a possible 80mA on the 7-segment display (all 7 + dp lit); 20mA per is 160mA.

If you use the 4511 to switch the 7-segment, in addition to using 4 vs 8 Arduino pins, the current for the 7-segment is supplied by the 4511 (although still through the 5V regulator on the Arduino board - unless you connected it to an external 5V supply).

I guess if there's any doubt then the Mega leaves more margin for not very much more money.

Quote:
I have a cigarette lighter USB adapter. If I power the Arduino through that, will that be good enough to supply power without over-supplying it? (i.e. 7-12V and <200mA). That would certainly be a lot easier than any other option.
That is probably what I will do also, possibly gutted, possibly simply plugged into a new cigarette lighter socket wired in parallel with the OEM one.

Quote:
Would a junk relay work with the Arduino? Would a typical car relay be able to be switched from an Arduino without overpowering an I/O pin (i.e. 40mA to make the connection switch)? I was thinking something like this, if need be:Arduino Relay
I haven't measured the current through an automotive style relay for some time but I think it's around 100-150mA, so switching it directly with the Arduino won't work.

It can be switched using a transistor (plus a diode - like a 1N004 - across the relay coil, to prevent a voltage spike into the Arduino as the relay coil current stops) in the same way as the 7-segment cathodes. That might be useful for a grille block actuator.

What I had in mind for the Arduino power though is to switch the relay from an ignition switched source and use new wiring through the relay from the battery and to ground to provide power to the Arduino. I don't think it will be necessary to do that though as the USB power from the cigarette lighter socket wiring is easier.
_____________________________________
Quote:
Are voltage drop and forward voltage the same thing? I can't seem to find the answer anywhere.
Forward voltage is the voltage difference across a semi-conductor component (so diode, LED or transistor - all basically forms of diodes) required for it to conduct. It is also a voltage drop, which more generally also refers to the voltage difference across a resistance or other load.

If you connect an LED* to an AA battery (nominally 1.5V for an alkaline dry cell, a little lower, more like 1.3-1.4V for a Ni based rechargeable) it won't light.

*Any of them for this but LED's of various types, particularly colors, vary in their required Vf. A red LED might have a Vf of 1.7V; a blue LED a Vf of 3.0V.

It requires a voltage higher than Vf, like two or more of the AA cells connected in series, to get sufficient voltage for it to conduct and light (and maybe some resistance to limit the current due to any residual difference between supply and Vf voltages).

Quote:
On the voltage divider, I'm thinking I might use a 10M resistor and a 5M resistor, that way if the ECM is supplying 14V, it will be less than 5V (so I don't destroy the Arduino) and if it is supplying 11V, it will be more than 3.3V (which will mean it has enough voltage to read properly).
Sounds good. There's no reason to push the limits, either high or low, of the voltage input.

Quote:
This page helped me with the transistors and associated resistors. Transistor Diagram He mentioned using a 4.7k resistor, but I am still a little confused about how I figure out what I would need for my application.
Hfe is the ratio of current through B-E vs that through C-E. It varies with the current and temperature and is actually a range. You need to calculate the current that the transistor is controlling, find the Hfe for the transistor at that current and use Hfe to determine the current into the base (B-E) that is sufficient to fully switch on the transistor.

If you find the data sheet for the BC337 you should find a plot of Hfe vs current (and the range is often quoted numerically). For the BC337 I have it as 100-630 and I've measured it (DMM test) as ~400.

As long as the current flow through B-E is greater than 1/100 (or down to as little as 1/630 if you were to be precise and use the plot to find the Hfe at the desired current flow) of that through C-E, the transistor will be fully switched on.

A lower current through B-E than that will limit the current flow through C-E, to less than that which is desired, maintaining the Hfe ratio to that determined by the transistor characteristics. You don't really need to know Hfe exactly unless you are operating close to the limits.

You will be switching up to 8 x LED's so the maximum current C-E will be higher than the 20mA he is using for one LED. That means you might want a lower resistance than 4.7k on the current into 'B' i.e. through B-E, to maintain the 100 ratio.

If you use 20mA per segment, 8 x 20 = 160mA. Dividing that by an Hfe of 100 gives 1.6mA minimum required into 'B'. Note that while the maximum current limit for the BC337 is 800mA, the continuous current limit is 100mA. Since you're going to be switching the transistors on and off for half the time 160mA is OK.

With a 5V supply on the switching pin, minus 0.7V (the Vf for that part of the transistor) the current limiting resistor needs to drop 4.3V and limit the current to no less than 1.6mA (but no more than 20mA - without checking again, I think that is the limit for the Arduino to supply per pin; that guy does state 40mA though. I think it will sink that amount of current).

Keep the current into 'B' low so that the heat to be dissipated in the transistor (across the 0.7V drop) is low. I have the spec. as max. 625mW total i.e. including the load current through a ~0.3V voltage drop C-E.

Maybe @ 2.16mA with 2k? That might be a bit low (too close to 1.6mA). Because the transistor will have a duty cycle of 50% you could use a higher current. I think 1.5k (2.87mA) would be OK.

If the current into 'B' is a bit too low, you might get an '8' being displayed as dimmer than say a '1'.

It's sensible to bench test it before soldering anything. A bread board is easiest to do that on but, if you are careful not to short anything, I can't see any reason not to improvise and use the veroboard or prototype shield as a temporary platform, making the links using twist and tape, to test the 7-segment part before connecting it to the Arduino.

Masking tape is cheaper than electrical tape and OK for this. Wipe any glue residue off the component leads with isopropyl alcohol before soldering.

Quote:
Alas, I stop here feeling like I have forgotten something...
The circuit is pretty simple. The fun starts in the sketch.
  Reply With Quote