SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By ShreddinPB
#139919
rrpilot wrote:
The only thing you can remove is the programming header.
Ok then.. so these parts?
[power]
Decoupling Cap
http://search.digikey.com/us/en/product ... ND/1022454
[reset]
10K resistor
http://search.digikey.com/us/en/product ... ND/1975090
zener diode
http://search.digikey.com/us/en/product ... ND/1532765
I dont see anything about a capacitor for reset circuitry, the schematic I am looking at
http://dangerousprototypes.com/docs/PIC ... uick_start
only mentions a decoupling cap at the power lines, a 10K resistor at reset along with a diode.

I am having trouble figureing these out tho, I assume since they are not needed to run a PIC, just needed for my application of one :(
resistor for current limiting opto-isolator
opto-isolator
pull-up for opto-isolator output
so many variable for opto-isolators so I dont know what to choose.
By rrpilot
#139941
ShreddinPB wrote: [power]
Decoupling Cap
http://search.digikey.com/us/en/product ... ND/1022454
[reset]
10K resistor
http://search.digikey.com/us/en/product ... ND/1975090
zener diode
http://search.digikey.com/us/en/product ... ND/1532765
I dont see anything about a capacitor for reset circuitry, the schematic I am looking at
http://dangerousprototypes.com/docs/PIC ... uick_start
only mentions a decoupling cap at the power lines, a 10K resistor at reset along with a diode.

I am having trouble figureing these out tho, I assume since they are not needed to run a PIC, just needed for my application of one :(
resistor for current limiting opto-isolator
opto-isolator
pull-up for opto-isolator output
so many variable for opto-isolators so I dont know what to choose.
hehe, that capacitor you chose is one of the smallest packages you can buy, I would recommend not going smaller than an 0805 or just grab a through-hole component since that what you're using for the rest of the parts.

I'm not sure if I see any usefulness of the reset circuitry on the webpage you posted. The author claims the diode offers protection for the PIC when the higher voltage is applied but I don't see the benefit so I would omit the diode. Just use another 100n cap to ground on the MCLR pin with the 10k pull-up to Vcc.

Do a little google research on the opto-isolator yourself, its not difficult to get a general sense of what you need to do.
By lyndon
#139946
@OP: Please come back when you've built one of the circuits and let us know which one and how it works.

After thinking it through I really like skimask's idea. It is the most complex one, but it has the lowest cost and probably the simplest assembly. If I have to do large battery management again I'll definitely keep it in mind.
By skimask
#139948
rrpilot wrote:
lyndon wrote:but it has the lowest cost and probably the simplest assembly.
sigh...
Agreed...
After looking at it a bit more, my solution isn't any cheaper or easier. The ONLY advantage to my idea is that you can add more 'toys' later on (beeper outputs, etc).
By lyndon
#139957
Don't get me wrong, I really like your idea. It may be even better if you can find matched pair transistors in a single package (do they still make those?) so you can be sure they track closely as temperature changes.

The BOM cost of what you proposed is pretty low, but the number of parts to be placed and assembled makes it more work for a one off. More important, it's dependent on either purchasing high accuracy resistors or matching them by hand if you need better than 1% accuracy which it sounds like the OP does.
Skimask's suggestion has the combination of good built-in accuracy and resolution, low external parts quantity and cost, easy updates, and it's very modular so it can be replicated essentially indefinitely (that last part I really like). Transistors and resistors are cheap, but an AVR Tiny5 is less than $1 in quantity 1 and it will do everything in one chip. Heck, I like it better than my own ideas :-)

rrpilot wrote:
lyndon wrote:but it has the lowest cost and probably the simplest assembly.
sigh...
By lyndon
#139958
You mean I like your idea more than you do ;-)
skimask wrote:
rrpilot wrote:
lyndon wrote:but it has the lowest cost and probably the simplest assembly.
sigh...
Agreed...
After looking at it a bit more, my solution isn't any cheaper or easier. The ONLY advantage to my idea is that you can add more 'toys' later on (beeper outputs, etc).
By rrpilot
#139970
lyndon wrote:It may be even better if you can find matched pair transistors in a single package (do they still make those?) so you can be sure they track closely as temperature changes.
The BC856BS I proposed is a dual PNP matched pair.
lyndon wrote:The BOM cost of what you proposed is pretty low, but the number of parts to be placed and assembled makes it more work for a one off. More important, it's dependent on either purchasing high accuracy resistors or matching them by hand if you need better than 1% accuracy which it sounds like the OP does.

Skimask's suggestion has the combination of good built-in accuracy and resolution, low external parts quantity and cost, easy updates, and it's very modular so it can be replicated essentially indefinitely (that last part I really like). Transistors and resistors are cheap, but an AVR Tiny5 is less than $1 in quantity 1 and it will do everything in one chip. Heck, I like it better than my own ideas :-)
The analog solution has much fewer parts, I'm not sure I understand your statement. Please elaborate. It's not really fair to say which one has better accuracy and resolution without doing some type of error budget.

This has been a fun thread to be apart of and I'm really glad the OP is considering both options and hopefully he will feed back to us what he really likes.
By lyndon
#139980
OK, I was thinking they were two separate transistors and two resistors. So the solutions are closer than I thought.

The MCU solution requires two components per channel: a microcontroller and some type of isolation. OK, three: MCU, opto and current limit resistor. In either one, the resolution is likely limited by the A/D converter, so I'll assume they're the same. However, the largest contribution to inaccuracy of the transistor solution is probably the resistor tolerances. Having said that, it occurs to me that the absolute accuracy is probably not as important as consistency. In any case, since there is software somewhere in the loop, each channel could be individually calibrated.
User avatar
By languer
#139991
The analog version is pretty cool and truly elegant. And I can't see it being more expensive. The two things you have to watch for are the temperature drift of of the transistors and the matching between each channel. Vbe will drift through temperature, and will also drift from pair to pair. I'm no expert on these batteries, but apparently they require pretty tight tolerance. If that is so then you may have to compensate for it. Either by adding more analog components (usually one more transistor per channel), or digitally after the ADC. A third thing you may have to watch for is ADC variation on each channel since there is no isolation at the input of the ADC (and the output impedance of the current mirror tends to be high). Thus the reason for using OPAMPs for isolating sensors to ADCs (their high input impedance and low output impedance provide good isolation to both the sensor and the ADC). That all being said, the analog version should still be cheaper; though maybe a bit more complicated to understand/troubleshoot (if analog design is not your strength).
By skimask
#140033
lyndon wrote:You mean I like your idea more than you do ;-)
I forget... :D

What we need here is a tie-breaker! :pray:

As far as the drift goes, wouldn't the fact that you're using a "pair" makes the bias drifts cancel each other out (in a perfect world anyways)?
By ShreddinPB
#140396
rrpilot wrote:
ShreddinPB wrote: [power]
Decoupling Cap
http://search.digikey.com/us/en/product ... ND/1022454
[reset]
10K resistor
http://search.digikey.com/us/en/product ... ND/1975090
zener diode
http://search.digikey.com/us/en/product ... ND/1532765
I dont see anything about a capacitor for reset circuitry, the schematic I am looking at
http://dangerousprototypes.com/docs/PIC ... uick_start
only mentions a decoupling cap at the power lines, a 10K resistor at reset along with a diode.

I am having trouble figureing these out tho, I assume since they are not needed to run a PIC, just needed for my application of one :(
resistor for current limiting opto-isolator
opto-isolator
pull-up for opto-isolator output
so many variable for opto-isolators so I dont know what to choose.
hehe, that capacitor you chose is one of the smallest packages you can buy, I would recommend not going smaller than an 0805 or just grab a through-hole component since that what you're using for the rest of the parts.

I'm not sure if I see any usefulness of the reset circuitry on the webpage you posted. The author claims the diode offers protection for the PIC when the higher voltage is applied but I don't see the benefit so I would omit the diode. Just use another 100n cap to ground on the MCLR pin with the 10k pull-up to Vcc.

Do a little google research on the opto-isolator yourself, its not difficult to get a general sense of what you need to do.
Yeah, that cap is too small to work with lol
do you have a part number for a good thru hole alternative? All I could find were smd ones :( im so noob at all this hahaha
By skimask
#140404
Any old .1uf cap ceramic cap will work
Search used @ Digikey
"capacitor .1uf ceramic through hole"

Same for the diode
"zener diode 5.1v through hole do-41"

DO-41 isn't the biggest case out there but it's big enough.

Specify "Through Hole" in the search bar @ Digikey to eliminate the SMD pieces/parts.