v1.3 4. STEM Payload Board 2 - alanbjohnston/CubeSatSim GitHub Wiki

We can now start doing some intermediate tests on the board.

You will need these tools:

  • Safety glasses (to protect eyes while soldering or trimming leads)
  • Soldering iron and solder (I use lead-free solder, but leaded solder is easier to work with)
  • Needle nose pliers (to bend leads and hold parts)
  • Side cutters (to trim leads)
  • glue, such as super glue to attach the JST connectors to the PCB

Other tools that are helpful:

  • Blue mounting putty (to hold components in place while soldering)

The first part of this step is testing while the second part continues the assembly

Checklist

The BOM has a sheet "By Steps" which lists the parts needed for each step in order. If you have a Google account, you can make a copy of this spreadsheet ("File" then "Make a Copy") and check off each part as you install it.

For example, here is the checklist for this step:

4.1 Testing

Video

Here is a video of the testing part of this step:

Pi Blink Test

For these tests, you will need your Raspberry Pi Zero W or Pi Zero, a micro SD card with the CubeSatSim software installed (see the Software Install instructions), and the USB-C power cable (or a micro USB power cable or adapter if you power it directly to the Pi).

IMG_2952

If your Pi Zero W does not have the 2x20 pin header installed, you will need to carefully solder it in. The pins should stick up on the side that has the ICs and the SD card holder.

Flip the Pi upside down and plug it into the bottom of the board so that it looks like this:

IMG_2954

Plug your USB-C power cable directly via the PCB USB-C port (If you only have a micro USB cable, you can plug it directly into the Pi Zero for this test). The Pi will turn on and the tiny green LED on the Pi will be on or blinking. Note that the LED is on the top of the Pi Zero W board, but you can see it through the lower left mounting hole, as shown in the photo above.

If you don't see this, make sure you have your micro SD card with the CubeSatSim software installed and the micro USB cable providing power to the Pi.

With the USB-C cable plugged into the board, the Red LED will be illuminated:

IMG_2959

Power LED Test

With the Pi plugged into the main board and the power cable plugged into the Pi micro USB port, about 30 seconds after booting, the CubeSatSim software will run and turn on the green Power LED.

IMG_2960

If the LED doesn't illuminate, it might mean there is a problem with the green LED LED1 or resistor R11 or that the CubeSatSim software isn't running.

Transmit LED Test

With the Pi plugged into the main board and the power cable plugged into the Pi micro USB port, after booting, the CubeSatSim software will run. When the CubeSatSim is transmitting, the blue Transmit LED will be illuminated, occasionally blinking. This indicates that the CubeSatSim is transmitting.

IMG_2961

If the blue LED doesn’t illuminate, it might mean there is a problem with the blue LED LED2 or resistor R12 or the CubeSatSim software. If it only illuminates once, it might mean that the Band-Pass Filter is not detected by the presence of resistor R1 or R2 - check this resistor.

Transmit Test

If the blue LED is illuminated or blinking on and off, you can tune your radio or SDR to 434.9 MHz (+/- 15 kHz) to see and hear a carrier signal. You don't have an antenna yet, but a close by radio will pick it up. If you have your FoxTelem ground station working (the Ground Station instructions are here), you can try to decode frames in FSK mode.

If your blue Transmit LED is illuminated but you don't see a signal, check your antenna on your radio or SDR, and the gain and frequency on your SDR or radio. Or there may be a problem with the CubeSatSim software, in particular the rpitx library.

4.2 Build

Video

Here is a video of the assembly part of this step: https://youtu.be/9ZKbU2a29TQ

If all your test results are "nominal" (expected results), you can continue your build after shutting down the Pi as described in the Power Button Test (by holding the push button until the green LED blinks slowly then releasing) and unplugging the Pi from the board.

FM Mode Tests

Test APRS (mode 1), SSTV (mode 4) and CW (mode 5).

I strongly recommend using sockets for your Raspberry Pi Pico processor. This way, you can program and test it unplugged from your board. This will help you figure out if any problems are a hardware or software issue.

The components, as described in the BOM https://cubesatsim.org/bom are:

  • Raspberry Pi Pico with two breakaway pin headers.
  • 1N5817 diodes D1, D2, and D3 to supply power to the board (black with a grey band on one side)
  • 4.7k Resistors R1 and R2 as pullups for the I2C bus
  • BME280 Temperature Humidity Barometric Pressure Sensor (small purple board) with 1x4 pin header
  • MPU6050 (GY-521) 3-Axis Accelerometer and Gyro (larger blue board) with 1x8 pin header
  • GPIO female non-stacking connector
  • 100nF capacitors C1, C2, and C3
  • Diode D4 1N4148 (has "41" and "48" printed on it and a black band on one side)
  • Green LED 5mm clear lens LED1
  • Blue LED 5mm clear lens LED2
  • 1k Ohm resistor R3
  • 100 Ohm resistor R4
  • 10k resistors R9, R10, and R11

Here is the schematic

First, install the audio low pass filter that feeds the PWM (Pulse Width Modulation) audio signals into the FM Transceiver module with R9, C4, C2, and R3.

IMG_2976 2

The electrolytic capacitor has polarity - the negative lead (the shorter one in the photo) is marked with a white. The PCB marks the positive side.

IMG_2978

Here is a closeup showing the parts:

IMG_2980

Next, we will install the female sockets U1a and U1b used to mount the Raspberry Pi Pico microcontroller. If your Pico doesn't have the pin headers installed, you will need to solder them in.

IMG_2982

The spacing and alignment of the female sockets is important, otherwise the Pico won't plug in. You can use the Pico itself at right angles to ensure they are spaced correctly and at right angles to the PCB, or you could use the 1x8 pin header from the MPU 6050 board.

IMG_2983

IMG_2984

First solder only one pin on each header and double check to make sure it is installed correctly. Look at it sideways to make sure there is no gap - this photo shows a tiny gap which is fine:

IMG_2986

This photo shows one header fully soldered and the other with only two pins soldered:

IMG_2987

Here is the board with the headers installed ready to plug in the Pico:

IMG_2988

The FM modes can now be tested with the help of the Pi Zero WH with a programmed SD card and the Pico which has been flashed with the software. If you haven't completed these steps, you can find them here: Pi Zero and Pico Software Install Instructions

IMG_2991

Plug the Pi Zero into the bottom of the PCB and the Pico into the top - make sure the micro USB connector is at the edge of the board as shown below. Plug in the powered USB-C power cable and the Red charging LED should illuminate:

IMG_2995

The Green Power LED will illuminate after a few seconds:

IMG_2996

Then the Blue LED will illuminate and go on and off:

IMG_2997

If the Pico is programmed and functioning correctly, it should flash once then twice, then repeat the pattern every few seconds.

Push Button Test

With the Pi plugged into the main board and the power cable plugged into the Pi micro USB port, after booting, the CubeSatSim software will run. When the push button is pressed and held, the green LED should blink rapidly in this sequence: 1 quick blink, 2 quick blinks, 3 quick blinks, 4 quick blinks, 3 slow blinks. Releasing the button after one of the quick blink sequences will put the CubeSatSim in that mode, and the green LED will stop blinking. For example, in this video, the push button is released after the 3 blinks, so the CubeSatSim is in Mode 3. http://countingfromzero.net/amsat/v1/blink.MOV The modes are: 1: APRS, 2: FSK, 3: BPSK, 4: SSTV, 5:CW.

  • When pressed and immediately released, the Pi should reboot after about 30 seconds.
  • When pressed and held until the green LED starts to blink slowly (see above for the LED blink sequence), the green LED will then blink slowly three times, then the Pi will shutdown (the green Power and blue Transmit LEDs will go out, then the tiny green LED on the Pi will flash rapidly for about 10 seconds then go out). You can release the button as soon as the LED starts blinking slowly. This video shows the button shutting down the Pi: http://countingfromzero.net/amsat/v1/shutdown.MOV After the Pi is shutdown (no LEDs are on or blinking), you can safely disconnect the USB power cable and unplug the Pi from the board to continue the build.
  • When the Pi is off, pressing and releasing the push button will startup the Pi, as this video shows: http://countingfromzero.net/amsat/v1/power_up.MOV

If the green Power LED doesn’t blink, there might be a problem with the push button switch S1 or with the pi-power-button software.

If you don't hear anything or see anything for the FM modes (APRS, SSTV, and CW), try listening on 450.000 MHz for the signal. If you hear the signal there, it means the FM Transceiver module hasn't had its frequency set to 434.9 MHz by the Pico. Try powering down the board completely then powering up again.

The rest of the STEM Payload board parts are shown here including the sensors:

IMG_2999

Then mount the two 4.7k resistors (yellow violet red color bands) R1 and R2:

IMG_3001

Mount the BME280 sensor (small purple board) and the MPU6050 Gyro and Accelerometer sensor (larger blue board) with the straight pin headers and female sockets:

IMG_3002

First solder the female sockets, making sure they aren't tilted. Blue putty can be used to hold them in place during soldering:

IMG_3003

Solder one pin on each socket, then double check.

IMG_3004

Here's how they look soldered in:

IMG_3005

Insert the pin headers into the sockets, long pins into the sockets, then place the sensor boards on top. Blue putty can be used to hold them horizontal to the board.

IMG_3006

IMPORTANT: make sure the purple BME280 is not upside down. The top has the BME sensor chip (metal can). The circular hole in the board should be to the left.

IMG_3007

Next, solder these four components on the bottom right of the PCB:

  • A 10k resistor (black brown orange color bands) R11
  • A 100nF capacitor C5
  • A 1N4148 diode D9 (has a glass case with the numbers "41" and "48" written on it and a black band to indicate polarity
  • A 1N5817 diode D7 (black device with a white band on one side to mark polarity)

IMG_3009

Here is a closeup:

IMG_3012

Here is the board with them installed:

IMG_3010

All the diodes, along with all the resistors on the board are mounted vertically. Bend over one lead on the diode and insert, making sure the polarity of the diodes is correct before soldering them.

Solder the leads on the bottom of the PCB.

Then trim the leads, being careful to wear safety glasses and putting your finger over the end so it doesn't go flying.

Install the JST connector for the Battery:

IMG_3016

Here is a closeup showing that the slot should face the edge of the PCB for correct polarity. Some JST connectors snap into the board. If yours do not, then I recommend a drop of super glue gel or other adhesive prior to soldering:

IMG_3020

Here's how it looks installed:

IMG_3017

Then install the green LED1 and 1k Ohm R3 (brown black red color bands). LEDs need to be installed with the correct polarity (one lead is + polarity and the other lead is - polarity) or it will not illuminate. The longer leg on the LED is the '+' lead and should be away from the edge of the PCB. Also, if you look at the LED lens from the top, it is circular but there is a flat side that marks the '-' side. So the flat side of the LED should be towards the edge of the PCB.

The longer lead of the LED is the positive and matches the '+' on the PCB. This LED and the blue one next to it are turned on and off by the microcontroller.

IMG_3021

Then install the blue LED2 and 100 Ohm R4 (brown black brown color bands). The longer lead of the LED is the positive and matches the '+' on the PCB.

IMG_3022

Here are all the resistors and LEDs installed:

IMG_3023

You are now ready to test the board.

8.2 Testing

Video

Here is a video of testing the STEM Payload Board:

Payload Sensor Testing

You can now test that the Raspberry Pi Pico can communicate with the two sensor boards. Your Raspberry Pi Pico should already have the software installed from Step 2. If not, go back to Step 2 and install it.

You will need a Serial Monitor to test the Pico. You could use the one on the Arduino IDE or Putty or the command line.

Open the Serial Monitor by clicking on the magnifier icon in the top right of the window. In the Serial Monitor window, make sure 9600 baud is set in the lower right. Click on the text box at the top and type a ? then click on Send. You should get a response displayed similar to this:

OK BME280 24.89 1003.96 77.61 21.13 MPU6050 -0.85 -2.48 -1.09 0.19 -0.15 1.02 XS 0 0 0.00

The OK is the status response. The four numbers after the BME280 are the temperature in Celsius, pressure in hPa, altitude in meters, and humidity in percentage read from the purple BME280 sensor. The six numbers after the MPU6050 are the X, Y, and Z axis angular rotation in degrees per second and the X, Y, and Z axis acceleration in g. If you get a series of zeros after a sensor, it means it was not successfully read by the Pro Micro. The three numbers after XS are extension sensor fields that you can set in the code by setting the Sensor1, Sensor2, and Sensor 3 variables.

If you get all zeros for a sensor, you need to determine if it is a hardware or software problem. Running an I2C bus scanner program will tell you if the sensor can be accessed on the I2C bus. The program is:

https://github.com/alanbjohnston/CubeSatSim/tree/master/stempayload/i2c_scanner

Upload this to your Pro Micro (or STM32) and then open the Serial Monitor. You should see:

STEM Payload PCB

The blue MPU6050 should be at address 0x68 while the purple BME280 should be at address 0x76. If neither device is present on the I2C bus, make sure resistors R1 and R2 are soldered in and are 4.7k in value. If one sensor shows up but not the other, it might be due to soldering on the sensor pins or due to a bad sensor board.

If both sensors show up on the I2C bus but you get zeros in the Serial Monitor, this indicate a software problem.

Here is the complete STEM Payload Board:

IMG_3026 copy

Complete Payload Test

When the STEM Payload board is plugged into the the three board stack, the Pi will read the sensor data over the UART and report the data in telemetry. When the CubeSatSim software is running, you should see the built-in LED on the Pro Micro or STM32 blink every 4 seconds or so as the Pi reads the telemetry data.

STEM Payload PCB

In APRS (AFSK 1200) mode, the sensor string will be added to the end of the data.

STEM Payload PCB

In FoxTelem, in DUV/FSK mode, under the CubeSatSim-FSK tab Health tab, Experiment box, you should see STEM Payload OK and numbers for the other fields. In addition, the rotation and acceleration will also be displayed under the +X, +Y, and +Z boxes.

STEM Payload PCB

Using the pushbutton, you can switch the CubeSatSim to BPSK mode by pressing and holding the push button until it blinks rapidly three times. Then, if you run FoxTelem in BPSK mode, you can look under the CubeSatSim-BPSK tab and see:

STEM Payload PCB

On the spinning turntable, you should see 7-10 degrees per second of rotation and the blue LED on the STEM Payload board illuminated. If the CubeSatSim is accelerated greater than 1.2g, the green LED will illuminate on the STEM Payload board.

Payload Serial Connection Troubleshooting

If you get the right output from typing a ? the Serial Monitor in the Arduino IDE, but you don't see the payload data in the APRS packet or FoxTelem says STEM Payload FAIL, here are some things you can check.

Login to your Pi and type these commands:

cd

CubeSatSim/log | grep ayload

The use of ayload instead of payload will give you the log entries for Payload and payload.

You can also send commands over the serial port like you did with the Arduino IDE using these commands:

sudo apt-get install -y minicom

sudo systemctl stop cubesatsim

minicom -b 115200 -o -D /dev/serial0

Now, you can type ? or R and you should see the same output you saw in the Arduino Serial Monitor.

To exit, you have to type Control-A then z then x then hit Return.

If you suspect your Pi serial port isn't working, you can unplug your Pro Micro and put a jumper between pins 1 and 2 to make a transmit-to-receive loopback. Now when you run minicom, you should see every character you type echoed back to you.

Additional Sensor Info

The BME-280 Temperature Humidity Barometric Pressure Sensor (small purple board):

https://lastminuteengineers.com/bme280-arduino-tutorial/

Here is some code that displays all the values:

https://github.com/alanbjohnston/CubeSatSim/tree/master/stempayload/bme280test

The MPU-6050 (GY-521) 3-Axis Accelerometer and Gyro (larger blue board with green LED):

https://howtomechatronics.com/tutorials/arduino/arduino-and-mpu6050-accelerometer-and-gyroscope-tutorial/

Here is some code that displays all the values:

https://github.com/alanbjohnston/CubeSatSim/tree/master/stempayload/GetAllData

The next step is to build the Battery board.