Simple (KISS) Home solar logging project with 12V lead battery and v. regulator..
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

5 years ago
  1. File='./output2.csv'
  2. set y2tics border
  3. # 6 Volts is about cutoff
  4. set y2range [11:14]
  5. # shorten range, if batteries are charged.
  6. set yrange [500:700]
  7. set term jpeg size 1920,1280
  8. set output 'homesolar.jpg'
  9. set title 'Home Solar' font ',20'
  10. set xlabel 'Iteration #'
  11. set ylabel 'ADC Reading: Current'
  12. set y2label 'Volts'
  13. samples(x) = $0 > 4 ? 5 : ($0+1)
  14. avg5(x) = (shift5(x), (back1 + back2 + back3 + back4 + back5) / samples($0))
  15. shift5(x) = (back5 = back4, back4 = back3, back3 = back2, back2 = back1, back1 = x)
  16. init(x) = (back1 = back2 = back3 = back4 = back5 = sum = 0)
  17. plot sum = init(0), \
  18. File using 3:(avg5($2)) title 'Current' with lines axes x1y1,\
  19. File using 3:(avg5($1)) title 'Battery Voltage' with lines axes x1y2
  20. #File using 3:(avg5($1)) title 'Battery Voltage' with lines axes x1y2
  21. #plot File using 4:1 with lines axes x1y2, File using 4:2 with lines axes x1y1,\
  22. #File using 4:3 with lines axes x1y1"
  23. #file looks like this:
  24. #12.55 583 40
  25. #12.55 582 41
  26. #12.55 570 42
  27. #12.55 571 43
  28. #12.55 600 44
  29. #12.55 588 45
  30. #12.55 579 46
  31. #12.55 572 47
  32. #12.55 587 48