Différences entre versions de « ENG-CANSAT-MISSION1-CAPTURE »
Ligne 69 : | Ligne 69 : | ||
=== LEDs and errors === | === LEDs and errors === | ||
+ | Being able to understand rapidly what's happening inside your object is essential to fix the issue. | ||
+ | |||
+ | The best is to figure out what's happening is to use LED, blink status, heartbeat. | ||
+ | |||
+ | By doing so, no need to open a Serial Monitor or diagnostic tool to figure out the status of the objet. | ||
+ | |||
[[Fichier:ENG-CANSAT-MISSION1-CAPTURE-10.png|250px]] | [[Fichier:ENG-CANSAT-MISSION1-CAPTURE-10.png|250px]] | ||
+ | |||
+ | The NeoPixel LED does turn GREEN when the Feather M0 switch on to normal operation (when it runs your Arduino Sketch). | ||
+ | |||
+ | In the following sample, we do take the control over the NeoPixel LED to switch it off at the end of {{fname|setup()}} function. This means that all buses and devices are properly initialized. | ||
+ | |||
+ | The RADIO_LED wired on the Pin 13 is used to signal radio status when emitting a message. | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | | align="center" | LED operation | ||
+ | | align="center" | Description | ||
+ | | align="center" | Fix the issue | ||
+ | |- style="font-size: 90%" | ||
+ | | align="left" | NeoPixel GREEN | ||
+ | | align="left" | The {{fname|setup()}} function did not complete initialization because of a crash. | ||
+ | | align="left" | Check the wiring of sensors. Test each sensor separately (with their tests code). If this not working, remove all sensors except the one you are testing. | ||
+ | |- style="font-size: 90%" | ||
+ | | align="left" | NeoPixel OFF | ||
+ | | align="left" | The {{fname|setup()}} did complete successfully. The main {{fname|loop()}} is not running. | ||
+ | | align="left" | ''Nothing to do here, just check the RADIO_LED for more informations''. | ||
+ | |- style="font-size: 90%" | ||
+ | | align="left" | RADIO LED = 1 pulse | ||
+ | | align="left" | The message has been sent successfully and got an ACK from the receiver. | ||
+ | | align="left" | ''Nothing to do here''. | ||
+ | |} | ||
=== Reading and transmitting data === | === Reading and transmitting data === |
Version du 29 octobre 2018 à 18:43
Introduction
Before starting this point, we recommand to follow all the sensors testing steps (BMP280 sensor, TMP36 Sensor, RFM69HCW radio and 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 transmissing the information via the RFM69HCW radio module.
Wiring
Wire the barometric sensor
The BMP280 is wired on the I2C bus of the Feather.
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 droite) to the ground/GND.
- The pin 2 (middle one) to the A3 analogue input.
Wire the radio module
Finally wire the RFM69HCW radio as follows:
Feather M0 Express | RFM69 |
3V | VIN |
GND | GND |
MO | MOSI |
MI | MISO |
SCK | SCK |
6 | CS |
9 | G0 |
10 | RST |
Testing
Now, we will move forward in several steps.
- Getting data from sensors + send them it over the serial connexion (to confirm good working) + transmit over radio
- Testing the radio reception
- Going autonomous (removing Serial Connexion waiting) + add the Lipo
The code proposed here under has been tested up to 22620128 (22.6 millions) iterations without issue, time where we decided to end the test :-) .
LEDs and errors
Being able to understand rapidly what's happening inside your object is essential to fix the issue.
The best is to figure out what's happening is to use LED, blink status, heartbeat.
By doing so, no need to open a Serial Monitor or diagnostic tool to figure out the status of the objet.
The NeoPixel LED does turn GREEN when the Feather M0 switch on to normal operation (when it runs your Arduino Sketch).
In the following sample, we do take the control over the NeoPixel LED to switch it off at the end of setup() function. This means that all buses and devices are properly initialized.
The RADIO_LED wired on the Pin 13 is used to signal radio status when emitting a message.
LED operation | Description | Fix the issue |
NeoPixel GREEN | The setup() function did not complete initialization because of a crash. | Check the wiring of sensors. Test each sensor separately (with their tests code). If this not working, remove all sensors except the one you are testing. |
NeoPixel OFF | The setup() did complete successfully. The main loop() is not running. | Nothing to do here, just check the RADIO_LED for more informations. |
RADIO LED = 1 pulse | The message has been sent successfully and got an ACK from the receiver. | Nothing to do here. |
Reading and transmitting data
This Arduino sketch would:
- Wait for the serial connexion to be established before starting the sketch
- Collect the sensor data
- Send it to serial connexion
- Send it over the radio connexion
Written by Meurisse D. from MC Hobby - License: CC-SA-BY.