nuclearcat
Done! Spent around 8 hours for it... (mostly code debug and searching for proper crystal)
ATTiny85 (45 will work fine too), pile of resistors and capacitors, voltage regulator, 1Mhz oscillator, two 22pf capacitors, TTL to RS232 converter.
This device can be connected to any battery (for example dumb UPS sold in supermarket), and will read voltage on this battery and send over serial. It can do much more, but my main priority this job. Due extreme bad performance of EDL (Hello Gebran Bassil again, and his promise about 24/24 electricity) - we have a lot of issues with power...
rolf
That's efficient and cheap, I guess. I suck at hardware myself, I never tried.
J4D
Good job ! Im guessing you used the MAX232 chip ? some pics of the setup would be good :)
nuclearcat
No, i had already some converter :-) It is some strange chip...
Sure later i will use MAX232 in final design.
Board is ugly, since it was used just to see if i will get proper ADC values.
Uploaded with
ImageShack.us
Uploaded with
ImageShack.us
J4D
Each picture is ~9MB ! timing out way soon :P
nuclearcat
ooops... imageshack seems doesn't resize as i was expecting :-)
Who cares :-)
Since AVR Studio is for windblows - i didnt had gimp under hand.
J4D
No worries :) Have not seen the pics yet , but i think you have some sort of voltage divider feeding an A/D ?
btw, the attiny has an internal oscillator that you could have made use off! ;)
nuclearcat
jadberro -
I can make picture less, but it is not very readable how it is made, since i just solder many wires, instead of making "traces". PCB i use already was used before, so i cannot place all how i want.
internal oscillator have precision %10, while RS232 needs not more than %3. I prefer to run oscillator on test design to avoid problems caused by this.
My voltage divider is ugly, for now it is just resistor voltage divider and it is actually bad for battery (even it consume few mA), but sadly i didnt had anything else under hand. Additional ugly thing - linear voltage regulator, but it is over resistor, so it wont consume too much too.
For future i can improve it by zener diode (to prevent battery deep discharge), or even to make some circuit with FET. Just for my needs zener diode for proper voltage will be enough. Maybe later i will order specialized IC.
J4D
use two resistors for voltage dividing in this accordance :
saying your battary is 12 V and you want to input 5 volts to the MCU when battery is at full charge
R1 100 ohm
Vin ------*****------.--------------- Vout
|
|
*
* R2 70 ohm
*
|
|
------ ground
----
--
The small 1/4 watt resistors in this application should not consume a lot of power, besides you can get rid of the regulator by drawing power directly from the Router's board :)
nuclearcat
I do already like that.
I prefer to not take power from router for now, since schematics will be used in other applications too.
For example we can make together some project "Make you dumb UPS - smarter".
By AVR we can make even cheapy UPS from supermarket perform almost same level of managed UPS and even gather some advanced statistics.
Maybe if i can find PCB manufacturer who can solder SMD things - it can have sales in Lebanon, with lebanese electricity issues :-)
J4D
if you want i can easily design and etch a prototype PCB for that, Normal parts at first. Then it can be sent to katranji, they have pick and place machines in their place in Syria .
nuclearcat
We need to see if there is real use for this stuff :-)
For VISP i will have to produce 5-20 units at least...
By diodes + shunt + opamp i think it will be possible to monitor current (and direction) also, but it will complicate schematics a bit, but with this info it is possible to estimate battery runtime, battery status (how much capacity lost and etc).
J4D
Anything can be done, 5-20 units can be done in a matter of 5 hours without a pcb manufacturer ;)
nuclearcat
Check PM please :-)