==================== graph2_todo.txt ==================== To Do:- rename project Plan where to put on the website / wiki List Files List measurements Flow:- TimeSwitch - optional Charger Blub to limit current - optional Battery - 12V Lead Acid Blub load - optional Logger using Arduino and SD card sheild ReadAnalogMinMaxVoltage.ino sketch uploaded to Arduino UNO. DATALOG.TXT logs Vmin, Vmax every second. awk -f graph2.awk DATALOG.TXT > graph2_samples.js graph2.svg includes graph2_samples.js and plots the data. Web Browser opens graph2.svg and view samples ************************************************************ * graph2.svg - plots Logger logs for 12V Lead Acid Battery Test. * * Arduino Sketch ReadAnalogMinMaxVoltage.ino writes DATALOG.TXT * * This needs processing so it can be included by this file. * ************************************************************ My 12V Lead Acid Battery does not hold it's Charge. Using an old battery charger the battery was charged, but it is not holding the charge. Also it did not seem to charge at a hight current, and drop down when charged. Maybe a cell or two are faulty! Use an Arduino and SD Shield to log the Battery voltage. IMPORTANT: DO NOT CONNECT BATTERY to ARDUINO inputs without resistors. The chips latch up! +ve ---[30K]---+--[10k]---- A0 | [10K] Vbat | Arduino + SD card shield + USB battery | -ve -----------+--[10k]----- GND https://www.circuit-diagram.org/editor/ The SD card library has an Logger example, which is a great starter. http://www.arduino.cc/en/Tutorial/ReadAnalogVoltage http://www.dougrice.plus.com/dev/arduino/ReadAnalogMinMaxVoltage/ It is 90% to 99% of what I wanted. Code was added to log Vmin and Vmax The Battery Charger has a lot of ripple. Unsmoothed 50 Hz rectified. This would confuse the log and graphs. * Measure the voltage as fast as possible and capture Vmin and Vmax. * Log Vmin and Vmax to SD card every second. * Log when Arduino is reset, this can be useful to tag the readings. The Arduino can be powered by: a) USB power brick, 2200mAh Poundland power brick b) USB 5V wall wart - seems to over voltage and add ripple to readings c) PSU connected to Barrel jack - not tried yet. Using an old battery charger the battery was charged, but it is not holding the charge. Initally , the Battery would only charge at 1 amp. There are a number of configurations, which could be measured. 1) Self discharge 2) Discharge, using 25W car Bulb and watch the voltages. 4) Charge Battery direct. - 5 amps when battery flat. 5) Charge Battery via 25W car bulb as a ballast to limit charge current when flat. 6) Charge Battery with 25W car bulb in parrallel, use time switch to turn on and off charger. Arduino Example logs Vmin,Vmax to DATALOG.TXT, appending data every second. This page includes graph2.js which contains the data from the logger. Use an awk script to convert DATALOG.TXT to graph2.js # # graph2.awk # usage: awk -f graph2.awk DATALOG.TXT > graph2.js # usage: awk -f graph2.awk DATALOG_20210102.TXT > graph2.js BEGIN{ FS="[,\n,\r]" } /,/ { print "v2('" $1 "," $2 "," $3 "')" } When the Logger is turned on, it logs -1,-1,card initialized. This page includes graph2.js, which contains the the data logged every second. v2("Vmin,Vmax") Load this an plot it. Sampled Data sufferes from Aliasing. You should use a lowpass filter to stop aliasing, My scope has a Vmin and Vmax feature. If you subsample Aliasing can confuse the readings. A way around this is to measure the min and max values seen. If you further sub-sample find the minimum min and maximum max. graph2_samples.js:1: v2('-1,-1,card initialized. Added code to log turn on.') graph2_samples.js:2: v2('-1,-1,card initialized.') graph2_samples.js:3: v2('-1,-1,card initialized. Using resistors to Vcc') graph2_samples.js:4: v2('-1,-1,card initialized.') graph2_samples.js:5: v2('-1,-1,card initialized.') graph2_samples.js:9: v2('-1,-1,card initialized.') graph2_samples.js:10: v2('-1,-1,card initialized.') graph2_samples.js:11: v2('-1,-1,card initialized.') graph2_samples.js:12: v2('-1,-1,card initialized.') graph2_samples.js:13: v2('-1,-1,card initialized.') graph2_samples.js:14: v2('-1,-1,card initialized. First connect to battery.') graph2_samples.js:16: v2('-1,-1,card initialized. reset') graph2_samples.js:17: v2('-1,-1,card initialized. reset two seconds later as marker. Charge Battery') graph2_samples.js:19: v2('-1,-1,card initialized. Charge Battery') graph2_samples.js:114: v2('-1,-1,card initialized. Charging with 25W bulb load') graph2_samples.js:301: v2('-1,-1,card initialized.') graph2_samples.js:302: v2('-1,-1,card initialized.') graph2_samples.js:303: v2('-1,-1,card initialized.') graph2_samples.js:306: v2('-1,-1,card initialized.') graph2_samples.js:307: v2('-1,-1,card initialized.') graph2_samples.js:310: v2('-1,-1,card initialized.') graph2_samples.js:311: v2('-1,-1,card initialized.') graph2_samples.js:312: v2('-1,-1,card initialized.') graph2_samples.js:313: v2('-1,-1,card initialized. Logger powered by black 0.65 amp USB wallwart.') graph2_samples.js:314: v2('-1,-1,card initialized. Logger powered by black 0.65 amp USB wallwart.') graph2_samples.js:315: v2('-1,-1,card initialized.') graph2_samples.js:317: v2('-1,-1,card initialized.') graph2_samples.js:319: v2('-1,-1,card initialized.') graph2_samples.js:320: v2('-1,-1,card initialized.') graph2_samples.js:466: v2('-1,-1,card initialized. Logger powered by black 0.65 amp USB wallwart. Ballast Charge via 25W bulb.') graph2_samples.js:576: v2('-1,-1,card initialized.') graph2_samples.js:577: v2('-1,-1,card initialized. Logger powered by black 0.65 amp USB wallwart.') graph2_samples.js:581: v2('-1,-1,card initialized.') graph2_samples.js:583: v2('-1,-1,card initialized.') graph2_samples.js:584: v2('-1,-1,card initialized.') graph2_samples.js:586: v2('-1,-1,card initialized.') graph2_samples.js:587: v2('-1,-1,card initialized.') graph2_samples.js:588: v2('-1,-1,card initialized. Charge battery via 25V bulb') graph2_samples.js:593: v2('-1,-1,card initialized.') graph2_samples.js:594: v2('-1,-1,card initialized.') graph2_samples.js:827: v2('-1,-1,card initialized. ? Brownout reset ?') graph2_samples.js:1163: v2('-1,-1,card initialized. Green USB battery had gone flat. Using fully charged Orange for self discharge test.') graph2_samples.js:1164: v2('-1,-1,card initialized. 1 hour 1amp charge') Found 86 matches for "-1".