Tekbots Data Logger 3.0 User Manual Overview The Tekbots Data Logger device can sample a 0 to 3.3 volt signal with 10 bit precision, allowing eight channels of to be sampled simultaneously. The data_lgr.3 device can store more than 10,000 samples, and can sample at periods from 200 micro seconds per channel to 200 seconds. Multiple sessions can be stored on the data_lgr.3 device, and each session will be stamped with the time the session began. The user interface also allows the device to be used in an 8 bit live session mode, where the data is stored on the computer rather than the device. Usage The Data Logger 3.0 software can configure and read from the data_lgr.3 board. When the Data Logger 3.0 program is first started, the screen will appear as in Figure 1 below. Figure 1 - Data Logger 3.0 User Interface In Figure 1, no data_lgr.3 board is connected to the computer. The current Data Logger state is indicated by the status label at the bottom of the screen. If a data_lgr.3 device is connected to any USB port on the computer (no driver is required), the device will be recognized and the Set Settings, Erase Datalogger, and Start Live Session buttons will become enabled. Setting up a Sampling Session By default, the data_lgr.3 board will sample with a period of 0.02 seconds using ADC input channels 0 and 1. If other settings are required, follow these steps: 1. Connect the data_lgr.3 board to a computer 2. Run the Data Logger 3.0 software on the computer 3. Click the Settings button on the Data Logger 3.0 user interface. At this point, a dialog will appear which resembles Figure 2 below. Figure 2 - Data Logger Settings Dialog In the Settings Dialog, simply check the channels to use, and select the desired sampling period (in seconds). Press OK, and the settings will be stored on the data_lgr.3 board. If an invalid sampling period is selected, the Sampling Period box will appear red and the OK button will be disabled. The minimum sampling period per channel is 200 micro seconds, and the maximum is 200 seconds. The data_lgr.3 board is designed to sample from a source with and output impedance no greater than 20K ohms, but can sample from higher impedances if High Input Impedance Mode is selected. In this mode, the sample and hold circuitry is connected to the input for 100 micro seconds to allow the voltage levels to stabilize. In some applications, it may be important to note that on any sampling interval, each successive channel sampled will be phase shifted by 125 micro seconds from the prior. For example, if channels 0, 1, and 4 are chosen, channel 1 will be sampled 125 micro seconds after channel 0, and channel 4 will be sampled 125 micro seconds after channel 1. Once the OK button is clicked, the settings will be applied to the data_lgr.3 device. Sliding the run/stop switch to the RUN position will begin a sampling session with the most recent settings. Sliding the switch back to the STOP position will refresh the sample list in the Data Logger 3.0 software, and the new session will be visible in the session list. Downloading and Saving a Sampling Session To download and save a sampling session, follow these steps: 1. Connect the data_lgr.3 device to a USB port on the computer 2. Run the Data Logger 3.0 software on the computer 3. Have at least one session stored on the Data Logger Figure 3 below shows the Data Logger software with four sessions recognized from the device. Figure 3 - Data Logger 3.0 With Four Sessions Recognized The software will automatically recognize the sessions, but does not automatically load them. To load a session from the device, click the Load button for the respective sample. The progress bar will display the load progress. Load time will vary from a small fraction of a second to 30 seconds. When the load is completed, the Load button will change to Save, and the data set will be displayed in the chart. Figure 4 below shows the Save button and graphed data. Figure 4 - Data Logger 3.0 Software with one Session Saveable Clicking Save at this point will open a Save File dialog. Enter the location and filename, and the data set will be saved as a comma separated values (.csv) file, which can be opened and manipulated with programs like Matlab or Excel. Running a Live Session To run a live session, first ensure the following: A data_lgr.3 device is connected to the computer The Data Logger 3.0 software is running The data_lgr.3 device is set to Stop To begin the live session, first click the Start Live Session button and the settings dialog will appear. Set the desired settings (live sessions have a minimum sampling period of 200 micro seconds per channel), and click OK. At this point, the sampling will begin and the results will be displayed live in the chart. A maximum of 1000 data points will be displayed during a live session, and the total number of points is only limited by the memory capacity of the computer. To stop a live session, click Stop live Session. The data will be stored in memory on the computer until Save is clicked on the data set. Be aware that exiting the program will cause all unsaved live session data to be lost. Board Indicators and Connectors Power Indicators The data_lgr.3 device can be powered from USB or from four AA batteries. When the batteries are low, a red indicator LED will turn on. There are two indicator LED’s: One for the output power (V+ and GND), and one for the microcontroller power. When battery voltage is too low, one or both of the power indicator LEDs will light up red. The Output Power Indicator will turn on before the MCU Power Indicator. The power indicators will also turn on if too much current is drawn from the V+ and GND pins: the current limit is 0.15 amps. Sampling Indicators When the device samples a channel, the Channel Indicator LED will flash. This provides a convenient method for ensuring the configuration is correct. Note that if the sample period is small (high frequency sampling), the Channel Indicator LED’s may appear to be on continuously. Memory Full Indicator When the flash memory onboard the data_lgr.3 device is full, the MCU State Indicator LED will flash on and off, and every other Channel Indicator LED will be on. In this state, the data_lgr.3 board must be reset and the memory must be erased before any more data can be stored (be sure to download and save the data before erasing the data logger!). To reset the data_lgr.3 device, simply disconnect USB and battery power momentarily. Memory Corrupt Indication A corrupt memory state is signaled by the MCU State Indicator LED blinking rapidly and the Channel Indicator LEDs all turned on. If the data_lgr.3 device enters this state, the data stored in the device memory is inconsistent with what is expected. The raw data in the memory chip can be recovered by running the raw data downloading tool. The device can be put back into a usable state by resetting the data_lgr.3 and erasing memory. General Error Recovery If the data_lgr.3 board is ever in a state where samples cannot be taken (the MCU State Indicator led flashes and the Channel Indicator LEDs are constantly on to some state), all state holding variables can be reset by the following procedure: 1. Disconnect all power from the data_lgr.3 board a. Remove at least one battery b. Disconnect the USB connector 2. Reconnect the data_lgr.3 board to the computer 3. If the data must be recovered, run the data recovery utility on the computer 4. Run the Data Logger 3.0 software and choose Erase Datalogger At this point, all state holding memory in the data_lgr.3 board is cleared and the data_lgr.3 device will be ready to sample data again. Hardware Overview The data_lgr.3 board uses an at90usb162 microcontroller as an interface between the computer USB, memory chip, and ADC chip. The microcontroller will communicate using the Serial Peripheral Interface protocol (SPI) with the ADC and memory, requesting a sample from the ADC and storing the result in the external flash memory. Microcontroller Operation The at90usb162 microcontroller uses the LUFA USB code for a Generic HID device. Generic HID devices use drivers built into the operating system, so no driver installation is required. The microcontroller operates at 8Mhz on 3.3 volts, and all I/O lines to the microcontroller are 3.3 volts as well. If the data_lgr.3 device must be reprogrammed, simply connect the HWB (hardware boot) pin to ground and momentarily connect the reset pin to ground. The microcontroller will load the default Atmel boot loader and the chip can be reprogrammed with the Atmel Flip utility. Memory Chip Operation Samples and session data are stored on the external flash memory SST25VF010A device. This device has 1048576 bits of storage capability. Before a sampling session begins, the microcontroller will write a 20 byte header to the flash memory, and sample data will be stored afterwards. When a sampling session is complete, the number of samples will be written to the header. If a sampling session is terminated unexpectedly (power is removed), the size will be stored as 0xFFFFFF and the true size will be detected and written to the header before the next sampling session begins. ADC Chip Operation The ADC chip is an MCP3008 8 channel, 10 bit, 2.7v to 5v, 200ksps analog to digital converter. At 3.3 volts, the chip can sample at around 75ksps. Using the microcontroller at 8Mhz limits SPI clock rates to 4Mhz, which in turn limits actual sampling frequency to around 5Khz. Faster sampling rates could be obtained if samples were stored in 8 bit format instead of 10, and if the output impedance of the sampled signal is guaranteed to be small (less than 1K). The input of the ADC chip is a sample and hold circuit which connects to the channel input when a sample is taken. When the sample and hold connects, a hold capacitor must charge up to a stable voltage. The precision of the sample and hold measurement is a function of the sampling time and input impedance: a longer sample time will allow for a larger input impedance. Currently, normal samples are taken with a sample time of 10 micro seconds, which allows for accurate measurements with input impedances up to 20K ohms. In high input impedance mode, the sample time is increased to 100 micro seconds, allowing for accuracy with input impedances up to 500K ohms. Note that the increased sample time when using high impedance mode will cause increased phase shift between successive samples on the same sampling interval.