One issue you're going to have to work out is that the voltage at the battery is going to sag at engine idle speed. I don't know how typical this is, but with my bike, the alternator output at idle is less than the power drawn by the lights and other load. The result is that the battery is not charging at idle and is, in fact, slowly being drained. In normal operation this isn't an issue because the battery is charged when the engine is running above idle.
The resultant problem is that the Arduino has limited memory to log voltage readings and there will be instances of "battery not charging" during normal operation even if the charging system is operating as designed. With a voltmeter display you would recognize that the electrical system running at about 12 volts at idle and 14 volts at higher RPMs is normal, getting that sort of intelligence into a computer program isn't so easy.
Mine seems to run at around 12.8/12.9 at idle, it gets to 14.5 at 5000rpms, which is on point with the workshop manual.
I would be happy with monitoring it only at startup to begin with, which is when some of the strangeness appear to manifest itself. This way I would be able to read the voltage before starting up the bike, the drop at start-up and then the charging tension while warming up the engine. I could just hook up a voltmeter and doing some logging by hand, but where's the fun in that!
Nice to add features to your iron horse, but aren't you overthinking it a bit.
It seems you have a "problem" with your bike.
Something that has to be analysed and fixed.
A simple LED display could tell you instantly when something is wrong.
This is what my brother said. I know I am overthinking it, but I was looking for an excuse to build something
I was also hoping to find a small LED voltmeter, like the one you linked, that could be somehow used with something that would do the data logging.
I have now had three alternator failures on my boat (which has 2 alternators) and the only diagnostic tool I needed was a cheap digital multimeter, my eyes and a knowledge of how they work. In the first 2 cases the rectifier needed to be replaced. In the third case (recently) the brushes were worn out. As I was not sure what the problem was this recent time I bought two complete repair kits for £50 so I still have lots of parts for future failures.
How do you know that "Something strange is happening". What symptoms have you noticed.
To my mind the best diagnostic tool you could get (assuming you already have a multimeter) is an oscilloscope. You could program an Arduino as something equivalent to a 'scope - but it would not be nearly as versatile. And you will always wonder if the problem is with your bike or your code.
Well, two things happen and I still haven't been able to reproduce them. Therefore the need to log (at least in my mind).
- I found the battery not on top condition a couple of times (after 7/10 days of not being used you can definitely tell that the alarm system has drained power), but still strong enough to start it. I used it, stopped, tried to start it up again only to find out that somehow the battery was in worse condition than before, as in not able to start the bike anymore.
- Every now and then, when pushing the start button the bike has a 1sec-long moment of indecision, where power is clearly being drawn (I see the dashboard dimming) but the relay doesn't click and the starter doesn't move. After that, everything goes smoothly.
For logging data I'd suggest an external EEPROM, providing more space than the interal EEPROM. The data can be overridden (circular buffer), so that the EEPROM holds the most recent readings. For huge amounts of data a SD card is another option.
Add means to start and stop logging, and code to dump the logged data to your PC (Serial to COM port). The start/stop conditions can come from switches, or from logic that detects a voltage loss of the battery, or when the motor is started or stopped. I'm not sure, though, whether you can start/stop logging manually while driving.
An LCD display for the current values can be helpful, of course.
I'm not sure whether the battery voltage (and time) represents sufficient information for your bug hunt. The RPM may be of interest as well, in detail for the logging start/stop logic.
Thanks. Reading the rpms would be pretty neat, but would require more data reading. I wouldn't know where to get it though.
Thanks for all the help. Bottom line it looks like I might be better of with just an LED voltmeter stuck underneath my nose for a while and see what happens. My hands are itching for some Arduino work though. Damn indecision.
Oh, just so you know, I have bought a battery charger/maintainer, which should help me a bit by keeping the battery always charged. I was also thinking of buying a new Lithium battery, but I wanted to be sure everything else works. I wouldn't want to fry it.
P.S. The bike is almost 15 years old. There is that too to keep in mind.