Problem displaying data on serial monitor

Hi, new to Arduino and having problems displaying any data on the serial port.

Tried the TMP36 tutorial here: Using a Temp Sensor | TMP36 Temperature Sensor | Adafruit Learning System and nothing prints to serial. I can display temp data on a 16x2 LCD via SPI but now having problems with displaying an DS1307 RTC so need to debug with the monitor.

Checked baud rates etc.

Looked for solutions and found one with a 10uf cap between reset and ground but no luck, would a 120r resistor be better?

You asked something like this in your other posts. But it is good to start a new topic for a specific problem.

Please remove any sensor or RTC from your board.
Remove any modification with capacitors or resistors or whatever.

You have a Arduino Micro board ?
The Arduino Micro is like the Arduino Leonardo, and you should take special care with the serial communication.
The serial port via the USB for the Micro is a software serial port. You have to wait in your sketch for the serial monitor to get started, or else you won't have serial output.

Could you try this simple sketch:

// untested example

void setup()
{
  Serial.begin(9600);

  // While the serial stream is not open, do nothing.
  // Wait until the serial monitor is started.
  // This is only for the Leonarde and the Micro.
   while (!Serial) ;

   Serial.println( "Hello !");
}

void loop()
{
  Serial.println( millis() );
  delay(500);
}

Thanks for the reply Erdin. If I started a separate topic for all of my specific problems I would have the forum to myself :wink:

Ok I did as you asked to the letter and absolutely nothing shows on the monitor. Interestingly If I click reset in the monitor window the LED on the micro board lights up.. so they are connected.

I waited until the the sketch had uploaded and was running before opening the monitor.

That is very weird.
If you can upload your sketch, the serial communication via the usb is working. That means that the serial monitor should also be working.

I have no clue.

My first guess would be some problem with Java and the Arduino IDE on the computer.
Could you try another computer. And with no Java installed.
Use the newest Arduino software (1.0.5) and try that sketch again.

My second guess would be something with the Arduino board. But that is hard to determine. You could try the other serial ports, or a different serial terminal program on the PC.
I have collected a number of things over time. Like usb-to-serial converters, and I have a USBasp programmer, so it would be easier for me to pinpoint the problem.

Once you opened the serial monitor, you have to press reset on the arduino...just saying :slight_smile:

Very simple test code that will echo what is sent via the serial monitor back to the serial monitor. Make sure the serial monitor baud rate and the code baud rate are the same.

// zoomkat 7-30-11 serial I/O string test
// type a string in serial monitor. then send or enter
// for IDE 0019 and later

String readString;

void setup() {
  Serial.begin(9600);
  Serial.println("serial test 0021"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    delay(2);  //delay to allow byte to arrive in input buffer
    char c = Serial.read();
    readString += c;
  }

  if (readString.length() >0) {
    Serial.println(readString);

    readString="";
  } 
}

Thank you Erdin, o_lampe and zoomcat.

Erdin - I'll grab a laptop and try this and I suppose the only way to be sure is to try another setup either with another arduino board or raw components which I have acquired.

o_lampe - tried this several times both on the board and from the monitor.

Zoomcat - thanks for the test code, I tried it and nothing comes back when I type and send. I think Erdin is right there must be a problem with the IDE or board.

I suppose the serial monotor not working is no biggie, I can get some code to work just fine. Just a shame I can't debug so effectively.

Many thanks for the responses, and keep them coming. I'll certainly get back if or when I find the solution., just need to get this DS1307 working :wink:

This problem is shared with the Leonardo. It has something to do with the way USB is handled.

I ran the same test using a 1280 Mega and an Uno with no problems. I was able to get 5 micros to work but it was not easy. They seem to listen to only a specific port and it varies. I had to reboot my computer and close down the Arduino IDE multiple times because the port it wanted was "In use".

The Leonardo worked on some ports and not others. The (!Serial) {} did not seem to have any effect.

I am going to try connecting a micro to an Uno or Mega (as it has been reported that the serial lines work even when there is no serial printing to the computer over the USB), then have the Uno/Mega pass the info to the monitor. Hope it works, because the feed back is needed for debugging.

Someone needs to come up with a software/firmware fix for this problem or the Leonardo and Micro sales are going to suffer.

Rico_B:
I had to reboot my computer and close down the Arduino IDE multiple times because the port it wanted was "In use".

This is a chronic problem and just as likely to happen with Megas and Unos. You should not have to reboot the computer, just closing down all your Arduino stuff should suffice.

It's just something you get used to..........