Author Topic: Battery indicator from comparator, problems!  (Read 10082 times)

0 Members and 1 Guest are viewing this topic.

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Battery indicator from comparator, problems!
« Reply #25 on: November 25, 2015, 01:56:22 pm »
why not just use an LM3914?
Because of it haven't got custom RGB pallette I might want to use or ... not available for example there in SMD version, where I'd like to order other components?  ;)
http://www.tme.eu/en/details/lm3914n/led-drivers/texas-instruments/lm3914n-1nopb/
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline step_sTopic starter

  • Regular Contributor
  • *
  • Posts: 138
  • Country: dk
Re: Battery indicator from comparator, problems!
« Reply #26 on: November 25, 2015, 10:46:44 pm »
You're making this sound vastly more complex than it needs to be. Remember, we're trying to help, not intimidate.
Ye, the thread is starting to be a bit confusing :P

PIC10F220 + a few lines of C and it's done
Might cost less than your analog solution especially if you factor the cost of assembly of the parts, and it should use less board space too.
This one looks quite promising! Since i'm a complete newbie in this field, i would just like to know if there is any easy way to get started?
What kind of USB interface would i need to program this chip?
Hope you can ease me into this :)
« Last Edit: November 25, 2015, 10:48:33 pm by step_s »
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Battery indicator from comparator, problems!
« Reply #27 on: November 25, 2015, 11:18:27 pm »
You're making this sound vastly more complex than it needs to be.
There is nothing complex to store look up table in MPU flash program memory on AVR ATTiny85:
Code: [Select]
unsigned char rgbtab[256][3] PROGMEM =
{
{0,0,0}, // OFF
{255,0,0}, // Red
{0,255,0}, // Green
{0,0,255}, // Blue
..
// What ever RGb color you like.
..
{255,255,255} // White
}; // RGB table


Then start ADC measurement and mean time find indexed look up table based eg. moving average of read ADC values:

Code: [Select]
R= pgm_read_byte( &rgbtab[idx][0] );
G= pgm_read_byte( &rgbtab[idx][1] );
B= pgm_read_byte( &rgbtab[idx][2] );

Few colors can be hardcoded, but it can be done easy in a way shown above.
One can change this RGB table without recompiling MPu software-just by overwriting byte code and programming with custom RGB table...

This is like "Hello MPU World !!!" simply C code  :popcorn:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf