Putty Serial Monitor for Arduino

I have found that the serial monitor provided by the arduino SDK is very useful for monitoring what your arduino is doing but can be limited with how it outputs the data essecially if you have very fast streams of serial data using the highest baud rate available. It starts to become a bit much to monitor with the naked eye if you cannot use delay fuctions so why no have some sort of static tabular form for your variables?

Unfortunately the Arduino serial monitor doesn't seem to support this sort of functionality, fortunelty I have a very simple and quick solution to this formatting problem.

Using the popular freeware program putty we can monitor our USB COM ports just as easily as we can with the built in serial monitor. It will take second to download and requires no installation. Best of all it can be used for other application environments such as monitoring networks or remotely accessing computers so it is worth downloading this small but powerfull program.

Using the puTTy program we can set up our serial monitor with a lot more formatting options for monitoring lots of changing data in a managable structure such as tables. Best of all it requires barely any change to the arduino code, apart from telling the terminal how to ouput the data with nothing more than some additions to our Serial.print() functions.

This is what you will see by default when you start the program, in order to monitor your arduino you will need to click the radio button labeled 'Serial' on the right hand side of the window. This will take you to the serial monitor context options.
Now in order to show your Arduino data you need to check two things on the Arduino SDK one is what 'COM' port your arduino comunicates on (it should tell you under Tools/Serial Port) you need to know this anyway in order to upload your code. Simply change this to COM(port number) e.g. COM4 to monitor on the correct port or putty will output an error when you try to run it.

The other think you need to know is what speed your Arduino is outputting at so when you start your serial communication in your code (e.g. Serial.begin(9600)) putty seems to default to 9600 anyway so you may not need to change this number if you have declared it as so in your code.

This next step is simple, upload your code using the Arduino SDK 'upload' button, then once it has done use the 'open' button on the putty window to initialise the serial monitor. You should see something that looks like the MS-DOS prompt recording your arduino outputs.

Seemingly pointless at the moment yes, but if we want to put our outputs in a specific format this is where using this method becomes advantageous...


Now if we want to tabulate our data in a contantly updating format all that needs to be done is to tell the putty serial monitor what we want done, this is where using this method is better than using the defaut Arduino serial monitor.

To give command to putty we just send it messages via the Serial.print() method.
Putty comands ussaly start with sending the ESC key in ascii format to do this we add a line in the arduino code:
Serial.write(27); (27 is the ESC key in ascii)

After the ESC key we then send our putty commnd, in order to constantly update in the same data format we need to return the putty terminal cursor to the top left corner of the window by writing:
Serial.writ("[H"); (returns the cursor to home)

By doing this the cursor will constantly update the data in the window by overwriting what was there originally. This will allow us to use a loop to dynamically probe and output our data in a more static  (non-scrolling) tabular format, making it much easier to read in monitor lots of constantly changing data.