Acquiring Data from the Chipsats

Chipsat SpinLaunch Experiment on Flight Test 10

V. Hunter Adams


Hooking up the hardware

  1. In the image below, all of the necessary connections to the chipsat are labeled.
    missing


  2. Attach a power supply to the 2.2V and GND pins, as shown below.
    missing


  3. Attach the GREEN lead from the USB to UART converter to RX, and the WHITE lead to TX, as shown below. Attach the black lead from the USB to UART to ground.
    missing



Confirming that everything is connected correctly

  1. Open Device Manager, and expand the Ports menu
    missing


  2. Plug the USB to UART connector into the PC, note which COM port appears in Device Manager. In the window below, we see the USB to UART converter on COM5.
    missing


  3. Open Putty, and configure for a serial connection to the COM port from step 2 at 9600 baud. In the example below, we have configured a serial connection to COM5.
    missing


  4. Click Open and a terminal window will appear. Power on the chipsat, and data will begin to stream into the terminal, as shown below.
    missing


  5. Note that the first item in each line is the device ID (23, in this case). The next comma-separated values include the x/y/z measurements from the gyro, accelerometer, and magnetometer, then the ambient light measurements from the front and rear light sensor. If you see data streaming, the device is connected properly.

Acquiring Data

Procedure

  1. Close the Putty window, to free up the COM port.
  2. Power off the chipsat
  3. In the code provided below, change the COM Port to whichever has the USB to UART dongle attached. For me, it was COM5.
    • Note: This code will open a serial connection to the USB to UART converter and write 200 measurements from each sensor to the filename that you specified.
  4. Run the code.
  5. Power on the chipsat.
  6. Wait while data is gathered.
  7. Change the filename, and repeat for the other chipsats.

Code

# Import libraries
import numpy
import serial
import matplotlib.pyplot as plt
import os

# Specify port and baud rate
ser = serial.Serial('COM5', 9600)

# Indicate a file name and directory to store data
# Note that this file name should be different for each chipsat
# I recommend using the convention that the file name is the chipsat
# identification number.
filename="./Prior_Data/22.txt"

# Write 200 sensor measurements to the specified file, then close the file
datafile=open(filename, 'a')
count = 0;
while count < 200:
    datafile=open(filename, 'a')
    data = ser.readline().rstrip()
    datafile.write(str(data))
    datafile.write('\n')
    print(data)
    count += 1
    datafile.close()
datafile.close()
ser.close()