Parts of a Data Logger
2) A microcontroller then stores this information, usually placing a time-stamp next to each data set. For example, if you have a data logger that measures the temperature in your room over a period of a day, it will record both the temperature and the time that temperature was detected. The information stored on the microcontroller will be sent to a PC using a UART for user analysis.
3) And lastly the data logger will have some sort of power supply, typically a battery that will last at least the duration of the measurements.
HyperTerminal is a program that comes with Windows and works great for data logging. Back in the day it was used for things such as text-based webpage browsing and/or uploading pirated files to your friends over the then super fast 56k modems.
You can download Hyperterminal here:
I will now show you how to set HyperTerminal so that you may record data outputted by a microcontroller through rs232 serial.
First, you need your microcontroller to handle serial data communications. If it has a serial or USB cable attached to it already, then you are set to continue.
Next, you need a program that reads and prints out sensor data to serial as in this example:
printf("%u, %u, %lu\r\n", analog(PIN_A0), analog(PIN_A1), get_timer1());
The time stamp isnt always necessary, and you can always add or remove ADC (analog to digital) inputs. Note that the get_timer1() command must be called right before, during, or directly after the sensor readings - or the time recorded will be meaningless. Also, use commas to separate output data values as already shown. I will explain the importance of this later.
Steps to Logging With HyperTerminal
Type in a desired name and push OK. The icon doesn't matter.
Now select a COM port, while ignoring the other options. Push OK.
In the COM properties, select the options you want/need depending on the microcontroller and serial communications setup you have. Push OK. Chances are if you just change the Bits per second to 115200 and leave the other options as default it should work fine. To make sure, check your C code header for a line that looks something like this:
#use rs232(baud=115200, parity=N, bits=8, xmit=PIN_C6, rcv=PIN_C7)
Now in the menu,
Now connect your microcontroller to your computer (by serial/usb) and then turn the microcontroller on.
Next you want to tell HyperTerminal to Call. Select the image of the phone:
Finally, tell your microcontroller to start logging data, and you will see the data appear on screen. Even if you do not plan to save your data, this can be a great feedback tool when testing your robot.
When logging is completed, click the disconnect button:
Then select Transfer => Capture Text => Stop
You should now have a .txt file saved with all your data. But you're not done yet!
Rename the file to a .csv, or Comma Separated Value (CSV) file format. What this does is allows you to open the file in Excel with each value seperated by columns and rows, making data processing much easier. Now you may interpret the sensor data any way you like.
Additional Info On Data Logging
The other method is selective logging, which means logging will occur over just a set period of time (usually a short period of time). If for example you want to analyze an event, your data logger would start logging at the beginning of the event and stop at the end. The advantage of this method is that you can get high resolution data without wasting memory.
Can I Buy a Data Logger for My PC?
Has this site helped you with your robot? Give us credit -
link back, and help others in the forums!
Society of Robots copyright 2005-2013