Go Down

Topic: IDE / Serial Monitor over several hours causes javaw to run 100% / hangs system (Read 493 times) previous topic - next topic

pydc

Hello all,
Help, my solar experiment is crashing my serial monitor!

I am running an Arduino Uno v3, latest IDE on stock Windows XP SP3.  I have a current monitor that ties into my arduino board and sends current readings back to the serial port that is then displayed on the serial monitor. Everything works fine, for several hours, but then, every single time, the next day I return to the office to find the computer hanging, serial output stopped, and javaw running at 100%.   The example code is below - untouched from: https://github.com/adafruit/Adafruit_INA219/blob/master/examples/getcurrent/getcurrent.pde


The sensor reads correctly when the program is operational - but for reference:
The circuit is wired thusly:  http://learn.adafruit.com/adafruit-ina219-current-sensor-breakout/wiring. The only twist I have is the incoming current comes from a solar panel so I have an diode in the path the prevent back flow of current. It is a high side current sensor / volt sensor so it is required to connect the (-) from the solar panel to the (grd) from the arduino to the (-) on the solar charge controller.  The (+) goes to through the current sensor (V+ to V-) then to the charge controller.  The charge controller then charges a 12 V Deep Cycle Battery if necessary.

Is the serial monitor not a reliable way to view data over the long haul or am I missing something obvious?

Please note the code below is straight up example code from Adafruit and I am told is bug-free:

Code: [Select]

#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;

void setup(void)
{
 uint32_t currentFrequency;
   
 Serial.begin(115200);
 Serial.println("Hello!");
 
 Serial.println("Measuring voltage and current with INA219 ...");
 ina219.begin();
}

void loop(void)
{
 float shuntvoltage = 0;
 float busvoltage = 0;
 float current_mA = 0;
 float loadvoltage = 0;

 shuntvoltage = ina219.getShuntVoltage_mV();
 busvoltage = ina219.getBusVoltage_V();
 current_mA = ina219.getCurrent_mA();
 loadvoltage = busvoltage + (shuntvoltage / 1000);
 
 Serial.print("Bus Voltage:   "); Serial.print(busvoltage); Serial.println(" V");
 Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
 Serial.print("Load Voltage:  "); Serial.print(loadvoltage); Serial.println(" V");
 Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
 Serial.println("");

 delay(2000);
}

James C4S

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Erdin

Perhaps some older Java parts are on your computer.
The Java part for the serial port is also the least stable of all.
I use "Q Serial Terminal" and let it log to a file, http://sourceforge.net/projects/qst/

eried

You want to copy the data from the serial monitor window after 1 day? Follow James' advice and use another app. I personally recommend HTERM
My website: http://ried.cl

Go Up