
One of 2856's team members soldered anderson connectors for the input and output lines so that we could put the sensor between the battery and the robot. I also purchased an SD card shield for Arduino, wired the current, voltage and ground pins to the Arduino, and wrote a program to log data on the SD card.

The pictures below show the finished product.



As you can see in the last picture, the four diagnostic LEDs include a power button, a toggling LED which shows when data is written to the SD card, an error light which illuminates if the program failed to detect the SD card, and an error light which illuminates if there is an error writing to the SD card. These LEDs are very useful, because without them it's impossible to tell whether you have successfully collected data before the SD card is plugged into a laptop.
Data is exported in CSV format in the form shown below.
dataString = String(millis());
dataString += ", ";
dataString += String(VFinal);
dataString += ", ";
dataString += String(IFinal);
A data set is collected every second. The program is found here.2856 made great use of the datalogger by designing a series of experiments which isolated specific systems on the robot and tested them for current draw. They found that the tank treads were the culprit, pulling upwards of 15Amps at times. This was sucking our 3000mA-hr battery dry very quickly. They reduced the friction in the tank treads and lowered the current draw.
In general, when we graph the data, we see that current and voltage are inversely related. Hence knowing having both is somewhat redundant, although its nice to see how much the voltage sags under load and to see how much current is being consumed. A little test robot pulled 3-5 A maximum, yet the voltage sometimes sagged from 12V all the way down to 6V. Probably a pretty old battery!


While having the data itself can be very powerful, I thought it would be interesting to go one step further and see if I could visualize the current and voltage in real time. I wrote a python program which plotted the data in real time on my computer screen. Script is here.

The video linked below showed a recording on my computer screen as it plots the data. The quality sucks, but this was just a proof of concept.
Finally, a friend and coworker made a movie showing the robot moving at the same time as the data is being plotted. The two are close to, but not exactly lined up. Still, it's obvious that as the robot executes certain motions, the current spikes. When the robot stops, current drops to zero. Current jumps drastically as the robot starts from a stop. It stays at a medium value when the robot is stuck (eg running into the wall at 0.42 or stuck on a ball at 0.27). By the ending the plot is delayed by at least a couple seconds compared with the robot motion. So as a real tool, it would require much better syncing.
