Reason #13 Why I Like the PicAxe

erco

Senior Member
The fact that the PicAxe operates over a wide voltage range means that its a perfect candidate to be powered by a single Li-Ion cell, which ranges from over 4V to down in the threes. No voltage regulator is required, that much simpler to build a circuit. VRs can be a waste of power and real estate on a PCB. Li-Ions are cheap and last a long time between recharges.

One more reason on my long list.
 

manuka

Senior Member
Agreed ! But perhaps more so with the LiFePO4 variant, as they hold a very steady 3.2V almost until exhausted, and are a LOT more tolerant to abuse & overcharging/discharging.
 

manuka

Senior Member
There are diverse on line outfits, but I've been using Hong Kong firm Fasttech => http://www.fasttech.com/ & paying by PayPal. Their costs are low (~ US$3 for an AA LFP, US$7 for a USB charger),with delivery prompt & packaging very rugged. They amazing also include free worldwide postage with all orders.
 

erco

Senior Member
I just ordered 4 of those "1600 mAh" cells to test. Sellers are free to claim any number they like to get sales, whether the batteries deliver or not. Will advise my findings after I receive and test the cells.
 

manuka

Senior Member
Bravo-thanks for this! FWIW my humble experiences with Li-ion 14500 AAs (& confirmed by Fast Tech's offerings) indicate they're typically only good for ~half that 1600mAh claim,even under modest loads. Although battery makers are continually pushing boundaries,it's tempting to ponder marketing hype, or even a "6"/"0" typo ....
 

erco

Senior Member
My latest PicAxe project uses a 20M2 to drive 8 servos. I used two seperate 14500 Li-Ions (both quite visible in the video), one powers the 20M2 and the other drives eight 9-gram servos quite nicely. A bit of voltage fluctuation (~4V down to ~3.5V) on either doesn't cause any problems at all. In fact, I like the lower voltage driving the servos to slow them down. I don't use any ramping here, they are just slamming from one position to the next at whatever speed they can muster at the reduced voltage.

http://www.youtube.com/watch?v=HGWiJcu0WlA

 

Puuhaaja

Senior Member
Cool project erco :) Good voltage range, cheap, easy to program and good forum. There's my reasons to use Picaxe.
 

AllyCat

Senior Member
Hi,

Perhaps we should hold a competition to predict what they will actually deliver? Assuming of course that they arrive and work at all (and don't set fire to your house). ;)

My guess is 570 mAh, but I'm probably being over-optimistic. I see that the seller is offering "1200 mAh" and "2000 mAh" cells at quite a similar price, which seems "suspicious". In such cases I often look straight at the seller's neutral and negative feedback, but it's usually difficult to find much relevant information if there are hundreds or thousands of different items on sale. However, in this case I quickly found the following "Neutral":

"Jul-16-13 poor quality item. Amp hour wrong
2 x 3.7V 2000mAh 14500 ICR14500 AA Li-ion Lithium Rechargeable Battery Green PRI (#160792807946)"


Good Luck,

Alan.

PS: One of the "well known" brands is "Ultra Fire" but has anybody else noticed that there are also "brands" called "Uitra Flre" (note the exchange of "I" and "L") or "Uitra Flrc". So they're not "fakes" (at least if the ebay photo/listing shows them as such).
 

manuka

Senior Member
Aside from such naming mischief, there's also a general end user agreement that Li-ion batteries with "fire" in the branding should be treated with care!
 

Dippy

Moderator
I'm confused (easily).

What's the difference between that Ebay item and, for example :-
http://www.greatpower.net/Product/product_images/t/cn_t__542.pdf
and
http://www.amazon.com/2Pcs-1200MAH-14500-Lithium-Battery/dp/B009FU211M/ref=pd_sim_p_1

There seem to be a number of identically numbered batteries with a variety of specifications.
Is this another cheap'miracle' which is too much hassle to send back?
And the other Ch shop-window Alibaba is full of similar things typically rated 750-850mAh.

I saw a review (private) that said this about an other variety of China's-finest
" I can safely say they last about 1/2 the amount time of a similar Tenergy 14500".

I wouldn't touch them with a barge-pole or , more appropriately, a chopstick!
A) I don't believe the spec. and B) Lithium is nasty and I want a good (tested) manufacturer and I don't mind if it costs a quid more.

It's all so confusing but I'm not going to take the mick out of Boeing :(
 

manuka

Senior Member
You must have lead a sheltered life Dippy old mate (tease!)- the marketing world is infused with embellishment & sadly often ignores end user reality... Similar examples are claimed vehicle fuel economies, assurance of instantly high incomes after years of academic toil, the pleasures of smoking & of course the trivial TCO (total cost of ownership) of recreational boats/yachts ("a yacht is a hole in the water surrounded by fibreglass into which money is poured") - or raising a family!

I'm eager for Li-ion updating, but my assorted experiences & posts regarding their capacity confirm that GreatPower pdf . For those who've just come in -

Under modest loads of ~0.2C (~200mA) AA sized 14500 Li-ion cells typically have Ah capacities of ~800 mAh as they drain from 3.7- 2.7V. The LiFePO4 variant (which is also inherently safer & longer lived than Li-ion/Li-poly) delivers a lower 600 mAh, but at a steady 3.2V (only falling to 2.5V in the last 5%).
 

erco

Senior Member
Can you feel the passion here?

No one except the seller claims they're 2 AH cells. I sure don't expect them to be. I'm not insisting that anyone must buy them nor use them carelessly in mission-critical apps. But if they're any consistent improvement in capacity over other cheap cells out there, it's noteworthy for budget-conscious folks. Anyone who insists on using premium cells only, move along. Nothing to see here. :)
 

manuka

Senior Member
Erco:Some weeks later. I'm about to order further LiFePO4 AAs (14500), & this jogged my memory re your 14500 Li-ion cells. How did they shape up ? Let us know please. Stan
 

erco

Senior Member
@manuka: Save your money! After testing these cells down to ~3.3V, I'm only getting ~400 mAH out of them. That's extremely poor. I was prepared for half capacity, but not 20% capacity. Both cells (the pink 1600 mAH and the green 2000 mAH) are about the same. I was only pulling ~300 mA on my test, a DC motor running at no load.

I'm also using a cheap Ebay China charger. Better chargers would likely yield better capacity results, but nothing close to the seller's claims. Good thing I tested them before leaving feedback... :)
 

manuka

Senior Member
Ok- much as feared! However suggest you cycle them a few times, as Li-ions often need "conditioning" before delivering properly. You can take them somewhat lower (~2.7V limit) than 3.3V of course too.

Do you have any decent monitoring gear? The ~US$24 Turnigy Watt/Ah meter is great value.
 

erco

Senior Member
No monitoring gear, I did it "old school" watching current & voltmeters and logging values every 3-5 minutes. Toward the end, the voltage was dropping off very rapidly after it got down below 3.3V, so going down to 2.7 wouldn't have added very much at all.

Yes, this was their very first cycle, so the numbers might improve. I might just have to get that Turnigy meter you recommend.
 

premelec

Senior Member
@erco - surely you can make a milliamp hour meter with a PICAXE and an LCD and a few resistors - and even a relay to turn off the discharge... :) [and run the PICAXE from the discharging battery as part of the load - though my LCDs seem to like higher voltages than discharged LiFePos].
 

AllyCat

Senior Member
My guess is 570 mAh, but I'm probably being over-optimistic.
Hi,

So I was being optimistic. ;)

However, whilst idly browsing the DealeXtreme site, I was impressed by the (relative) honesty in their battery descriptions. Ratings with a more "dubious" accuracy are put in quotation marks, with an "Actual Capacity" in the description. So the "1600mAh" cells are qualified as "Actual 900mAh", although unfortunately the one customer review says:

"Very low capacity. I was hoping for more than 700mah. I get 535 mah doing a discharge from 4.2v to 2.7v at a low 0.1amp rate. Not protected. I destroyed my first battery by running it too flat assuming the capacity would be higher."

@manuka: That's an interesting battery tester, particularly with their "local" warehouses and reasonable shipping charges, but I suspect that the resolution (particularly "0.1 watt") might be rather marginal for testing AA / 14500 cells at moderate loads. My first PICaxe project (which maybe I'll "finish" one day) was a simple AA battery tester that has proved very useful, not just as a tester but a general testbed for evaluating the occasional PICaxe "oddity" (currently it's readinternaltemp) :

The 20M2 (my preferred workhorse) is assembled on a piece of Veroboard (stripboard) mounted on the back of a double-AA (side-by-side) battery holder. The lower cell is the "Device-Under-Test" and the upper (optional) boosts the supply voltage (when testing lower voltage cells) enough to run the PICaxe and PWM drive to the loading transistor. Works with Carbon Zinc, Alkaline, Nickel Iron, LiFePO4 and Lithium Ion/Polymer.

It simply discharges the cell at a constant current (usually 100mA) and logs the voltage into internal or external (IIC) EEPROM every few minutes. Then, when the termination voltage is reached, it removes the load and spews out the calculated mAh and V/T data each minute via the serial port. No LCD/OLED or a real "User Interface"; I just update the test parameters in the Program (since it was probably last loaded with some test software to investigate one of those "oddities"). Eventually, I'll document it all, but my "Mk.2" will probably accommodate 3 cells and have compatible connections for 08, 14 and 20M2 devices, etc..

But back to the Original Topic. I've also become a fan of LiFePO4s, it's just a pity that they're not generally available "locally". However, some lower capacity versions can occasionally be found as a spare part for "Solar Garden Lights" (even at Maplin's).

Cheers, Alan.
 
Last edited:

manuka

Senior Member
Allycat: Thanks for your tester insights,which looks good enough to more widely promote! I assume the termination voltage can be adjusted for the cell type?

Although much favoured by Li-Po model plane users (when arc welder level currents may be handled), those Turnigy meters have great resolution -I recall they'll even show to 1mAh (good enough for button cells!).

So you too fancy LiFePO4 cells? Local prices for these here in NZ are ~x3 that of imports from Hong Kong, and outlets are elusive. The same situation probably exists in Britain. Hence why not just order some directly yourself !? As I said back at post #4 -
I've been using Hong Kong firm Fasttech => http://www.fasttech.com/ & paying by PayPal. Their costs are low (~ US$3 for an AA LFP, US$7 for a USB charger),with delivery prompt & packaging very rugged.
I've never had any customs hassles (although NZ & China have a free trade agreement). Get their small SoShine SC-F3 USB smart charger too - it's a real sweetie! Note- it has an initial delay (of ~30 seconds) while it seemingly analyses the cell. Also order some placeholder dummy cells (but -ah- don't try recharging THOSE!)

Check here for a comprehensive review of the charger (by a switched on lighting lady no less). Stan.
 

AllyCat

Senior Member
I assume the termination voltage can be adjusted for the cell type?
Hi Stan,

Yes, in the original software I simply arranged the load to cut off when the voltage had fallen to 75% of the initial (fully-charged) voltage. However, that range wasn't really enough for testing Zinc Carbon or Alkaline cells fully, so now I often just hard code the parameters for the appropriate test/cells into the Program (one of the advantages of a PICaxe system). But that's one of the (many) "bodges", which is why I'm not posting any code yet. ;)

Not intended for constructional (or analysis) purposes, but attached is a photo to give a feel for the simplicity of the design. A 20M2 and (optional) EEPROM are plugged into a "narrow" (0.3") 28-pin DIL socket (but 2 x 14 pins would do fine). The emitter of a BC337 goes via 6 ohms (2 x 12 ohms) to ground and the collector to the positive of the cell under test, with each of these terminals also going to PICaxe A-D input pins.

The base is driven from a low-pass filter (1k2 + 10uF, if I recall correctly) from a PWM pin and the LED is fed via a resistor by a fourth pin. It could all be done with an 08M2, driving the (optional) LED by an NPN with its base tied directly to the "input only" pin (activated by the internal Weak Pullup resistor) if required. The LED just flashes (toggles) to indicate that the cell under test is still alive (and that the program hasn't crashed :) ).

The program loop just repeatedly reads the A-D pins (to give V and I), using CALIBADC to measure the "++" PICAxe supply rail (A-D reference voltage). It increments the PWM value if the load current is less than the target (typically 100 mA) and decrements it if too high. The loop also monitors the TIME variable for the logging interval and only needs to accumulate the elapsed time because the current is constant (but a resistive load could easily be emulated and the power integrated, if preferred). Perhaps I should add that my load current is quite low because my main interest was in testing cells for use in 24/7 applications. In particular, to find at what (low) current it might be more economical to use Zinc Carbon in preference to Alkaline cells (but my experiments suggest that no such threshold exists !).

Yes, I have purchased some LiFePO4s and placeholders from HK via ebay, but certainly I'll try fasttech next time (particularly for that charger). However, "officially" ALL lithium cells (not installed in a complete product) are now banned from our Royal Mail - yes even a single CR2032 for a RTC ! However, not only are locally-sourced cells considerably more expensive, but I haven't seen any AAs higher than about 400 mAh.

Cheers, Alan.
 

Attachments

manuka

Senior Member
Bravo- this has real mileage as a project, especially given the surging swag of inflated capacity claim cells. How about showing us at least the schematic & a sample data gathered screen?!
 

AllyCat

Senior Member
Hi Manuka,

Sorry for this late reply, I didn't ignore your request but thought that the program structure (to achieve adequate accuracy with PICaxe maths and an "unregulated" suppy) was sufficiently "challenging" (at least it was for me) that I should include some example program code. At one stage I was using my double-word (32 bit) division routine (in code snippets) but now I just use a single "optimised" division with careful choice of multiplication scaling factors. Eventually I'll try to post it all as a "Finished Project" but here's a preview for now.

In the event, I ended up by modifying my hardware a little and rewrote virtually all of the software (several times). The LED current now flows through the current-sense resistor (as of course it should) not directly to earth, but this can make the LED a little dim. Also, I've added a "mode" switch (just two pins which double-up as test points for "Leg 4" and "current sense") to allow previously logged data to be recovered easily (when bridged). The hardware and software support 08, 14 and 20 pin M2 devices (always using Legs 1 - 7 plus GND and SO), but I haven't actually tested it with a 14M2 (probably the most suitable device for the application). With a 14M2 (or 20M2) the whole of Port B is available for other purposes (e.g. driving a LCD).

The design includes an optional LED driven by the "Input Only" pin, but even the 08M2 can drive a LED directly (from the Serial Out pin) with only occasional corrupt characters displayed on the terminal/monitor. Data is logged to internal EEPROM (larger than the available RAM on an 08M2), which has the advantage that the data is not lost if a battery happens to fall out (or go flat) before the log is downloaded. But generally, once the main load is removed, the cell under test recovers sufficiently that the tester (now mainly in sleep mode) can continue to transmit the logged data for many days.

The "Pebble" stripboard layout (not quite what I actually constructed) is basically intended for a 14M2, but includes links showing its use with an 08M2. It was easier to show separate lnks in Pebble, but in practice single links can run from the "port B interface" connector directly to the unused PICaxe legs 5 - 7 of the 14 pin device socket. The layout can easily be extended to a 20M2 (and an optional 8-pin IIC EEPROM if required) and still kept no larger than 2 x AA cells by using a few "layout tricks" (such as cutting tracks between holes, running supply/ground tracks under the ics and linking adjacent tracks on the underside of the board, etc.) but I haven't shown / used these for clarity. The AA cell shown upside-down is the Test Cell and the other is the Boost (or sometimes just a Placeholder) cell.

In principle, the design might be "improved" with a regulated power supply, LCD and a proper "User Interface", but my aim was for a really "cheap and cheerful" flexible design which can just "sit on the shelf" for a few days draining a battery and then report the results to a PC for import into Excel (other speadsheets are available). Also, it certainly wasn't intended for high drain testing, typically 100mA with a range of perhaps 10 - 200 mA.

The system should give satisfactory results with any overall supply (Vcc) from just over 2 volts to almost 6. With a Carbon-Zinc, NiMH, Alkaline or NiZn test cell, the second "boost" cell of a similar type might be sufficient (marginal with an 08M2), but a Lithium cell may be better. However, with a Lithium test cell, the boost must NOT be a Lithium type (too many volts!) and a "placeholder" (short circuit) cell can be sufficient.

Forum space doesn't allow me to include an abbreviated code listing here, so I'm afraid you'll have to wade through the full attached file. That includes an option to log the load current (or not). An advantage of the constant-current approach is that it's not necessary to consume memory by continuously logging the current. But there is a risk that the hardware may give insufficient drive to maintain the required current, even at PWM = 100%. The "live reporting" indicates this, if monitored, but the final log may not. However, the Energy (mW.hours) which is accumulated throughout the log may give a clue (by being inconsistent with the reported mA.hours and volts).

Here's a sample output report / log (for a single LiFePO4 with a placeholder upper cell) from just before the test finsihed. It was one of my cheap "no name" LiFePO4s from ebay/HK marked 600 mAh, so quite a respectable result. Perhaps I should add that my reporting of the voltages to the nearest millivolt resolution is intentional - to show the actual resolution being achieved (as well as being convenient). I think the present limiting factor may be CALIBADC using the 1 volt FVR; sometime I might try writing directly to the SFRs to use the 2 volt FVR. But perhaps the ultimate solution is to introduce some dither / noise into the A/D converter and accumulate multiple A/D conversions to give higher resolution.

Code:
6:9:0 BattmV= 2938,Vcc= 2941,I= 100 mA,PWM= 568
6:9:30 BattmV= 2921,Vcc= 2924,I= 101 mA,PWM= 575
*Log*
6:10:0 BattmV= 2921,Vcc= 2924,I= 100 mA,PWM= 575
6:10:30 BattmV= 2904,Vcc= 2907,I= 100 mA,PWM= 577
6:11:0 BattmV= 2887,Vcc= 2890,I= 100 mA,PWM= 579
6:11:30 BattmV= 2870,Vcc= 2873,I= 100 mA,PWM= 582
6:12:0 BattmV= 2853,Vcc= 2856,I= 100 mA,PWM= 587
6:12:30 BattmV= 2836,Vcc= 2839,I= 100 mA,PWM= 592
6:13:0 BattmV= 2819,Vcc= 2822,I= 99 mA,PWM= 593
6:13:30 BattmV= 2819,Vcc= 2822,I= 100 mA,PWM= 596
6:14:0 BattmV= 2802,Vcc= 2805,I= 100 mA,PWM= 600

6:14:4 BattmV= 2802,Vcc= 2805,I= 58 mA,PWM= 0
6hrs 14mins at 100mA = 620 mAhr,1987 mWhr,5 mins Log
Mins: mV
0  3345
5  3294
10  3294
15  3294
20  3294
25  3294
30  3294
35  3294
40  3294
45  3294
50  3294
55  3294
60  3294
65  3294
70  3294
75  3294
80  3294
85  3294
90  3277
95  3294
100  3277
105  3277
110  3277
115  3277
120  3260
125  3260
130  3260
135  3260
140  3260
145  3260
150  3260
155  3260
160  3260
165  3260
170  3260
175  3260
180  3243
185  3243
190  3243
195  3243
200  3243
205  3243
210  3243
215  3243
220  3243
225  3243
230  3243
235  3243
240  3243
245  3243
250  3226
255  3226
260  3226
265  3226
270  3226
275  3209
280  3209
285  3209
290  3209
295  3192
300  3192
305  3192
310  3192
315  3175
320  3175
325  3158
330  3141
335  3124
340  3124
345  3124
350  3107
355  3090
360  3073
365  3006
370  2921

6:14:4 BattmV= 2972,Vcc= 2975,I= 1 mA,PWM= 0
6hrs 14mins at 100mA = 620 mAhr,1987 mWhr,5 mins Log
Mins: mV
0  3345
Cheers, Alan.
 

Attachments

Cillakin

Member
I wonder if Boeing bought a bunch cheap :confused:
Anyone remember when the 747 debuted with boatloads of problems as well? Or the 777? It's just the circle of life with those planes...

For my projects I use Energizer rechargeable batteries. They work perfectly fine and deliver more volts than advertised. Is there a reason why Lithium-Ion batteries are used as opposed to NiMH?
 

erco

Senior Member
Cheaper, lighter, higher voltage & energy density... of course there is that fire risk with Li-Ion.
 

erco

Senior Member
@Allycat: Your battery tester project is absolutely fabulous, and your comments are certainly welcome here. Having said that, it really deserves its own thread. It's certainly of widespread general interest, and it would a shame if someone missed it because it got buried on page 3 of this obscure thread!

It would also be worthy of submitting as a PicAxe project, as long as you don't mind winning the monthly prize. :)
 

premelec

Senior Member
@Allycat - I'd appreciate a schematic - trying to see what the strip board is doing makes my head hurt! I would think you'd discharge through a MOSFET but don't see one off hand - anyhow good useful project for sure!
 

AllyCat

Senior Member
Is there a reason why Lithium-Ion batteries are used as opposed to NiMH?
Hi all,

@Cillakin: Reasons as above, and also Lithium Ion batteries are readily available in "flat" packages. The modern Mobile/Cell phone would be a rather different beast if it had to incorporate 3 x AA cells (or an iPad about 15 x AAs). Furthemore, charging (or even discharging) cells connected in series can have "issues". Good quality NiMH chargers monitor and charge the cells individually, not so easy inside a USB-charged device. A single Lithium cell directly provides the "right" voltage for many applications.

@erco: Thanks for your kind words; I'm not sure if a "Professional" would be allowed to enter the competition (even if I did cease to "earn my crust" in the electronics industry about 10 years ago). Certainly I hope to post the design in the "Completed Projects" section when I think it is "completed", but there are still a few more ideas to try. However, phrases concerning "Gilding Lilies" and "Silk Purses from Pig's Ears" come to mind. ;)

@premelec: The reason that I didn't use a FET (in addition to being "old school", and not having one in my "spares box") is that one aim was the ability to operate with just a pair of primary cells (Alkaline or even Carbon Zinc <spit>). I don't know of a cheap FET which conducts sufficiently with its gate at 2 volts or less.

@others: Actually there IS a schematic (of sorts) at the foot of the .bas file, but it does need a fixed-width font - and some fonts look better (or less bad) than others (and perhaps poor eyesight helps). ;)

Code:
#rem
SCHEMATIC DIAGRAM (08, 14 & 20 pin compatible)       
                                  
   +-------------------------------*--------------*-----+ 
   |                               |              |     | 
   |     470(opt)     |\|Red(opt)  |         100n===   +++      
   *-----/\/\---------|L>----+     |   _______   ===   ===100u  
   |                  |/|    |     |  | o U   |   |     |
___|___       (opt)          |     +--#1  14/8#===#=====#
               |\|      22k  |        |       |         I  180
  ===    SI O--|S>---*-/\/\--|------->#2  13/7#>-----*--I--/\/\--O SO
   |Boost      |/|   |       |        |       |      |  I  (opt)
   |Cell             |       |        |  08M2 |      |  I
   +-----*-----------|-------|------->@3     6@<---+ |  I
   |     |           |       |        |       |    | |  I
   |     |           /        \|BC548 |       |    | |  I
   |     |           \10k      |-----<#4     5#>-+ | |  I
   |     | BC337     /       |/|(opt) |       |  | | |  I              
___|___   \|     1k  |       |~       !~~~~~~~!  | | |  I
           |--*-/\/\-|-------|-------<#5------!--+ | |  I
  ===    |/|  |      |       |        !       !    | |  I
   |Test |~  +++     |       o|       !  14M2 !    | |  I      
   |Cell |   ===47u  |       o|    +-<#6------!----|-+  I
   |     |    |      |       |     |  !       !    |    I
   |     *----|--*---|-*-----*-----|->@7------!----+    I
   |     |    |  |   | |           |  !       !         I    
   |     /    |  /   | |  470  |/| |  !~~~~~~~!         I   
   |     \10  |  \10 | +-/\/\--<L|-+  @8 20M2 !         I     
   |     /    |  /   |    Green|\|    !       !         I 
   |     |    |  |   |                 ~~~~~~~          I 		
===#=====#====#==#===#==================================#=======O GND
And now to "Sod's Law":

I've been occasionally "revising" the software for this project for more than a year now. However, within 12 hours of finally "publishing" the program code I realised that there was an "oversight" in my analysis of the current flows, which could lead to an under-calculation of the battery capacity by up to (only) a few percent. A "software fix" is easy, but by the time it's been "PICaxe-ised", its function is too obscure to explain in a single "Comment" line. So there's a "Virtual Prize" for anyone who can work out the reason for my code modification below. ;)

Code:
symbol BASER  = 200	  		; Base drive resistor divided by sense resistor (eg 1k / 5 = 200)
symbol PWMCOMP = 4096 / BASER  ;  Pre-calculated compensation multiplier (too obscure to explain here)

testbatt:				; READ THE TEST BATTERY VOLTAGE AND CURRENT
[B]REPLACE:[/B]
	batti = batti * 64 ** vcc / SENSR  		; Current through the sense resistor (mA)
	batti = batti + 1 	 	 			; Add 1mA for the PICaxe drain and rounding (~500uA each)
[B]WITH:[/B]
	batti = batti * 64 ** vcc 	 			; Voltage across current sense resistor
	tmpb = 1023 - pwmdc / 64		 		; PWM low period (0 - 255) then divide by 16
	tmpb = batti + 650 * PWMCOMP ** tmpb  	 	; 650 (mV) = typical transistor VBE
	batti = batti + tmpb / SENSR + 1  			; Add "lost" current and 1 mA for PICaxe drain and rounding
Cheers, Alan.
 

premelec

Senior Member
@AllyCat - there are lots of logic level mosfets less than 2v now and less than $1. If you ever need 'em [see Digikey]. I don't have 'em in my junk box either and am old school and impressed by what is available!
 
Top