ENG-CANSAT-PICO-MISSION1-CAPTURE
Introduction
Before starting this point, we recommend to follow all the sensors testing steps (BMP280 sensor, TMP36 Sensor, RFM69HCW radio, RFM69HCW Testing). It contains all the details about the wiring, install needed libraries and conduct basic testing. |
The following Wiring is used to capture
- Air temperature
- Air pressure
and transmitting the information via the RFM69HCW radio module.
Wiring on a Pico
Wire the barometric sensor
The BMP280 is wired on the I2C bus of the Pico.
Wire the temperature sensor
Then connect the TMP36 sensor as follows:
- The pin 1 (on the left) to a power source (3.3V),
- The pin 3 (the the right) to the ground/GND.
- The pin 2 (middle one) to the ADC0 (GP26) analog input.
Wire the radio module
Finally wire the RFM69HCW radio as follows:
Here is the description of wiring between the Pico and the RFM69 module.
RFM69HCW | PICO |
---|---|
RST |
GP3 |
CS | GP5 (Slave Select) |
MOSI | GP7 (Miso) |
MISO | GP4 (Mosi) |
SCK | GP6 (Clock) |
GND | GND |
VIN | 3V3 |
Wiring on Kit Cansat for Pico
Wire the barometric sensor
The Kit Cansat avec Pico does already fire a StemmaQt/Qwiic connector. Just connect the Qwiic/StemmaQt wires between the board and the sensor. The Qwiic connector is wired to the I2C(0) bus.
The BMP280 is wired to the Pico via the Qwiic connector.
Wire the temperature sensor
Then connect the TMP36 sensor as follows:
- The pin 1 (on the left) to a power source (3.3V),
- The pin 3 (the the right) to the ground/GND.
- The pin 2 (middle one) to the ADC0 (GP26) analog input.
The Pico pad on the board are large enough to quickly solder the TMP36 on the board. The TMP36 can also bee soldered under the board.
Wire the radio module
The RFM69HCW radio module can be soldered above or below the base board (depending on your needs). |
Finally wire the RFM69HCW radio as follows
RFM69HCW | UEXT pin | PICO | Remark |
---|---|---|---|
RST | GP3 | ||
CS | GP5 | keep the same pin as receiver. Otherwise use UEXT 10 (=gp10) | |
MOSI | 7 | GP4 = MISO | |
MISO | 8 | GP7 = MOSI | |
SCK | 9 | GP6 = SCK | |
GND | 2 | PICO GND | |
VIN | 1 | PICO 3.3V |
Download the code
The code is available for download on the GitHub associated to this wiki.
Without any comments, extra lines and print statement (used to debug), the script makes 33 lines long for the full fledged features.
As showned in the following picture, the intermediate script testing runs for about 80.000 iterations and message sending without an issue.
About testing
Now, we will move forward in several steps.
- Getting data from sensors + send them it over the REPL/Shell connection (to confirm good working) + transmit over radio
- Testing the radio reception
- Going autonomous + add the Lipo
The code proposed here under has been tested up to 80000 iterations without issue, time when we decided to ends the test :-) .
Once the script uploaded to your Pico, open the REPL/Shell over the USB-serial (with Thonny, Putty, MPRemote). The script can be started with import cansat from REPL.
You should see the following messages appears on the Serial Monitor.
Where we could see the transmitted messages with the iteration counter, timing and data.
The ACKnowledgement feature is disabled to avoids latency when waiting ACK message back (which may never comes back in the case of a CanSat in high altitude). |
Written by Meurisse D. for MCHobby