Shop OBEX P1 Docs P2 Docs Learn Events
finding how much current the BS2 module draws — Parallax Forums

finding how much current the BS2 module draws

MatthewMatthew Posts: 200
edited 2005-01-31 22:04 in BASIC Stamp
How do I find out how much current my BS2 module draws? I've been looking at the datasheets but don't know the difference between "source" and "sink".

Does the current draw depend on how many I/O pins I use? Does it matter what purpose I'm using the pins for, or will they always draw a certain amount of current if in action?

Thanks,
Matthew

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-30 02:35
    Good questions.

    Current is a flow of charge. The net current flowing in to a node must equal the net current flowing out of a node. Here, the node is your BS2. Your BS2 takes a certain amount of current from Vdd and runs it to Vss in order to do its processing (say 10 mA -- I've never measured it). If it is sourcing (outputting) current to an LED (say another 10 mA) then it is pulling that 20 mA total from the Vdd line.

    "Sourcing" current is when the BS2's output pin is high, and it is driving a device whose other end is to Vss (or Ground). Thus current flows out of the BS2 at +5 volts, through the device, and into the ground.

    "Sinking" current is when the BS2's output pin is LOW, and it is 'sucking' current trough a device whose other end is tied to Vdd (+5). This current flows through the device, into the BS2's pin, and into the BS2's Vss ground.

    So, the more I/O pins you have active, the more current you can draw. Now, each BS2 pin has a limit of about 20 mA before it burns out. And the BS2 as a whole can only sink or source 50 mA, so you can't do that 20 mA on more than 2 pins at a time.
    Yes, it matters what you are using the pins for.

    Ohms Law is stated: V = I x R, which means: The voltage across a device (in volts) will equal the current through the device (in Amps) times the Resistance of the device (in Ohms). The driving force here is Voltage, which is usually +5 volts in BS2 circuits. The variable you have some control over is usually resistance. For a given voltage and given resistance, a resulting current will flow. If that current is too high, things act like a fuse and burn up. "Too high" here is some value above 20 mA.

    Finally, the easiest way to find out how much current your BS2 draws is to put an ammeter in the Vdd line to the BS2 and measure it.
  • MatthewMatthew Posts: 200
    edited 2005-01-30 04:18
    Thanks Allanlane5.

    I plan on hooking up many devices to one 9v battery. I'm sure there's a limit to how much current it can give before no longer being able to power everything. What is this limit called? Is there a way of finding out?
  • NewzedNewzed Posts: 2,503
    edited 2005-01-30 12:47
    A 9 volt battery has a capacity of approximately 635 milliampere hours
    (mah).· That means it will supply 1ma for 635 hours or 635ma for one hour
    or 63.5 ma for 10 hours.· If you are going to run several devices off of one battery you should know how much current each device consumes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • GadgetmanGadgetman Posts: 2,436
    edited 2005-01-30 19:42
    I agree with Allan, use an ammeter to measure, but...

    Be careful about what kind of chips you interface to.
    74LSxxx chips are common, but even the simplest of them can draw more current than your BS2.
    Instead, use 74HC or 74AHC chips as these are based on CMOS and therefore draws very little current.

    Also, note that the 5V regulator on the BS2 can only deliver a limited amount of power to drive other circuits.
    (The BS2 have about 43mA left over to drive external circuits)
  • MatthewMatthew Posts: 200
    edited 2005-01-30 20:20
    Sid,

    If the battery has 635mAh, I'm sure there's a limit to how fast it can discharge, right? It probably can't deliver 1270mA for half an hour, or 38,100mA for one minute. I'm looking to draw about 200mA for all of the various devices.

    Thanks.
  • NewzedNewzed Posts: 2,503
    edited 2005-01-30 21:16
    Matthew, I would go with a different battery pack - 4 AA batteries in series.· This will give you 6 volts with a capacity of 2850mah, over 4 times what the 9 volt batt will deliver.· Radio Shack has holders and it is easy enough to attach a 9 volt battery pigtail for connection to you BOE.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • MatthewMatthew Posts: 200
    edited 2005-01-30 21:45
    Wait, capacity multiples when you place batteries in series? I thought it only multiplied if you placed them in parallel.
  • NewzedNewzed Posts: 2,503
    edited 2005-01-30 21:55
    Negative.· Just think about it for a minute.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • NewzedNewzed Posts: 2,503
    edited 2005-01-30 21:59
    A single AA cell has a capacity of 2850mah, so 4 in series still have a capacity of 2850mah.· If you placed them in parallel you would have
    a capacity of 11400mah, but only at 1.5 volts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-30 22:00
    Matthew,

    The rate of discharge in a battery is not linear. A battery's amp-hour rating is based upon a predefined discharge rate at a predefined temperature. For example, the batteries for your car, rv, boat, etc. are rated at a discharge rate of 20 amps. If you discharge a battery at a lower rate you will realize a larger number of amp-hours than the rated capacity. Conversely, if you discharge at a higher rate you will get fewer amp-hours.

    This affect is defined by Peukert's Exponent. Below is a quote from a pretty clear explanation of it on the web:
    www.caravanandmotorhomebooks.com/articles/peukerts_law.htm said...

    Almost from Plante's invention of lead-acid batteries (in 1860), it has been observed that the true capacity of a battery is related to its rate of discharge (the faster the rate of discharge, the less of its nominal amp/hour capacity that can be delivered. The effect is a result of the battery's internal resistance which, in turn, is dependent on the battery's type and method of construction.

    The phenomenon was extensively studied and quantified by a researcher named Peukert. In 1897, Peukart developed an equation that describes the effect. It is has subsequently been very thoroughly established that Peukart's law is accurate within +/- 0.5%-1.0%.

    Peukart's equation is:

    InT=C

    In this equation:

    ‘n' as an exponent related to battery construction.

    ‘I' is the discharge current (in amps)

    ‘T' is the duration of discharge (in minutes)

    ‘C' is the capacity removed as a result of that discharge.

    If ‘n' were to be 1, then 100 A/h is always 100 A/h regardless of the rate of discharge. In practice batteries don't work like this – ‘n' is always greater than ‘1'.

    Most batteries have an exponent of about 1.2. The lower the exponent, the better the battery is able to supply high currents.

    Where you will find the rated discharge current and Peukert's Exponent for a 'AA' battery I know not. I'll leave that exercise to you. It may well be that it doesn't really matter to you in your application. But if you are trying to forecast battery life, this is part of that equation.

    Jim
  • MatthewMatthew Posts: 200
    edited 2005-01-30 23:15
    Okay, thanks a bunch you guys!
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-31 14:40
    Yes, Power is conserved. Power = Voltage * Current.

    Now if you have a single 1.5 volt AA cell, which has a capacity of 2800 mA-Hours, then that's 1.5 Volts * 2800 mA or 4.2 watts.

    If you have 4 batteries, that's 4 times the power, or 16.8 watts.

    Now, you can have that 16.8 watts at 1.5 volts by putting all batteries in parallel. 16.8 / 1.5 == 11,200 mA-Hours.

    You can put them in series, and get 16.8 watts at 6 volts, 16.8 / 6 == 2800 mA-hours.

    Oh, look, there's our 2800 mA-hours again. Yes, putting them in series DOES add to the 'power', but you get the same current, just at a higher voltage. Power is conserved.

    Now, it is VERY true that the amount of power you get out of a battery depends heavily on the RATE you take that power out. Typical measurement values are 1 mA, 10 mA, 100 mA, etc. The 'Technical' part of the Duracell web-site will show you the curves of current versus time for this. Note that battery capacity is usually measured by the amount of current you get out versus what the output voltage of the battery is.

    Since we have NO idea the power needs of your circuit, the fastest brute-force way to solve this is to assume you really do get the 2800 mA-hours (or whatever), build your circuit, then measure how fast the battery voltage falls in use.

    And the 4-AA cell really is the best energy density, if you're going to be pulling 200 mA. That seems like a lot for a battery powered circuit.
  • robodawggierobodawggie Posts: 1
    edited 2005-01-31 22:04
    ·I ran the Demo Program I2C.BSP and all but one of the 2048 addresses was correctly written to and read from. The one that caused the error occured at location 0000. Found 255 expected 000. Why this address and why does it contain 255?
Sign In or Register to comment.