Daffodil CanSat Final PDF
Daffodil CanSat Final PDF
Daffodil CanSat Final PDF
Submitted By
Supervised By
Our Parents
This is to certify that this project and thesis entitled RESEARCH ON SPACE SCIENCE BY
DEVELOPING DIU CAN-SATELLITE is done by the following students under my direct
supervision and this work has been carried out by them in the laboratories of the Department
of Electrical and Electronic Engineering under the Faculty of Engineering of Daffodil
International University in partial fulfillment of the requirements for the degree of Bachelor of
Science in Electrical and Electronic Engineering. The presentation of the work was held on
December, 2019.
Rafiul Azam
ID: 143-33-2255
Countersigned
BOARD OF EXAMINERS
____________________________
____________________________
Professor
Department of EEE, DIU
____________________________
Professor
Department of EEE, DIU
List of Tables X
List of Abbreviation Xi
Acknowledgment Xii
Abstract Xiii
Chapter 1: INTRODUCTION 01 - 04
1.1 Introduction 01
1.2 Problem Statement 02
1.2.1 Mechanical 02
1.2.2 Electrical 02
1.2.3 Software 03
1.3 Objectives 03
1.4 Scopes 03
1.5 Research Methodology 04
1.6 Project Outline 04
2.1 Introduction 06
2.2 System Overview 06
2.2.1 System 07
2.2.2 Flight Mechanism 07
2.3 Supporting Element 07
2.3.1 Barometer 08
2.3.2 Thermometer 08
2.3.3 GPS Module 08
2.3.4 Camera 08
2.3.5 Accelerometer 08
2.3.6 Electronic Compass 09
2.4 Component List 09
2.5 Summary 10
Page | v
©Daffodil International University
Chapter 3: ANALYSIS AND SIMULATION 11 - 37
3.1 Introduction 11
3.2 Internal Process Analysis 11
3.2.1 Block Diagram 11
3.2.2 Flow Chart 12
3.3 Software Analysis 17
3.3.1 Simulation Circuit 17
3.3.2 Simulation Result 18
3.4 Hardware Analysis 19
3.4.1 Global Positioning System 19
3.4.2 Accelerometer & Gyroscope Sensor (MPU6050) 22
3.4.3 Barometric Pressure and Temperature Sensor (BMP280) 24
3.4.4 NRF 24l01 + PA/LNA 25
3.4.5 Micro-Controller (Atmega328) 28
3.4.6 USB to Serial Converter (CH340) 31
3.5 Schematics Diagram 32
3.5.1 Satellite 32
3.5.2 Ground Station 34
3.6 Cost Analysis 35
3.6.1 Cost Table 35
3.6.2 Cost Summary 36
3.7 Summary 37
4.1 Introduction 38
4.2 PCB Design 38
4.2.1 CanSat PCB 38
4.2.2 Ground Station PCB 39
4.3 PCB Fabrication 40
4.3.1 PCB Print and Etching 40
4.3.2 PCB drilling and Shaping 40
4.3.3 PCB Cleaning and Varnishing 41
4.3.4 PCB soldering and testing 41
4.4 Body Design & Fabrication 41
4.5 Parachute Design & Fabrication 42
4.6 Programmer 42
Page | vi
©Daffodil International University
4.7 Summary 43
5.1 Introduction 44
5.2 Graphical User Interface (GUI) Overview 44
5.3 Results 45
5.3.1 Power OFF 45
5.3.2 Power ON 45
5.3.3 Deploy 46
5.3.4 Falling 46
5.3.5 Landing 47
5.3.6 Landed 47
5.3.7 Data View 48
5.4 Discussion 48
5.5 Summary 49
Chapter 6: CONCLUSION
50 - 62
6.1 Conclusions 50
6.2 Limitations of the Work 50
6.3 Future Scopes of the Work 50
References 51
Appendix A 52
Appendix B 57
Appendix C 60
Appendix D 62
Page | vii
©Daffodil International University
LIST OF FIGURES
Page | viii
©Daffodil International University
4.2.1.1 PCB Design of Control Board 38
4.2.1.2 PCB Design of Sensor Board 39
4.2.1.3 PCB Design of GPS Board 39
4.2.2 PCB Design of Ground Station 40
4.3.2 Printing and Drilling 40
4.3.3 Varnished PCB and Soldering 41
4.3.4 Soldered PCB 41
4.4 Satellite Body 42
4.5 Parachute 42
4.6 Arduino Based Programmer 43
4.7 Complete Circuit Ground Station 43
5.2 Graphical User Interface overview 44
5.3.1 Graph at Power OFF state 45
5.3.2 Graph at Power ON state 46
5.3.3 Graph at Power Deploy state 46
5.3.4 Graph at Power Falling state 47
5.3.5 Graph at Power Landing state 47
5.3.6 Graph at Power Landed state 48
5.3.7 Data View 48
Page | ix
©Daffodil International University
LIST OF TABLES
Page | x
©Daffodil International University
List of Abbreviations
Page | xi
©Daffodil International University
ACKNOWLEDGEMENT
First of all, we give thanks to Allah or God. Then we would like to take this opportunity
to express our appreciation and gratitude to our project and thesis supervisor Sutapa
Debnath, Lecturer of Department of EEE for being dedicated in supporting,
motivating and guiding us through this project. This project can’t be done without his
useful advice and helps. Also thank you very much for giving us opportunity to choose
this project.
We also want to convey our thankfulness to Dr. Engr. Md. Shahid Ullah, Professor
and Head of the Department of EEE for his help, support and constant
encouragement.
Apart from that, we would like to thank our entire friends for sharing knowledge;
information and helping us in making this project a success. Also thanks for lending us
some tools and equipment.
To our beloved family, we want to give them our deepest love and gratitude for being
very supportive and also for their inspiration and encouragement during our studies in
this University.
Page | xii
©Daffodil International University
ABSTRACT
A CanSat is such kind of rocket payload used to study space science and technology.
Our CanSat can measure temperature, barometric pressure, altitude, latitude, longitude,
GPS time, body orientation, mission state and send these data to ground station by
compressing at an update rate of 10 Hz with 2.4 GHz carrier frequency from a
maximum distance of 1100m. At ground station with combination of receiver and
computer software we can visualize all real-time data and store for further analysis.
Page | xiii
©Daffodil International University
CHAPTER 1
INTRODUCTION
1.1 Introduction
The term satellite refers to a device that is capable of rotating around a planet or around
another satellite on a specific orbit. Satellites are divided into two parts; artificial
satellites and natural satellites [1]. This study includes information about experiments
over an artificial satellite which is a special satellite type named CanSat.
A CanSat is a simulation of a real satellite, integrated within the volume and shape of a
soft drink can. The challenge for the students is to fit all the major subsystems found in
Page | 1
©Daffodil International University
a satellite, such as power, sensors and a communication system, into this minimal
volume. The CanSat is then launched to an altitude of a few hundred metres by a rocket
or dropped from a platform or captive balloon and its mission begins: to carry out a
scientific experiment and achieve a safe landing.[3]
1.2.1 Mechanical
CanSat shall fit in a cylindrical envelope (container) of 125 mm diameter x 310 mm
length. The container shall be solid and fully enclose the science payload. Small holes
to allow access to turn on the science payload are allowed. The end of the container
where the payload deploys may be open. The container parachute shall not be enclosed
in the container structure. It shall be external and attached to the container so that it
opens immediately when deployed [4].
1.2.2 Electrical
1.2.1.a Circuitry
All electronic Circuit shall be enclosed and shielded from the environment with the
exception of sensors and all electronics shall be hard mounted using proper mounts such
as standoffs, screws, or high- performance adhesives. All structures shall be built to
survive 30 Gs of shock [4].
1.2.1.b Telemetry
Telemetry shall be updated minimum once per second (1Hz). The ground system shall
command the science vehicle to start transmitting telemetry prior to launch. All
telemetry shall be displayed in real time during descent. All telemetry shall be displayed
in engineering units (meters, meters/sec, Celsius, volts etc). The ground station must
be portable so the team can be positioned at the ground station operation site along the
flight line. AC power will not be available at the ground station operation site [4].
Page | 2
©Daffodil International University
1.2.1.c Power
Battery source may be alkaline, Ni-Cad, Ni-MH or Lithium. Lithium polymer batteries
are not allowed. Lithium cells must be manufactured with a metal package. An easily
accessible battery compartment must be included allowing batteries to be installed or
removed in less than a minute and not require a total disassembly of the CanSat. The
probe must include an easily accessible power switch that can be accessed without
disassembling the cansat and in the stowed configuration. The probe must include a
power indicator such as an LED or sound generating device that can be easily seen
without disassembling the cansat and in the stowed state [4].
1.2.2 Software
Shall plot each telemetry data field in real time during flight. The ground station shall
generate a csv file of all sensor data as specified in the telemetry section [4].
1.3 Objectives
The objectives of this project and thesis are
i. To investigate our capabilities to work on space technology.
ii. To study space technology and space science.
iii. To apply for knowing and doing analysis of our atmosphere environment.
iv. To design for perform to our regional weather and atmosphere.
1.4 Scopes
A rocket can be built to perform study of rocket launching and rocket science. After
deploy our future challenge is to land on a fixed ground area. A heat-shield can be used
to protect science payload and parachute from burning in excessive heat.
It can be used for taking areal photoshoot. Can be also used for finding environmental
pollution at different stage of our atmosphere.
Page | 3
©Daffodil International University
It can be used for study purpose. This is the perfect tools to study environment,
pollution, rocket and space science, couple of physics experiments and theories like
falling object, projectile theories etc.
Fabricating our necessary circuit we make a prototype parachute to run our circuit and
perform some calibration of our sensors and code. Finally we assembled all of our part
together and doing our final run. Confirming our project running we finalize our
correction and make final version of our satellite and ground station.
After that we starting to write both hardware and software program simultaneously so
that we can debug our error easily that confirms fast development of software.
Page | 4
©Daffodil International University
Chapter 3: Analyzes and Simulates the Theoretical Works
This chapter covers the analysis and necessary simulation to build this satellite from
scratch. Mainly analyzed the hardware components considering their performance and
price. Simulation is upon schematics diagram, block diagram and flow chart.
Page | 5
©Daffodil International University
CHAPTER 2
LITERATURE REVIEWS
2.1 Introduction
In 1998, about 50 students and faculties from 12 universities from the United States and
Japan met at a symposium held in Hawaii. It was the first "University Space Systems
Symposium". Here, Bob Twiggs, professor emeritus at the Stanford University,
proposed the initial idea of what later would become the nanosatellite projects.[5] That
idea was to launch a structure of the size of a soda can into space. Its volume should be
around 350 milliliters and the mass, about 500 grams. This led to a project that began
in 1999 called ARLISS, involving mostly American and Japanese Universities,
carrying out the first launch on September, 11th of that year and continuing each year
without interruption [2].
Page | 6
©Daffodil International University
2.2.1 SYSTEM OVERVIEW:
The project is developed in an incremental approach. Firstly, team is established and
gathered in September 2012. After setting up a stable team member list, project is
started in November 2012. Alternative subsystems (sensors, mechanics, etc.) were
determined and first model for satellite has been
2.2.2Flight Mechanism:
At 400 m CanSat splits into two parts which are named container and payload,
respectively. Then, the payload section uses its active descent control system; while the
container section uses its passive descend system for landing. We designed quad–copter
model as the active descend control system. It is used as the triggering mechanism
during the separation and is used as the stabilizing mechanism afterwards, Fig. 2.3. At
400 m servo runs and grabber releases the quad-copter's bar. Then, rubbers which are
used for triggering, helps the bars to overcome their own inertia. Eventually, propellers
start to work, Fig. 4. Chosen materials for flight mechanism and key design
considerations are as follows:
Page | 7
©Daffodil International University
2.3.1 Barometer
It consists of a pressure measuring cell which is connected to the microprocessor and
sends a signal with a voltage value according to the pressure it feels. The
microprocessor uses the standard atmospheric conditions to get the altitude. Example
of barometer used in devices of this type.
2.3.2 Thermometer
The operation it carries out is similar to the barometer but the voltage signal sent to the
microprocessor depends on the temperature measured. The microprocessor interprets
this signal by assigning a temperature value. These are examples of thermometers used.
2.3.4 Camera
A mini camera can be included in the CanSat to photograph anything during the time
the CanSat is descending in the air. Bearing in mind that the CanSat can not receive
orders to operate the camera when the robot is in air so the microprocessor must be the
one that orders the camera to take a picture. This is an example of a camera for CanSat.
2.3.5 Accelerometer
This system is made of one or more accelerometers in different axes. All the
accelerometers aside allow to measure accelerations in coordinated axes.
Accelerometers can be used to collect data or to determine position (by integration).
The best accelerometers made to determine positions are called Inertial Navigation
System INS. These are used on some CanSat models. The uncertainty of this system
depends on the error when calibrating sensors. The pros of this system go from the fact
Page | 8
©Daffodil International University
that GPS is not needed, to immunity to magnetic interference. This allows multiple
locations inside the CanSat. Some of the most used accelerometers are.
(Arduino UNO)
5. NRF24L01L 02 To Communication
6. Gyroscope sensor 01
8. Wires 20 To connection.
Page | 9
©Daffodil International University
2.5 Summary
According to this chapter we realized that all possible features and technology of
CanSat already developed globally. So as a beginner we don’t have unique feature
which can be obtained without doing long time research and low of cost. So we decided
to build a CanSat having some existing common feature for the first time. Then in future
we research for our unique feature or technology.
Page | 10
©Daffodil International University
CHAPTER 3
ANALYSIS AND SIMULATION
3.1 Introduction
Analysis is the most important part of a project. This part defines how fast and how
easily the project will be finished. A good analysis can make a project successful and
alternatively an easy project can be failed for the lack of proper analysis. Analysis can
be performed by both hardware and software. In the hardware section analysis will be
upon components price, accuracy, footprint, compatibility and availability. In software
section analysis will be upon code, power consumption, circuit board size etc.
CanSat
Internal process of CanSat performs in five different stage .At the first stage sensor unit
sense temperature, barometric pressure , GPS time and position coordinate(latitude and
longitude) and battery voltage. Then it sends this data to processing unit.
Processing Unit process this sensed data and makes a compressed binary stream. Then
this data sends to transceiver to transmit at a rate of 10Hz.
Page | 11
©Daffodil International University
Fig 3.2.1: Block Diagram
Transceiver transmits this data through antenna with a carrier frequency of 2.4 GHz and
at 250KBPS data rate.
Ground Station:
Transceiver of ground station receives binary stream transmitted by CanSat through
antenna. Then it sends this binary stream to processing Unit.
Processing Unit stream decompress binary stream to make different data. Then it makes
character string of comma separated value and sends to computer for further process.
Computer uses python to receive this character string and store in the database splitting
this string.
A PHP Graphical User Interface (GUI) shows all data to corresponding graph and chart.
Page | 12
©Daffodil International University
Main loop
At the staring of main loop processor starts to read GPS, sensors and battery voltage.
While reading processor continuously check for ending of read process by checking “If
Read Finished?”. If answer is “NO” then processor goes to checking again. And if
result is “YES” then processor goes further processing.
Conversion Process:
Conversion Process starts with scaling of data. Some raw value need to scale to make
data suitable for use. Some data need to process more than scaling. For calculating
battery voltage from raw value we developed the following equation.
We used voltage divider law to read source voltage with reference voltage 3.3V.Voltage
divider resistance set 4.7k ohms and 15k ohms which provide 3.198V at source voltage
of 4.2V. The equation is
𝑉$%&'(
𝑣= 𝑅𝑒𝑠,-.
𝑅𝑒𝑠,-./( x 𝑉2/(
𝑉345
Where,
𝑣 = source voltage.
𝑉$%&'( = Maximum voltage to be read. In our case this value is 4.2V.
𝑉2/( = Maximum output voltage of Voltage divider. In our case this value is
3.198V.
𝑉345 = ADC reference voltage. In our case this value is 3.33V.
𝑅𝑒𝑠,-. = Sampled ADC value.
𝑅𝑒𝑠,-./( = ADC maximum resolution. For Atmega328p its ADC is 10 bit so
this value will be 1023.
6789:;
In our case <=>?@AB; C DEB; portion is constant.
DF=G
Page | 13
©Daffodil International University
Fig 3.2.2.1: Flow chart of CanSat
Page | 14
©Daffodil International University
Let calculate this constant
𝑉$%&'(
𝐴,-. =
𝑅𝑒𝑠,-./( x 𝑉2/(
𝑉345
I.K6
= LMNO C O.LPQ
O.OO
= 0.004275
So our final equation will be 𝑣 = 𝐴,-. 𝑥 𝑅𝑒𝑠,-.
= 0.004275 𝑥 𝑅𝑒𝑠,-.
After getting all value we need to compress all data because sending large data over air
is risky and our communication module can transmit 32 byte data at once. At this stage
processor compress 56 bytes to 19 bytes and generate a 8 bit (1 byte) separated binary
array of 19 byte. Then processor writes this data to sending pay load.
After finished of data transmit processor go back to main loop. And do this process
continuously.
Main loop
At the staring of main loop processor continuously check for receiving data from
transmitter by checking “If Data Available?”. If answer is “NO” then processor goes
to checking again. And if result is “YES” then processor goes further processing.
Page | 15
©Daffodil International University
Fig 3.2.2.2: Flow chart of Ground Station
Page | 16
©Daffodil International University
Calculation of altitude takes place at this stage. Altitude being calculates from
barometric pressure. For this we used following equation.
`
𝑃 a.Kaa
ℎ = 44330 x Z1 − _
𝑃^
Here,
ℎ = Altitude/ Height from sea level
P = Barometric pressure
𝑃^ = Barometric pressure of sea level
After getting all value we need to make a string of comma separated value so that
python code can separate all data. Then processor sends this string/sentence to computer
via USB.
After finished of data sending processor go back to main loop. And do this process
continuously.
Page | 17
©Daffodil International University
3.3.2 Simulation Result:
For sensor there is an option to manipulate sensor reading. At first, we set pressure to
1013.37 mBar and our reading almost same. Calculated altitude was 0.92m.
Page | 18
©Daffodil International University
For third test we set pressure to 1014.33 mBar and our reading also same. Calculated
altitude was 8.74 m. GPS time, Latitude, longitude and temperature remains same
because in simulation model no option to manipulate this value.
Page | 19
©Daffodil International University
GPS receiver is used in many applications like smartphones, Cabs, Fleet management
etc. [7]
Page | 20
©Daffodil International University
Fig. 3.1.2: GPS Distance Calculation
By subtracting the sent time from the received time, we can determine the travel
time.[7]
Page | 21
©Daffodil International University
3.4.1.d Applications:
• You can locate your stolen vehicle easily using your mobile without any extra
cost.
• It can be used for trucks carrying valuable goods, to keep track of the status of
delivery and location of the truck at all times.
• The device ensures vehicle security and smooth fleet management.
• You can easily install it in any vehicle such as cars, boats and motorbikes. An
SMS will inform you whether the vehicle is stationary or on the move.
• You can also use it to keep tab on your driver. It reduces vehicle abuse and
ultimately results in significant cost-savings for individuals, fleet owners and
the like.
Page | 22
©Daffodil International University
space. The maximum possible is 6 DOF, which would include 3 degrees of translation
(flat) movement across a straight plane/along each axis (front/back, right/left, up/down)
and 3 degrees of rotational movement across the x, y and z axes/about each axis.
The raw data collected from an IMU gives some idea of the world around it, but that
information can also be processed for additional insight.
Page | 23
©Daffodil International University
• Handset and portable gaming
• Motion-based game controllers
• 3D remote controls for Internet connected DTVs and set top boxes, 3D mice
• Wearable sensors for health, fitness and sports
• Toys [8]
Page | 24
©Daffodil International University
result value (pressure or temperature respectively) can be read via the I2C interface.
For calculating temperature in °C and pressure in hPa, the calibration data has to be
used [10].
Page | 25
©Daffodil International University
MCU/ARM/PIC/AVR/STM32 system! What\'s more, this nRF24L01+ module is
designed with Power amplifier and SMA antenna This allowed you to use the wireless
communication up to 1100 meters!
The nRF24L01+ transceiver module is designed to operate in 2.4 GHz worldwide ISM
frequency band and uses GFSK modulation for data transmission. The data transfer rate
can be one of 250kbps, 1Mbps and 2Mbps.
The operating voltage of the module is from 1.9 to 3.6V, but the good news is that the
logic pins are 5-volt tolerant, so we can easily connect it to an Arduino or any 5V logic
microcontroller without using any logic level converter [12].
Page | 26
©Daffodil International University
Fig: 3.4.2 nRF24L01 Multiple Transmitters Single Receiver
3.4.4.d application:
§ Wireless PC Peripherals
§ Mouse, keyboards and remotes
§ 3-in-1 desktop bundles
§ Advanced Media center remote controls
§ Game controllers
§ watches and sensors
§ RF remote controls for consumer electronics
§ Home and commercial automation
§ Ultra-low power sensor networks RFID
Page | 27
©Daffodil International University
§ Asset tracking systems
§ Toys
3.4.5.b Features:
According to datasheet features of this microcontroller is given below.
§ High Performance, Low Power AVR® 8-Bit Microcontroller
§ Advanced RISC Architecture
– 131 Powerful Instructions
– Most Single Clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 20 MIPS Throughput at 20 MHz
– On-chip 2-cycle Multiplier
§ High Endurance Non-volatile Memory Segments
–32K Bytes of In-System Self-Programmable Flash progam memory
–1K Bytes EEPROM
–2K Bytes Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
Page | 28
©Daffodil International University
– Optional Boot Code Section with Independent Lock Bits In-System
Programming by On-chip Boot Program True Read-While-Write Operation
– Programming Lock for Software Security
§ Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and
Capture Mode
– Real Time Counter with Separate Oscillator
– Six PWM Channels
– 8-channel 10-bit ADC in TQFP and QFN/MLF package Temperature
Measurement
– 6-channel 10-bit ADC in PDIP Package Temperature Measurement
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Byte-oriented 2-wire Serial Interface (Philips I2 C compatible)
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator – Interrupt and Wake-up on Pin Change
§ Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated Oscillator
– External and Internal Interrupt Sources
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,
Standby, and Extended Standby
§ I/O and Packages
– 23 Programmable I/O Lines
– 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
§ Operating Voltage: 1.8 - 5.5V
§ Temperature Range: -40°C to 85°C
§ Speed Grade: 0 - 4 MHz @ 1.8 - 5.5V, 0 - 10 MHz @ 2.7 - 5.5V, 0 - 20 MHz
@ 4.5 - 5.5V[13]
§ Arduino Compatible
Page | 29
©Daffodil International University
3.4.5.c Pin Description:
3.4.5.d application:
§ Aerospace and Defense
§ Audio and Speech
§ Automotive
§ Battery Management
§ Computing
§ Display Driver
§ Ethernet
§ Functional Safety
§ Home Appliance
§ Intelligent Power
§ Internet of Things (IoT)
§ Lighting
§ Medical
§ Metering
§ Motor Control and Drive
§ Power Monitoring
§ Security
Page | 30
©Daffodil International University
§ Smart Energy/Metering
§ Smartphone Accessories
§ Touch and Gesture
§ Wireless Connectivity[14]
3.4.6.b Features:
§ Full speed USB device interface, conforms to USB Specification Version 2.0, only
needs crystal and capacitance external.
§ Emulate standard serial interface, used to upgrade the former peripheral device, or add
excess serial interface through USB.
§ Totally compatible with serial application program in computer endpoint Windows
operation system.
§ Hardware full duplex serial interface, set transceiver buffer, supports communication
baud rate varies from 50bps to 2Mbps.
§ Supports common MODEM liaison signal RTS, DTR, DCD, RI, DSR and CTS.
§ Through adding level converter equipment to supply RS232, RS485, RS422 and other
interface.
§ Supports IrDA criterion SIR infrared communication, supports baud rate varies from
2400bps to 115200bps.
§ For it is through USB converts to serial interface, only compatible with application
layer not totally.
§ Software compatible with CH341, using drive of CH341 directly.
§ Support 5V and 3.3V source voltage.
§ Supply SSOP-20 package without lead, compatible with RoHS [15].
Page | 31
©Daffodil International University
3.4.6.c Pin Description:
Page | 32
©Daffodil International University
3.5.1.a Control Board
On control board there are a Microcontroller (Atmega 328P), two voltage regulator chip
(AMS1117 3v3), a voltage divider and some connectors placed. Necessary circuit to
run microcontroller including 16MHz crystal (oscillator), resistor, and capacitor placed
on this board.
Page | 33
©Daffodil International University
3.5.1.c GPS Board
On GPS board GPS antenna and GPS Module (NEO6m) placed with necessary circuit.
Connectors placed for making connection between control board and GPS board
through Sensor Board.
Page | 34
©Daffodil International University
Challenge is to use least component and make Ground Station robust to ensure good
communication; Because of Ground Station should be as small as possible.
3.6.1.a Electrical:
No Component Name Quantity Unit Price Price
9. Load (LED) 10 2 10
10. IC base 1 15 15
11. Antenna 2 100 200
Page | 35
©Daffodil International University
16. Copper Board 2 60 120
Total 5715
3.6.1.b Mechanical:
No Component Name Quantity Unit Price Price
Total 1600
Page | 36
©Daffodil International University
3.5 Summary
After the research we decided to use atmega328 as processing unit,
NRF24l01+PA/LNA for wireless communication, neo 6m for receiving GPS NMEA
sentence, gy521(MPU6050) for 6 axis accelerometer gyroscope and BMP280 to collect
temperature and barometric pressure. Some selected components are cheap an some are
costly. We selected those costly components for better accuracy or don’t have the
suitable alternative.
Page | 37
©Daffodil International University
CHAPPTER 4
HARDWARE DEVELOPMENT
4.1 Introduction
This chapter will be explaining about the hardware development of our project.
Hardware of a CanSat mainly divided into Body, PCB and Parachute. For enclose we
used plastic so that signal can penetrate the enclose wall easily. Development process
is described below.
Fig 4.2.1: PCB design of control Board (a) CAD (b) Bottom (c) Top
4.2.1.a Control Board:
On control board Microcontroller (Atmega 328P), voltage divider resistors, connectors,
ceramic capacitors and crystal (oscillator) placed on top side. Polarized capacitors and
voltage regulator(AMS1117) placed on the bottom side of the PCB board.
Page | 38
©Daffodil International University
4.2.1.b Sensors Board:
On Sensor board all component placed on top side. Connector rail will connects both
Control Board and GPS board
Fig 4.2.3: PCB design of GPS Board (a) CAD (b) Bottom (c) Top
4.2.2 Ground Station PCB:
Ground Station Circuit contains of an Arduino pro mini, a NRF and a USB to serial
chip (CH340).
Page | 39
©Daffodil International University
Fig 4.2.4: PCB design of Ground Station (a)CAD (b) Bottom
Page | 40
©Daffodil International University
4.3.3 PCB Cleaning and Varnishing
We cleaned our PCBs using thinner and paint brush. After cleaning we varnished our
PCB using our home made varnish. This varnish made of 50% of resin and rest of
thinner. Varnish will protect our PCB trace from oxidation.
Fig 4.3.4: (a)Soldering (b) Soldered PCB top (c) Soldered PCB bottom
Page | 41
©Daffodil International University
Fig 4.4: (a)Satellite Body (b)Antenna
We used Hex standoff to hang PCBs on the roof of the CanSat. This ensures our Circuit
to tolerate 30Gs of shock which can be generated by the collision between CanSat and
ground during landing. We used a hook for hook up parachute though we can change
or eject parachute instantly and easily.
4.6 Programmer:
We used Atmega328p microcontroller which is the heart of Arduino UNO, mini, pro
mini, Nano and duo. So, this microcontroller can be program using Arduino IDE. We
used Arduino IDE to write our code. There are a huge number of libraries available for
Page | 42
©Daffodil International University
Arduino Ide. We tried interface all devices without using available libraries in case of
learning those interface methods. After all we used some libraries which technique we
implemented past and which are too time costly.
We have also developed an Arduino based programmer to upload HEX to our circuit.
4.7 Summary
Finally, we got our Hardware; a multi-storied PCB circuit for our satellite and a ground
station. Battery is the main power source. We used Lithium ion (Li-ion) battery cell of
3.75v with the advantage of low weight and low space. USB A type male port of ground
station makes it portable to use anytime, anywhere easily.
Page | 43
©Daffodil International University
CHAPTER 5
RESULTS AND DISCUSSIONS
5.1 Introduction
This chapter will present all the results and calculations and relevant discussions. At
first we will discuss about GUI. Then we will discuss about graph of different stages.
We will also discuss about some key calculations for comparing with generated data by
the satellite.
current 3D orientation of our satellite. For software state here is the index chart,
• 0 : Power OFF
• 1 : Power ON
Page | 44
©Daffodil International University
• 3 : Deploy
• 4 : Travelling
• 5 : Landing
• 6 : Landed
5.3 Results
Results can be obtained in six different stages. Graph of all stages will be different.
Let’s discuss all these stages.
5.3.2 Power ON
Turning satellite ON sends an acknowledgement signal by which ground station can
prepare to receive data. GUI starts to show data from now. Mission time counts from
this acknowledgement signal until mission ends. Time to prepare all systems in deploy
mode. Satellite should rise up to desired height by currier.
Page | 45
©Daffodil International University
Fig 5.3.2: Graph at Power ON state
5.3.3 Deploy
When carrier deploys the satellite then the main mission starts. Satellite transmits a
couple of data to ground station and ground station shows these data to graph. In this
stage software state shows 3 for deploy state.
Page | 46
©Daffodil International University
remains constant because of short time operation don’t use too power to change battery
voltage.
5.3.5 Landing
While landing data will remain as Falling stage but this data is very important to future
analysis.
Page | 47
©Daffodil International University
Fig 5.3.6: Graph at Power Landed state
5.3.7 Data view
All data can be seen in one place by clicking ALL DATA tab. A comma separated value
(CSV) file will generated automatically when click on “ALL DATA” tab. CSV file can
download for further analysis by clicking “Download CSV File”.CSV file look like
this.
5.4 Discussion
Let’s test the accuracy of our satellite data.
We dropped our satellite from 12 storied building so from 11th floor average height will
be 11*15 feet = 165 feet.
We know 1m = 3.280 feet
`la
So j.Kb^ = 50.304878m
Page | 48
©Daffodil International University
According to datasheet neo6M GPS module have a horizontal accuracy 2.5m, BMP280
sensor give the temperature at the accuracy of ±1.0°C and pressure at the accuracy of
±1 hPa. So the working accuracy of our satellite looks good.
By analyzing csv file we found that ground station randomly miss some data. Like
missing one data after received 15 data. Average missing is 1 data per 12 data.
` n `^^
So average communication error is `K
= 8.33%
5.5 Summary
According to above discussion we can decide that this is a good satellite model and this
have a smart working accuracy and a good visual Graphical User Interface (GUI). So
if anyone wants to build a satellite with the similar requirements then he can make this
version without having any hesitation of performance and accuracy.
Page | 49
©Daffodil International University
CHAPTER 6
CONCLUSIONS
6.1 Conclusions
In this project/study a model CanSat, Daffodil Can-Satellite made to fulfill the
requirements. After deploy from twelve floor of new building (AB-4) at DIU permanent
campus all data sent by satellite at a rate of 10Hz. And ground station received this data
at a rate of 9Hz and stored 250 data on database. All of the parts of our satellite look
good after several deploy and crash landing. So it can be commented that our satellite
is made of a good built quality and good organization.
Page | 50
©Daffodil International University
REFERENCES
[1] Larson and Wertz, Space Mission Analysis and Design, Microcosm
Press, 7th Print, 2005.
[2] https://en.wikipedia.org/wiki/CanSat, retrieved on 12 December 2019.
[3] https://www.esa.int/Education/CanSat/What_is_a_CanSat, retrieved on 12 December 2019.
[4] National CanSat Competition Bangladesh 2019 rulebook.
[5] http://www.unisec.jp/history, retrieved on 12 December 2019.
[6] ModelsatellitedesignforCanSatCompetition.pdf
[7] https://www.electronicwings.com/sensors-modules/gps-receiver-module, retrieved on 12
December 2019.
[8] MPU6050 datasheet.pdf
[9] http://static6.arrow.com/aropdfconversion/d896a47a46d02aaf1229b7741c45ac0808246c17/
pgurl_5147218587910400.pdf,
[10] http://wiki.friendlyarm.com/wiki/index.php/Matrix_-_Pressure_and_Temperature_Sensor,
retrieved on 12 December 2019.
[11] BMP280 Datasheet.pdf
[12] https://lastminuteengineers.com/nrf24l01-arduino-wireless-communication, retrieved on 12
December 2019.
[13] Atmega328 Datasheet.pdf
[14] https://www.microchip.com/wwwproducts/en/ATmega328, retrieved on 12 December 2019.
[15] CH340 datasheet.pdf
Page | 51
©Daffodil International University
Appendix A
CANSAT.ino
#include "BMP280.h"
#include "Wire.h"
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <NeoGPS_cfg.h>
#include <ublox/ubxGPS.h>
#include <GPSport.h>
#include <Streamers.h> 53
#define dbg 0
#define P0 1013.25
#define Bpin A0
#define minVal 265
#define maxVal 402
#define MPU_addr 0x68
BMP280 bmp;
RF24 radio(4, 10); // CE, CSN
static ubloxGPS gps( &gpsPort );
static gps_fix fix_data;
uint8_t LastSentenceInInterval = 0xFF; // storage for the run-time selection
uint8_t data[23];
double T,P,A;
int text[5] = {1,2,3,4,5};
uint16_t aX,aY,aZ;
uint32_t btry = 499;
int32_t temp = -5534;
uint32_t pres = 101010;
uint32_t latD = 1010580540;
uint32_t lngD = 303030303;
uint32_t timeD = 404040;
const byte address[6] = "raian";
void setup() {
DEBUG_PORT.begin(9600);
bmp.begin();
bmp.setOversampling(4); 54
initMPU();
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MAX);
// radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
// radio.disableDynamicPayloads();
//radio.setPayloadSize(20);
radio.stopListening();
// Serial.print(" PAlevel:");Serial.print(radio.getPALevel());
//// Serial.print(" AutoACk:");Serial.print(radio.getAutoAck());
// Serial.print(" DataRate:");Serial.print(radio.getDataRate());
Page | 52
©Daffodil International University
// Serial.print(" PayloadSize:");Serial.print(radio.getPayloadSize());
// Serial.println("");
initGPS();
}
void loop() {
readBMP();
readGPS();
readMPU();
btry = readBattery();
compressData();
// if(!dbg) decompressData();
radio.write(&data, 19);
if(dbg) dubug();
delay(90);
}
Functions.ino
void readGPS(){
if (gps.available( gpsPort )) {
fix_data = gps.read();
latD = fix_data.latitudeL();
lngD = fix_data.longitudeL();
timeD = 0;
timeD = fix_data.dateTime.hours*100;
timeD *= 100;
timeD += fix_data.dateTime.minutes*100;
timeD += fix_data.dateTime.seconds;
}
}
void readBMP(){
bmp.startMeasurment();
bmp.getTemperatureAndPressure(T,P);
temp = T*100; pres = P*100;
A = 44330.0*(1-pow(P/P0,1/5.255));
}
uint16_t readBattery(){
// 4.2/((1023/3.33)*3.198) Vin-mx/((Dmx/Vref)*voltage devider gain)
return analogRead(Bpin)*0.4275;
}
void initMPU(){
Wire.beginTransmission(MPU_addr);
Wire.write(0x6B);
Wire.write(0);
Wire.endTransmission(true);
}
void readMPU(){
Page | 53
©Daffodil International University
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
Wire.beginTransmission(MPU_addr);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true);
AcX=Wire.read()<<8|Wire.read();
AcY=Wire.read()<<8|Wire.read();
AcZ=Wire.read()<<8|Wire.read();
int xAng = map(AcX,minVal,maxVal,-90,90);
int yAng = map(AcY,minVal,maxVal,-90,90);
int zAng = map(AcZ,minVal,maxVal,-90,90);
aX= RAD_TO_DEG * (atan2(-yAng, -zAng)+PI);
aY= RAD_TO_DEG * (atan2(-xAng, -zAng)+PI);
aZ= RAD_TO_DEG * (atan2(-yAng, -xAng)+PI);
}
void compressData(){
for(int i =0 ; i<32;i++){data[i] = 0;}
data[0] = btry>>1;
data[1] = ((btry & 0x01) << 7);
if(temp < 0) {
temp *= -1;
data[1] |= (0x40 | (temp >> 8)); } // 01000000 // 1<< 6 ; // msb 6 bit of temp
else data[1] |= temp >> 8; // 10111111 //~(1<< 6); // msb 6 bit of temp
data[2] |= temp & 0xFF; // lsb 8 bit of temp
data[3] |= pres >> 12; // (20 - 13) 8 bit of press
data[4] |= (pres >> 4) & 0xFF; // (12 - 4) 8 bit pf pres
data[5] |= (pres & 0x0F) << 4; // (3 - 0) 4 bit of pres 57
// Serial.print(" latD:");Serial.println(latD,BIN);
data[5] |= (latD >> 26) & 0x0F; // (29- 26) 4 bit of latD
data[6] |= (latD >> 18) & 0xFF; // (25- 18) 8 bit of latD
data[7] |= (latD >> 10) & 0xFF;// (17- 10) 8 bit of latD
data[8] |= (latD >> 2 ) & 0xFF; // (9- 2) 8 bit of latD
data[9] |= (latD & 0x03) << 6 ;// (1- 0) 2 bit of latD
data[9] |= (lngD >> 24) & 0x3F; // (29 - 24) 6 bit of lngD
data[10] |= (lngD >> 16) & 0xFF; // (23 - 16) 8 bit of lngD
data[11] |= (lngD >> 8 ) & 0xFF; // (15 - 8) 8 bit of lngD
data[12] |= lngD ; // (7 - 0) 8 bit of lngD
data[13] |= timeD >> 12; // (19 - 12) 8 bit of timeD
data[14] |= (timeD >> 4) & 0xFF; // (11 - 3) 8 bit of timeD
data[15] |= (timeD << 4) & 0xF0; // (3 - 0) 4 bit of timeD
data[15] |= aX >>5; // (8 - 5) 4 bit of aX
data[16] |= (aX << 3) & 0xF8 ; //(4 - 0) 5 bit of aX
data[16] |= aY >> 6; //Serial.print(" data[16]:");Serial.println(data[16],BIN);//
(8 - 6) 3 bit of aY
data[17] |= (aY << 2) & 0xFC; //Serial.print("
data[16]:");Serial.println(data[17],BIN);//(4 - 0) 6 bit of aY
data[17] |= (aZ >> 7); // (8 - 7) 2 bit of aZ
data[18] |= (aZ << 1); // (6 - 1) 7 bit of aZ
//data[18] |= msb remaining free
}
Page | 54
©Daffodil International University
void dubug(){
DEBUG_PORT.print("Bat:"); DEBUG_PORT.print(btry); 58
DEBUG_PORT.print(" T: ");DEBUG_PORT.print(temp);
DEBUG_PORT.print(" degC");
DEBUG_PORT.print(" P: ");DEBUG_PORT.print(pres);
DEBUG_PORT.print(" mBar");
DEBUG_PORT.print(" A: ");DEBUG_PORT.print(A,2);
DEBUG_PORT.print(" m");
DEBUG_PORT.print(" lat:"); DEBUG_PORT.print(latD);
DEBUG_PORT.print(" lng:"); DEBUG_PORT.print(lngD);
DEBUG_PORT.print(" time:");
DEBUG_PORT.print(fix_data.dateTime.hours);
DEBUG_PORT.print(":"); DEBUG_PORT.print(fix_data.dateTime.minutes);
DEBUG_PORT.print(":"); DEBUG_PORT.print(fix_data.dateTime.seconds);
DEBUG_PORT.print(" time:"); DEBUG_PORT.print(timeD);
DEBUG_PORT.print(" UTC ");
DEBUG_PORT.print(" AngleX:"); DEBUG_PORT.print(aX);
DEBUG_PORT.print(" AngleY:"); DEBUG_PORT.print(aY);
DEBUG_PORT.print(" AngleZ:"); DEBUG_PORT.print(aZ);
DEBUG_PORT.println("");
}
GPS.ino
// U-blox UBX binary commands
const unsigned char ubxRate1Hz[] PROGMEM =
{ 0x06,0x08,0x06,0x00,0xE8,0x03,0x01,0x00,0x01,0x00 };
const unsigned char ubxRate5Hz[] PROGMEM =
{ 0x06,0x08,0x06,0x00,200,0x00,0x01,0x00,0x01,0x00 };
const unsigned char ubxRate10Hz[] PROGMEM =
{ 0x06,0x08,0x06,0x00,100,0x00,0x01,0x00,0x01,0x00 };
const unsigned char ubxRate16Hz[] PROGMEM =
{ 0x06,0x08,0x06,0x00,50,0x00,0x01,0x00,0x01,0x00 };
const char baud9600 [] PROGMEM = "PUBX,41,1,3,3,9600,0"; 59
const char baud38400 [] PROGMEM = "PUBX,41,1,3,3,38400,0";
const char baud57600 [] PROGMEM = "PUBX,41,1,3,3,57600,0";
const char baud115200[] PROGMEM = "PUBX,41,1,3,3,115200,0";
const uint32_t COMMAND_DELAY = 250;
void initGPS(){
LastSentenceInInterval = NMEAGPS::NMEA_GLL;
gpsPort.begin( 9600 );
gpsPort.println("$PUBX,40,RMC,0,0,0,0,0"); //Essential GPS pvt (position,
velocity, time) data
gpsPort.println("$PUBX,40,GLL,0,1,0,0,0"); //Geographic Latitude and
Longitude
gpsPort.println("$PUBX,40,GSV,0,0,0,0,0"); //Detailed GPS satellite
information
gpsPort.println("$PUBX,40,GSA,0,0,0,0,0"); //GPS DOP and active satellites
gpsPort.println("$PUBX,40,GGA,0,0,0,0,0"); //3D location and accuracy data
gpsPort.println("$PUBX,40,VTG,0,0,0,0,0"); //Velocity made good
gpsPort.println("$PUBX,40,ZDA,0,0,0,0,0");
Page | 55
©Daffodil International University
//sendUBX( ubxRate1Hz, sizeof(ubxRate1Hz) );
sendUBX( ubxRate10Hz, sizeof(ubxRate10Hz) );
//sendUBX( ubxRate16Hz, sizeof(ubxRate16Hz) );
}
Page | 56
©Daffodil International University
Appendix B
Ground Station code
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define ledK 4
#define P0 1013.25
#define btn 5 62
#define heightTH 20
#define heightOffset 2
#define heightLangingTH 2
#define landedTH 95
#define landedOffset 20
#define defaultData "B,387,2461,101343,0,0,27,21,39,26,150,0"
enum SoftWareState
{powerOFF,boot,ready2launch,launching,ready2deploy,deploy,landing,landed};
uint8_t ss = powerOFF;
bool led = 1;
uint32_t Dbtry = 0;
int32_t Dtmp = 0;
uint32_t Dpres = 0;
uint32_t DlatD = 0;
uint32_t DlngD = 0;
uint32_t DtimeD = 0,timeD=0;
uint16_t DaX = 0;
uint16_t DaY = 0;
uint16_t DaZ = 00;
uint16_t DgX = 00;
uint16_t DgY = 0;
uint16_t DgZ = 0;
double A = 0;
RF24 radio(A1, 10); // CE, CSN
const byte address[6] = "raian";
uint8_t data[32] = ""; 63
void setup() {
Serial.begin(9600);
Serial.println(defaultData);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_250KBPS);
radio.startListening();
pinMode(ledK,1);
}
void loop() {
if (radio.available()) {
Page | 57
©Daffodil International University
if(ss == powerOFF) ss = boot;
digitalWrite(ledK,led);
led = !led;
//radio.read(&text, sizeof(text));
radio.read(&data, 19);
decompressData();
}
}
void decompressData(){
Dbtry = 0,Dtmp = 0,Dpres = 0,DlatD=0,DlngD=0,DtimeD =
0,DaX=0,DaY=0,DaZ=0;
Dbtry = (data[0]<< 1) | data[1] >> 7;
Dbtry -= 50;
Dtmp = (data[1]& 0x3F) ;
Dtmp = Dtmp << 8;
Dtmp |= data[2] ;
Dtmp -= 500;
if(data[1] & 0x40) Dtmp *= -1;
Dpres = data[3];
Dpres = Dpres << 12 ; //Serial.print(" Dpres:");Serial.println(Dpres,BIN);
Dpres |= data[4] << 4; // Serial.print(" Dpres:");Serial.println(Dpres,BIN);
Dpres |= data[5]>> 4; // Serial.print(" Dpres:");Serial.println(Dpres,BIN);
DlatD = data[5] & 0x0F; DlatD = DlatD << 8;
DlatD |= data[6]; DlatD = DlatD << 8;
DlatD |= data[7]; DlatD = DlatD << 8;
DlatD |= data[8]; DlatD = DlatD << 2;
DlatD |= (data[9] >>6) ;
DlngD = data[9] & 0x3F; DlngD = DlngD << 8;
DlngD |= data[10]; DlngD = DlngD << 8;
DlngD |= data[11]; DlngD = DlngD << 8;
DlngD |= data[12];
DtimeD |= data[13]; DtimeD = DtimeD << 8; 65
DtimeD |= data[14]; DtimeD = DtimeD << 4;
DtimeD |= data[15]>>4;
if(DtimeD<10000) {timeD++; DtimeD= timeD;}
else ss = ready2launch;
DaX |= data[15] & 0x0F; DaX = DaX << 5;
DaX |= data[16]>>3;
DaY |= data[16] & 0x07;
DaY = DaY << 6;
DaY |= data[17] >> 2;//Serial.print(" DaY:");Serial.println(DaY,BIN);
DaZ |= data[17]& 0x03;DaZ = DaZ << 7;
DaZ |= data[18] >> 1;
if(DaY < (landedTH+landedOffset) && DaY > (landedTH-landedOffset)) ss
= landed;
//Dtmp |= data[3] >> 7;
// Serial.print("btry:");Serial.print(Dbtry);
// Serial.print(" Dtmp:");Serial.print(Dtmp);
// Serial.print(" Dpres:");Serial.print(Dpres);
// Serial.print(" DlatD:");Serial.print(DlatD);
Page | 58
©Daffodil International University
// Serial.print(" DlngD:");Serial.print(DlngD);
// Serial.print(" DtimeD:");Serial.print(DtimeD);
// Serial.print(" DaX:");Serial.print(DaX);
// Serial.print(" DaY:");Serial.print(DaY);
// Serial.print(" DaZ:");Serial.print(DaZ);
// Serial.println(" end:");
String toPython = "B,";
toPython += Dbtry;toPython += ","; 66
toPython += Dtmp;toPython += ",";
toPython += Dpres;toPython += ",";
toPython += DlatD;toPython += ",";
toPython += DlngD;toPython += ",";
toPython += DtimeD;toPython += ",";
toPython += DaX;toPython += ",";
toPython += DaY;toPython += ",";
toPython += DaZ;toPython += ",";
double P = double(Dpres)/100;
A = 44330.0*(1-pow(P/P0,0.19029));
if(A<0) A *= -1;
if(A > (heightTH + heightOffset) && ss < ready2deploy) ss = ready2deploy;
else if(A < (heightTH- heightOffset) && ss == ready2deploy) ss = deploy;
else if(A < heightLangingTH && ss == deploy) ss = landing;
toPython += A;toPython += ",";
toPython += ss;//toPython += ",E";
Serial.println(toPython);
}
Page | 59
©Daffodil International University
Appendix C
Python code
import serial
import MySQLdb
import time
bkpData = 0
device = 'COM7'
print "**************************************"
print "**************************************"
print "** welcome to Daffodil CanSatellite **"
print "**************************************"
print "**************************************\n\n"
print "Plese Plug in Ground Station Receiver"
print "If you have already inserted. Then unplug and replug it."
print "waiting for response from Ground Station Receier\n\n"
while 1 :
try:
a=0
arduino = serial.Serial(device)
print "**************************************"
print "**************************************"
print "********* Connected to ",device,"*********"
print "******* starting to read data *******"
print "******* reading data.......... *******"
print "**************************************"
print "**************************************\n\n"
break; 69
except:
a=0
#print " Connected failed to",device
while 1 :
try:
try:
dbConn = MySQLdb.connect("localhost","root","","cansatdb")
or die("db config errror")
cursor = dbConn.cursor()
except:
print "Please run Xampp firs then restart this machine \n\n"
# time.sleep(0.05)
data = arduino.readline()
if bkpData != data :
#print data
x = data.split(',')
#print x
try:
#print 'trying'
begin = x[0] #iii
bVoltage = float(x[1])/100 #vMISSION_TIME
Page | 60
©Daffodil International University
temp = float(x[2])/100 #vALTITUDE
press = float(x[3])/100 #vPRESSUREE
lat = x[4] #vTEMPERATURE
lng = x[5] #vVOLTAGE
Mtime = x[6] #vSS
aX = x[7] #vAIR_SPEED
aY = x[8] #vSOFTWARE_STATE
aZ = x[9] #vUNKNOWN1
altitude = x[10] #vUNKNOWN2
vUNKNOWN3 = 00 70
end = x[11] #fff
sql = "INSERT INTO
cansattable1(MISSION_TIME,ALTITUDE,PRESSUREE,TE
MPERATURE,VOLTAGE,SS,AIR_SPEED,SOFTWARE_ST
ATE,UNKNOWN1,UNKNOWN2,UNKNOWN3)VALUES(%
s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
val = ( bVoltage, temp, press, lat, lng, Mtime, aX, aY, aZ,
altitude, vUNKNOWN3 )
cursor.execute(sql, val)
dbConn.commit()
cursor.close()
#print " \r \n value is: "
except:
a=0
#print "failled fanially"
else :
a=0
#print "else"
bkpData = data
except:
a=0
#print "failled to get data from arduino"
# time.sleep(0.3) ]
Page | 61
©Daffodil International University
Appendix D
PHP Code
GUI code.
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<title>CANSAT GUI</title>
</head>
<style>
/* /!\ You need to add vendor prefixes in order to render the CSS properly (or simply
use http://leaverou.github.io/prefixfree/) /!\ */ #tridiv {
perspective: 800px;
position: absolute;
overflow: hidden;
width: 200px;
height: 200px;
background: transparent;
font-size: 62.5%;
display: inline-block;
float: left;
margin-left: 30px; 73
margin-top: 7px;
border: 1px solid white;
background-color: antiquewhite;
box-shadow: -5px -5px 5px black;
}
.face {
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.scene, .shape, .face, .face-wrapper, .cr {
position: absolute;
transform-style: preserve-3d;
}
.scene {
width: 80em;
height: 80em;
top: 50%;
left: 50%;
margin: -40em 0 0 -40em;
}
.shape {
top: 50%;
left: 50%;
width: 0;
height: 0;
transform-origin: 50%;
Page | 62
©Daffodil International University
}
.face, .face-wrapper {
overflow: hidden;
transform-origin: 0 0;
backface-visibility: hidden; 74
/* hidden by default, prevent blinking and other weird rendering glitchs */
}
.face {
background-size: 100% 100%!important;
background-position: center;
}
.face-wrapper .face {
left: 100%;
width: 100%;
height: 100%
}
.photon-shader {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%
}
.side {
left: 50%;
}
.cr, .cr .side {
height: 100%;
}
[class*="cylinder"] .tp {
transform: rotateX(90deg) translateY(-50%);
}
[class*="cylinder"] .bm {
transform: rotateX(-90deg) translateY(-50%);
} 75
[class*="cylinder"] .tp, [class*="cylinder"] .bm, [class*="cylinder"] .tp .photon-
shader, [class*="cylinder"] .bm .photon-shader {
border-radius: 50%;
}
[class*="cylinder"] .bm {
top: 100%;
}
/* .cyl-1 styles */
.cyl-1 {
transform:translate3D(0em, 0em, 0em) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
opacity:1;
width:10em;
height:11em;
margin:-5.5em 0 0 -5em;
}
Page | 63
©Daffodil International University
.cyl-1 .tp, .cyl-1 .bm {
width:10em;
height:10em;
}
.cyl-1 .side {
width:0.6541466725364976em;
height:11em;
}
.cyl-1 .s0 {
transform: rotateY(3.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s1 {
transform: rotateY(10.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s2 {
transform: rotateY(18deg) translate3D(-50%, 0, 4.975em); 76
}
.cyl-1 .s3 {
transform: rotateY(25.200000000000003deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s4 {
transform: rotateY(32.4deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s5 {
transform: rotateY(39.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s6 {
transform: rotateY(46.800000000000004deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s7 {
transform: rotateY(54deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s8 {
transform: rotateY(61.2deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s9 {
transform: rotateY(68.39999999999999deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s10 {
transform: rotateY(75.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s11 {
transform: rotateY(82.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s12 {
transform: rotateY(90deg) translate3D(-50%, 0, 4.975em);
} 77
.cyl-1 .s13 {
transform: rotateY(97.2deg) translate3D(-50%, 0, 4.975em);
}
Page | 64
©Daffodil International University
.cyl-1 .s14 {
transform: rotateY(104.39999999999999deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s15 {
transform: rotateY(111.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s16 {
transform: rotateY(118.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s17 {
transform: rotateY(126deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s18 {
transform: rotateY(133.2deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s19 {
transform: rotateY(140.4deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s20 {
transform: rotateY(147.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s21 {
transform: rotateY(154.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s22 {
transform: rotateY(162deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s23 { 78
transform: rotateY(169.2deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s24 {
transform: rotateY(176.4deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s25 {
transform: rotateY(183.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s26 {
transform: rotateY(190.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s27 {
transform: rotateY(198deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s28 {
transform: rotateY(205.2deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s29 {
transform: rotateY(212.4deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s30 {
transform: rotateY(219.6deg) translate3D(-50%, 0, 4.975em);
Page | 65
©Daffodil International University
}
.cyl-1 .s31 {
transform: rotateY(226.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s32 {
transform: rotateY(234deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s33 {
transform: rotateY(241.2deg) translate3D(-50%, 0, 4.975em); 79
}
.cyl-1 .s34 {
transform: rotateY(248.4deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s35 {
transform: rotateY(255.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s36 {
transform: rotateY(262.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s37 {
transform: rotateY(270.00000000000006deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s38 {
transform: rotateY(277.20000000000005deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s39 {
transform: rotateY(284.40000000000003deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s40 {
transform: rotateY(291.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s41 {
transform: rotateY(298.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s42 {
transform: rotateY(306.00000000000006deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s43 {
transform: rotateY(313.20000000000005deg) translate3D(-50%, 0, 4.975em);
} 80
.cyl-1 .s44 {
transform: rotateY(320.40000000000003deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s45 {
transform: rotateY(327.6deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s46 {
transform: rotateY(334.8deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s47 {
Page | 66
©Daffodil International University
transform: rotateY(342.00000000000006deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s48 {
transform: rotateY(349.20000000000005deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .s49 {
transform: rotateY(356.40000000000003deg) translate3D(-50%, 0, 4.975em);
}
.cyl-1 .face, .cyl-1 .side {
background-color:white;
}
.cyl-1 .tp {
background-color:wheat;
}
.cyl-1 .bm {
background-color:wheat;
}
.cyl-1 .side {
background-color:white;
} 81
.containerclass{
width: 320px;
display: inline-block;
height: 300px;
box-shadow: -3px -3px 3px white;
}
#container6{
width: 1060px;
height: 210px;
display: inline-block;
margin-top: 7px;
margin-left: 9px; 82
}
#container2{
margin-left: 9px;
}
.qlink{
color: red;
background-color: black;
text-decoration: none;
padding: 10px;
border-radius: 25px;
}
.qlink:hover{
color: black;
background-color: red;
text-decoration: none; 83
}
#navbar2{
background-color: white;
Page | 67
©Daffodil International University
color: black;
text-shadow: 2px 2px 2px green;
text-align: center;
padding: 5px;
margin-bottom: 10px;
font-size: 32px;
}
.thgebody{
display: block;
width: 98%;
margin: 0 auto;
background-color:darkcyan;
padding: 5px;
}
.ttttttttt{ 84
background-color: black;
color: white;
text-decoration: none;
display: inline-block;
width: 640px;
margin: 0 auto;
padding: 5px;
text-align: center;
}
.ttttttttt:hover{
color: black;
background-color: white;
}
</style>
<body>
<div class="thgebody">
<div id="navbar2">
DAFFODILS MINI SAT GUI OVERVIEW
<br>
</div> 85
<div class="containerclass" id="container2"></div>
<div class="containerclass" id="container3"></div>
<div class="containerclass" id="container4"></div>
<div class="containerclass" id="container5"></div>
<a class="ttttttttt" href="csv.php">ALL DATA</a>
<a class="ttttttttt" href="del.php">DELTE ALL DATA</a>
<div class="containerclass" id="container6"></div>
<div id="tridiv">
<div style="color:green; font-weight:bold; text-align:center; padding:3px;">
ORIENTATION</div>
<div class="scene" style="-webkit-transform:rotateX(179deg) rotateY(1360deg); -
moz-transform:rotateX(179deg) rotateY(1360deg); -ms-transform:rotateX(179deg)
rotateY(1360deg); transform:rotateX(179deg) rotateY(1360deg); ">
<div class="shape cylinder-1 cyl-1">
<div class="face bm">
Page | 68
©Daffodil International University
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.35);"></div>
</div>
<div class="face tp">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.35);"></div>
</div>
<div class="face side s0"> 86
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.37);"></div>
</div>
<div class="face side s1">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.404);"></div>
</div>
<div class="face side s2">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.44);"></div>
</div>
<div class="face side s3">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.475);"></div>
</div>
<div class="face side s4">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.514);"></div>
</div>
<div class="face side s5">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.55);"></div>
</div>
<div class="face side s6">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.584);"></div>
</div>
<div class="face side s7">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.62);"></div>
</div>
<div class="face side s8"> 87
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.655);"></div>
</div>
<div class="face side s9">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.69);"></div>
</div>
<div class="face side s10">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.725);"></div>
</div>
<div class="face side s11">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.733);"></div>
</div>
<div class="face side s12">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.35);"></div>
</div>
<div class="face side s13">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.663);"></div>
</div>
<div class="face side s14">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.627);"></div>
</div>
Page | 69
©Daffodil International University
<div class="face side s15">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.592);"></div>
</div>
<div class="face side s16"> 88
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.557);"></div>
</div>
<div class="face side s17">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.52);"></div>
</div>
<div class="face side s18">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.482);"></div>
</div>
<div class="face side s19">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.447);"></div>
</div>
<div class="face side s20">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.41);"></div>
</div>
<div class="face side s21">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.376);"></div>
</div>
<div class="face side s22">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.34);"></div>
</div>
<div class="face side s23">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.306);"></div>
</div>
<div class="face side s24"> 89
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.267);"></div>
</div>
<div class="face side s25">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.23);"></div>
</div>
<div class="face side s26">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.196);"></div>
</div>
<div class="face side s27">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.16);"></div>
</div>
<div class="face side s28">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.125);"></div>
</div>
<div class="face side s29">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.086);"></div>
</div>
<div class="face side s30">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.05);"></div>
</div>
<div class="face side s31">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.016);"></div>
Page | 70
©Daffodil International University
</div>
<div class="face side s32"> 90
<div class="photon-shader" style="background-color: rgba(255, 255, 255,
0.02);"></div>
</div>
<div class="face side s33">
<div class="photon-shader" style="background-color: rgba(255, 255, 255,
0.055);"></div>
</div>
<div class="face side s34">
<div class="photon-shader" style="background-color: rgba(255, 255, 255,
0.09);"></div>
</div>
<div class="face side s35">
<div class="photon-shader" style="background-color: rgba(255, 255, 255,
0.125);"></div>
</div>
<div class="face side s36">
<div class="photon-shader" style="background-color: rgba(255, 255, 255,
0.133);"></div>
</div>
<div class="face side s37">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.35);"></div>
</div>
<div class="face side s38">
<div class="photon-shader" style="background-color: rgba(255, 255, 255,
0.063);"></div>
</div>
<div class="face side s39">
<div class="photon-shader" style="background-color: rgba(255, 255, 255,
0.027);"></div>
</div>
<div class="face side s40"> 91
Page | 71
©Daffodil International University
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.008);"></div>
</div>
<div class="face side s41">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.043);"></div>
</div>
<div class="face side s42">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.08);"></div>
</div>
<div class="face side s43">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.118);"></div>
</div>
<div class="face side s44">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.153);"></div>
</div>
<div class="face side s45">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.19);"></div>
</div>
<div class="face side s46">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.224);"></div>
</div>
<div class="face side s47">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.26);"></div>
</div>
<div class="face side s48"> 92
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.294);"></div>
</div>
<div class="face side s49">
<div class="photon-shader" style="background-color: rgba(0, 0, 0, 0.333);"></div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script> 93
function callgyroacce(){
$.ajax({
url: "gyroacce.php",
success: function(resultgyroacce){
GAarray = resultgyroacce.split(' + ');
//console.log(GAarray);
dx = Number(GAarray[0]);
dy = Number(GAarray[1]);
dz = Number(GAarray[2]);
//console.log(dx);console.log(dy);console.log(dz); 94
//exp
$(".scene").css("transform", "rotateX("+dx+"deg) rotateY("+dy+"deg)
rotateZ("+dz+"deg)");
}})
}
Page | 72
©Daffodil International University
setInterval(callgyroacce, 1);
//222///////// 95
function xxx2(){
$.ajax({
url: 'getajax.php',
success: function(data1){
//console.log(data1);
NewArray = data1.split("+"); //dont touch
eee1 = NewArray[5].split(" "); //dont touch
eee2 = NewArray[0].split(" ");
//dont touch
filtered_eee1 = eee1.filter(function (el1) { return el1 != ""; });
filtered_eee1_N = filtered_eee1.map(function(item1) { return parseFloat(item1, 10);
});
filtered_eee1_N.reverse();
maxx = filtered_eee1_N.length;
/*console.log(eee1);
console.log(filtered_eee1);
console.log(filtered_eee1_N);
*/
filtered_eee2 = eee2.filter(function (el2) { return el2 != ""; });
filtered_eee2_N = filtered_eee2.map(function(item2) { return parseFloat(item2, 10);
});
filtered_eee2_N.reverse(); 96
//console.log(filtered_eee2_N);
//console.log(filtered_eee2_N);
maxxy2 = Math.max.apply(Math,filtered_eee2_N);
minxy2 = Math.min.apply(Math,filtered_eee2_N);
//console.log(minxy2);
$('#container2').highcharts({
chart: {backgroundColor: "black",type:"line",},
plotOptions: {
series: {
animation: false,
dataLabels: {color:'white',enabled: false,borderWidth: 1,borderColor: 'white',},
pointPadding: 0,
groupPadding: 0,
},
},
legend: {
align: 'left',
verticalAlign: 'top',
layout: 'vertical',
x: 0,
y: 20, 97
itemMarginTop: 10,
itemMarginBottom: 10, },
title: {
text: 'BATTERY',
style: {
Page | 73
©Daffodil International University
color: 'white'}
},
xAxis: [{
width:200,
title: { text: 'GPS Time(HHMMSS)'},
categories: filtered_eee1_N,
lineColor: 'white',
labels:{ style:{color: 'red', },
},
}],
yAxis: [{
title: { text: '',rotation : 0,},
labels:{ 98
style:{color: 'white'},
},
min: 3.5,
max: 4.5,
tickInterval:1,
tickwidth : 10,
lineColor: 'green',
lineWidth: 1,
}],
series: [ {data: filtered_eee2_N, color: 'blue', name: "" } ]
}); } }); }
xxx2(); setInterval(xxx2, 50);
///33///////////
function xxx3(){
$.ajax({
url: 'getajax.php',
success: function(data1){
NewArray = data1.split("+"); //dont touch
eee1 = NewArray[5].split(" "); //dont touch 99
eee3 = NewArray[1].split(" ");
//dont touch
filtered_eee1 = eee1.filter(function (el1) { return el1 != ""; });
filtered_eee1_N = filtered_eee1.map(function(item1) { return parseFloat(item1, 10);
});
filtered_eee1_N.reverse();
maxx = filtered_eee1_N.length;
filtered_eee3 = eee3.filter(function (el3) { return el3 != ""; });
filtered_eee3_N = filtered_eee3.map(function(item3) { return parseFloat(item3, 10);
});
filtered_eee3_N.reverse();
maxxy3 = Math.max.apply(Math,filtered_eee3_N);
minxy3 = Math.min.apply(Math,filtered_eee3_N);
$('#container3').highcharts({
chart: {backgroundColor: "black",type:"line",},
plotOptions: {
series: {
animation: false,
Page | 74
©Daffodil International University
dataLabels: {color:'white',enabled: false,borderWidth: 1,borderColor: 'white',} }
}, 100
legend: {
align: 'left',
verticalAlign: 'top',
layout: 'vertical',
x: 0,
y: 20,
itemMarginTop: 10,
itemMarginBottom: 10, },
title: {
text: 'TEMPERATURE',
style: {
color: 'white'}
},
xAxis: {
width:200,
title: { text: 'GPS Time(HHMMSS)'},
categories: filtered_eee1_N,
lineColor: 'white',
labels:{ style:{color: 'red' } },
},
yAxis: [{ 101
title: { text: '',rotation : 0,},
labels:{style:{color: 'white'}
},
min: minxy3,
max: maxxy3,
tickInterval:5,
tickwidth : 15,
lineColor: 'green',
lineWidth: 1,
}],
series: [ {data: filtered_eee3_N, color: 'blue', name: "" } ]
}); } }); }
xxx3(); setInterval(xxx3, 50);
/////4//
function xxx4(){
$.ajax({
url: 'getajax.php',
success: function(data1){
NewArray = data1.split("+"); //dont touch
eee1 = NewArray[5].split(" "); //dont touch
eee4 = NewArray[2].split(" "); 102
//dont touch
filtered_eee1 = eee1.filter(function (el1) { return el1 != ""; });
filtered_eee1_N = filtered_eee1.map(function(item1) { return parseFloat(item1, 10);
});
filtered_eee1_N.reverse();
maxx = filtered_eee1_N.length;
Page | 75
©Daffodil International University
filtered_eee4 = eee4.filter(function (el4) { return el4 != ""; });
filtered_eee4_N = filtered_eee4.map(function(item4) { return parseFloat(item4, 10);
});
filtered_eee4_N.reverse();
maxxy4 = Math.max.apply(Math,filtered_eee4_N);
minxy4 = Math.min.apply(Math,filtered_eee4_N);
$('#container4').highcharts({
chart: {backgroundColor: "black",type:"line",},
plotOptions: {
series: {
animation: false,
dataLabels: {color:'white',enabled: false,borderWidth: 1,borderColor: 'white',} }
},
legend: { 103
align: 'left',
verticalAlign: 'top',
layout: 'vertical',
x: 0,
y: 20,
itemMarginTop: 10,
itemMarginBottom: 10, },
title: {
text: 'B PRESSURE',
style: {
color: 'white'}
},
xAxis: {
width:200,
title: { text: 'GPS Time(HHMMSS)'},
categories: filtered_eee1_N,
lineColor: 'white',
labels:{ style:{color: 'red' } },
},
yAxis: [{
title: { text: '',rotation : 0,}, 104
labels:{style:{color: 'white'}
},
min: minxy4,
max: maxxy4,
tickInterval:5,
tickwidth : 15,
lineColor: 'green',
lineWidth: 1,
}],
series: [ {data: filtered_eee4_N, color: 'blue', name: "" } ]
}); } }); }
xxx4(); setInterval(xxx4, 50);
///5////
function xxx5(){ 105
$.ajax({
Page | 76
©Daffodil International University
url: 'getajax.php',
success: function(data1){
NewArray = data1.split("+"); //dont touch
eee1 = NewArray[5].split(" "); //dont touch
eee5 = NewArray[9].split(" ");
//dont touch
filtered_eee1 = eee1.filter(function (el1) { return el1 != ""; });
filtered_eee1_N = filtered_eee1.map(function(item1) { return parseFloat(item1, 10);
});
filtered_eee1_N.reverse();
maxx = filtered_eee1_N.length;
filtered_eee5 = eee5.filter(function (el5) { return el5 != ""; });
filtered_eee5_N = filtered_eee5.map(function(item5) { return parseFloat(item5, 10);
});
filtered_eee5_N.reverse();
maxxy5 = Math.max.apply(Math,filtered_eee5_N);
minxy5 = Math.min.apply(Math,filtered_eee5_N);
$('#container5').highcharts({
chart: {backgroundColor: "black",type:"line",}, 106
plotOptions: {
series: {
animation: false,
dataLabels: {color:'white',enabled: false,borderWidth: 1,borderColor: 'white',} }
},
legend: {
align: 'left',
verticalAlign: 'top',
layout: 'vertical',
x: 0,
y: 20,
itemMarginTop: 10,
itemMarginBottom: 10, },
title: {
text: 'HEIGHT',
style: {
color: 'white'}
},
xAxis: {
width:200,
title: { text: 'GPS Time(HHMMSS)'}, 107
categories: filtered_eee1_N,
lineColor: 'white',
labels:{ style:{color: 'red' } },
},
yAxis: [{
title: { text: '',rotation : 0,},
labels:{style:{color: 'white'}
},
min: minxy5,
max: maxxy5,
Page | 77
©Daffodil International University
tickInterval:5,
tickwidth : 15,
lineColor: 'green',
lineWidth: 1,
}],
series: [ {data: filtered_eee5_N, color: 'blue', name: "" } ]
}); } }); }
xxx5(); setInterval(xxx5, 50);
///6/// 108
function xxx6(){
$.ajax({
url: 'ssajax.php',
success: function(data1){
NewArray = data1.split("+"); //dont touch
eee1 = NewArray[5].split(" "); //dont touch
eee6 = NewArray[10].split(" ");
//dont touch
filtered_eee1 = eee1.filter(function (el1) { return el1 != ""; });
filtered_eee1_N = filtered_eee1.map(function(item1) { return parseFloat(item1, 10);
});
filtered_eee1_N.reverse();
maxx = filtered_eee1_N.length;
filtered_eee6 = eee6.filter(function (el6) { return el6 != ""; });
filtered_eee6_N = filtered_eee6.map(function(item6) { return parseFloat(item6, 10);
});
filtered_eee6_N.reverse(); 109
maxxy6 = Math.max.apply(Math,filtered_eee6_N);
minxy6 = Math.min.apply(Math,filtered_eee6_N);
$('#container6').highcharts({
chart: {backgroundColor: "black",type:"line",},
plotOptions: {
series: {
animation: false,
dataLabels: {color:'white',enabled: false,borderWidth: 1,borderColor: 'white',} }
},
legend: {
itemStyle: {
color: 'white'
},
align: 'left',
verticalAlign: 'top',
layout: 'vertical',
x: 0,
y: 20,
itemMarginTop: 10,
itemMarginBottom: 10, }, 110
title: {
text: 'Software State',
style: {
Page | 78
©Daffodil International University
color: 'white'}
},
xAxis: {
title: { text: 'GPS Time(HHMMSS)'},
categories: filtered_eee1_N,
lineColor: 'white',
labels:{ style:{color: 'red' } },
},
yAxis: [{
title: { text: '',rotation : 0,},
labels:{style:{color: 'white'}
},
min: 0,
max: maxxy6,
tickInterval:1,
tickwidth : 1, 111
lineColor: 'green',
lineWidth: 1,
}],
series: [ {data: filtered_eee6_N, color: 'blue', name: "0 = POWER OFF<br> 1= IDLE
<br> 2= LAUNCH <br> 3 = STABLE <br> 4 = DEPLOY <br> 5=LANDING <br> 6
= TX COM" } ]
}); } }); }
xxx6(); setInterval(xxx6, 200);
</script>
</div>
</body>
</html>
Page | 79
©Daffodil International University