Pages: [1]   Go Down
Author Topic: IDE / Serial Monitor over several hours causes javaw to run 100% / hangs system  (Read 470 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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);
}
« Last Edit: April 26, 2013, 10:04:32 am by pydc » Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Use a real terminal application like putty for data logging.
Logged

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

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

My website: http://ried.cl

Pages: [1]   Go Up
Jump to: