Doing data logging
From GoGoWiki
The GoGo Board has built-in memory that you can use to store data over a long period of time. It is useful in environmental monitoring projects. Here are some examples:
- You can monitor how the temperature in a refrigerator changes over time (i.e. over 5 hours). The result might surprise you.
- You can measure how soil humidity in your garden changes together with light and temperature.
- You can compare temperature change inside and outside your house. They are not always the same.
- You can monitor how many people walk by a store (i.e. using a switch on the floor) and look for the busiest time in a given day.
The following Logo commands are provided for data logging:
| Command | Description |
|---|---|
resetdp
| Reset Data Pointer. This rewinds the memory pointer to the beginning. Any logging after it will overwrite what was there before. |
record value
| Will record a value to a memory location pointed to by the data pointer. Date pointer than automatically advances to the next location. |
setdp number
| Sets the data pointer to any given position. |
recall
| returns the value at the memory location pointed to by the data pointer. Data pointer automatically advances to the next location. |
erase number
| sets the first 'number' values of the log memory to zero and the sets the data pointer to zero. This operation can be quite slow. For example, erase 2500 could take up to 50 seconds to complete. |
The following example shows how you can record sensor1's value every 10 seconds for 1 hour.
to doLog
; reset the data pointer memory
resetdp
; every 10 seconds for 1 hour = 6 times per minute for 60 minutes = 6*60 = 360 times
repeat 360 [
record sensor1
wait 100 ; 100 = 10 seconds
]
beep ; signal that the program is done
end
Uploading the recorded data
Once you have recorded some data onto the gogoboard, you can easily upload the logged data to a computer using the gogo monitor software. Simply go to the Upload Recorded Data tab and click on the Start Upload button. You will see you data on the screen. This data can then be saved as a text file for further analysis (i.e. in Excel.)
Available Memory
The amount of memory available for data logging depends on the gogoboard you use. Boards that uses the 16F877 chip has an external EEPROM chip that allows about 16,000 values to be stored. While boards that uses the 18F458 chip does not use an external EEPROM chip and can store about 3,500 values. Each value is a 16 bit integer and the value can range from 0-65535.

