ENG-CANSAT-MISSION1-AUTONOMOUS

De MCHobby - Wiki
Aller à : navigation, rechercher

Introduction

Until now, we have worked with the emitter linked to a computer via USB cable.

Using the USB cable was very useful to capture the debugging message into the serial console.

As designed in the code, the Feather wait for the serial connexion to start the software.

This means that you cannot make your object flying into the CanSat without packing the computer together with the feather into the can... GLOUPS!!!

Don't panic, we will solve this in a minute ;-)

Removing the "Serial Connection Wait"

The serial connection is only useful when you need to track the debugging messages send by the Feather.

As we are going autonomous... we do not need to wait for the serial connection to be established.

So locate the following lines inside the setup() function of your "mission1-serial-radio-capture.ino" sketch (the emitter code running inside the CanSat).

void setup() {
  Serial.begin(9600);

  // wait until serial console is open, remove if not tethered to computer
  while (!Serial) { delay(1); } 
 
  ...
}

Then place the while under comment to disable it.

Proceed by placing a // in the front of the while instruction.

When done, the code should look to this:

void setup() {
  Serial.begin(9600);

  // wait until serial console is open, remove if not tethered to computer
  // while (!Serial) { delay(1); } 
 
  ...
}

Compile and upload the modified version to your Feather.

Great! You are ready. The program would now starts without waiting for the Serial Monitor.

Plug the battery

It is now time to plug the Lipo in the appropriate connector.

ENG-CANSAT-MISSION1-AUTONOMOUS.png

When the Feather is plugged via USB:

  • The Feather runs over the USB power.
  • The LiPo battery is loaded from the USB.

When the Feather is unplugged from USB:

  • The Feather is instantaneously powered from the LiPo battery.
  • The LiPo battery is now discharging to power up the Feather.

The feather will run until the battery is discharged.

At best, the battery have 4.2V and discharge until 3.0V (when LiPo the protection circuit shutdown the power.

The time it takes to discharge depend on the power requirement of your LiPo.

If the LiPo can store 2500mAh and a project requiring 130mA to run will last after 2500mAh/130mA = 19 Hour of working.

Conclusion

You should now be able to unplug the Feather from the USB connector then still receive the telemetric data over the air :-)



Written by Meurisse D. from MC Hobby - License: CC-SA-BY.