ENG-CANSAT-MISSION1-AUTONOMOUS
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 Connexion Wait"
The serial connexion 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 connexion 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.
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.
This is an estimate. In real life, the current sink by the project is not constant so energy is not sink out constantly from the LiPo. |
Written by Meurisse D. from MC Hobby - License: CC-SA-BY.