Go Down

Topic: Serial communication always reporting seemingly random numbers (Read 376 times) previous topic - next topic

MungoBBQ

Nov 04, 2012, 10:58 am Last Edit: Nov 04, 2012, 11:00 am by MungoBBQ Reason: 1
Hi everybody,

trying to get my first project using serial communication up and running on my new Arduino Uno.

I have tried a couple of example programs, but I am getting nothing from the serial read, and then I discovered that as soon as I begin serial communications, the serial monitor reports nothing but seemingly random numbers.

I am now using a very bare-bones program:

Code: [Select]
void setup() {
Serial.begin(9600);       // use the serial port
}

void loop() {

}


Running this code, and opening the serial monitor, I am seeing a bunch of randomness, looking like this:

4515

4474
40
3349
45
33319
316
3314318

07
307306330
30
31313306
333233113314
19
332310
331320
16
330305
011
313314
316
3331315103304

31336
320
31332134
030304330633019
332
11
008
30319
321
3316
314
310330503319130530310
3331832313
306
3053314
303192310
308
315
3320323
2
93130363304
1314
32020
320330309
311
3133
30530630
6
3

12
306
30533033
3303
337
33
3
133143113030305337

As you can see, I have no Serial.read() anywhere in my code - is it really correct that the serial monitor should even be showing stuff at all? And how can I get my serial communications to report what I am actually attempting to get it to report?

Grumpy_Mike

Serial.begin does not start communicating it just sets up registers and stuff. Random numbers normally mean an unconnected or floating input somewhere.

In fact what you report is not possible so you must be doing something that you are not reporting. That sketch should do nothing.

Nick Gammon

Looks like the wires aren't connected.

This is a programming question anyway. Thread moved.
http://www.gammon.com.au/electronics

MungoBBQ

That's right, the sketch should do nothing, but as you can see I am getting weird input.

The numbers are the same no matter if/how I connect the wires.

Grumpy_Mike

Quote
the sketch should do nothing, but as you can see I am getting weird input.

That should be a weird output from the arduino.

As I said that will not happen if you run that sketch and it is wired up correctly.

It could be that your board is damaged, do you see the TX light flash when the serial monitor is receiving this?

We need much more information:-
What OS are you running on the PC?
Will the arduino program up a blinking LED sketch?
Have you set the speed on the serial monitor to be the same as the arduino sketch?
What sort of arduino are you using?
Have you a photo of your setup?
Have you selected the right serial port in the tools menu?

What happens to the serial monitor when you disconnect the arduino?

Go Up