Reading Serial Problems

I am reading serial from a sensor, using following code: Adafruit_PM25AQI/PM25_test.ino at master · adafruit/Adafruit_PM25AQI · GitHub

There's an Arduino library that I installed, and the code compiles and runs. But my serial monitor shows this:

Adafruit PMSA003I Air Quality Sensor
5.0um / 0.1L air:1
Particles > 10 um / 0.1L air:0
---------------------------------------
** > 2.5um / 0.1L air:5**
Particles > 5.0um / 0.1L air:1
Particles > 10 um / 0.1L air:0
---------------------------------------
** > 2.5um / 0.1L air:5**
Particles > 5.0um / 0.1L air:1
Particles > 10 um / 0.1L air:0
---------------------------------------
=e
i0K[kCanR ۛi0n5K[BL,CћZR n5BhND4Vf,ћ%ZHDO՚l ,OhD)VZ( )HD5$FU%M O7̨D)DZۛM )(OۛG l `ɛ<e3̨Dۛ[ٛ>Ê

**And the rest is gibberish **

Any ideas?

@joelt42, your topic has been moved to a more suitable location on the forum. Intruductory tutorials is for tutorials that you write to help others, not for questions. Feel free to write a tutorial once you have mastered the problem :wink:

I get this sort of problem with high numbers in Serial.begin(115200);
A test would be to try 9600 to rule that out.

Slight errors in the serial baud rate due to CPU clock inaccuracies can lead to such gibberish.

Which MCU/Arduino are you using, and what is the clock frequency?

Hi, @joelt42
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

Can you post a circuit diagram?
Can you please post a link to data/specs of your sensor?
What model Arduino are you using?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Thanks all for the replies.

I got it working. I was connectin the Uno R3 to my computer via a USB hub initially. When I went directly into the USB port on the computer it worked.