Professional Documents
Culture Documents
Data Transmitter/Receiver
Abstract
1 Introduction
This project was intended to take data from a remote sensor station, such
as the one on board on airplanes, and process this data form determining
flight conditions of the plane, such as its attitude, altitude, velocity and
other aircraft parameters. Despite our original intentions, we had two main
problems in the developing of our project:
1
to make) was a lot more expensive than what we initially expected
(the whole station costs are around 200). Our solution was to reduce
the number of sensors and, as a consequence, the quantity of data to
be processed.
1.1 Objective
The objective of this is to receive data from remote sensors, so the computer
can use this data to study, for example, weather conditions where the sen-
sors are placed. If sensors were on different parts of a plane, remote sensor
communication would allow to have less physical connections, so that the
central computer of the plane could retrieve data from sensors and modify
different parameters of the plane in order to adapt its flight regime to exter-
nal conditions, such as angle of attack, spoilers deflections, speed, or simply
study passively weather evolution for preventing some potential dangerous
situations, such as crossed wind, which can cause difficulties in the aircraft
operations.
2
using supporting software (such as MATLAB), and analyze this data to
accurately determine what is really going on in the aircraft. Then, we would
be able to build automatic controlling algorithms so that we would transmit
back to the aircraft the instructions to regulate the aircraft behavioral in
front of perturbations.
2 Materials
The materials used for this project are summarized in the following table:
3
data from external devices or from a computer through USB connection.
4
connecting more devices to Arduino board, which is the main reason why
it is needed in this project: there has to be connected to Arduino the tem-
perature sensor, and also the emitter/receiver module, which has to have
attached also an antenna. All this connections are well managed with pro-
totype shield v5.
This receiver, calibrated specifically for receive analogic signals in the band
of 433 MHz, transforms electric and magnetic fields emitted by its reciprocal
5
Figure 3: Transmitter module, CDT-88
in the other Arduino board into electrical signals that can be read and
interpreted by Arduino.
6
Figure 5: Temperature sensor, TMP36
3 Hardware connections
The project is composed by two different main parts: the transmitter mod-
ule and the receiver module. Their description, also with their connection
diagrams, are handled below.
7
Figure 6: Connection scheme of components for the transmitter device
• Brown wires: Connection between the antenna and the other com-
ponents.
8
Figure 7: Electrical connection scheme for the transmitter device
9
a R03A, very similar to the WRL 8947, more commonly used in Arduino
radio-frequency applications.
• Brown wires: Connection between the antenna and the other com-
ponents.
10
Figure 9: Electrical connection scheme for the receiver device
11
4 Device operation
As it is physically separated in two parts, the whole device operation has also
to be separated in two distinguishable parts: the emitter and the receiver.
4.1 Transmitter
The TMP36 temperature sensor takes lecture of the temperature of air sur-
rounding it and sends this data through the wires, which are connected to
analog input pin 12 of Arduino board. The Arduino takes this data and
reroutes it through the pin 13, which is connected to the data pin of the RF
emitter. Once the data has arrived to the emitter, it is sent through the
antenna in a wave which theoretical range is 40 m (the practical one has
been measured in a 20 m range wave).
4.2 Receiver
The receiver module has attached the R03A, which has an inside-build an-
tenna for receiving the 433 MHz band, in which the emitter sends the infor-
mation of the TMP36 sensor. Once the antenna receives the information, it
is sent through the pin 13 to the Arduino, and then the signal is decoded in
the Arduino board, and sent to the computer through the USB port.
4.3 Computer
Once the computer gets the information from the Arduino receiver board, it
sends it to MATLAB, which does a real-time plot of the data received, and
also it calculates the altitude at which the aircraft (in case it was on it) is
as described by ISA equations in real time. At the same time it does these
two tasks, it also stores the received data for its further processing (if some
other calculations have to be made). (Figure 10)
12
Figure 10: Screenshot of real-time temperature plotting with Matlab
13
5 Software
5.1 Transmitter
1 #i n c l u d e <V i r t u a l W i r e . h> // | RF t r a n s m i t t e r l i b r a r y
2 void setup ( ) { // |
3 S e r i a l . begin (9600) ; // |
4 pinMode ( 1 3 ,OUTPUT) ; // | Port 1 3 , LED t o c h e c k
5 // | data t r a n s m i s s i o n
6 pinMode ( 1 ,INPUT) ; // | Analog i n p u t 1 ,
7 // | TMP36 a n a l o g data p i n
8 vw set ptt inverted ( true ) ; // |
9 vw set tx pin (12) ; // | E m i t t e r d i g i t a l data p i n
10 vw setup (4000) ; // | Data t r a n s f e r v e l o c i t y ( bps )
11 } // |
12 void loop ( ) { // |
13 i n t Temp=( analogRead ( 1 ) −105) ∗27/(156 −105) ; // | Zero a d j u s t m e n t
14 // | ( 1 0 5 −−> 0 C ; 156 −−> 27 C )
15 char S i g n a l [ 2 4 ] ; // | V a r i a b l e which c o n t e n t w i l l
16 // | be s e n t t h r o u g h t h e antenna
17 s p r i n t f ( S i g n a l , ”%i ” ,Temp) ; // | Variable f i l l i n g
18 vw send ( ( u i n t 8 t ∗ ) S i g n a l , s t r l e n ( S i g n a l ) ) ; // | Variable content sending
19 S e r i a l . p r i n t ( ” Temperature : ” ) ; // | Comprovation o f data s e n t
20 // | v i s u a l i z i n g i t by t h e
21 Serial . print ( Signal ) ; // | Serial console
22 S e r i a l . p r i n t ( ” C” ) ; // |
23 Serial . println () ; // |
24 vw wait tx () ; // | Pause f o r l e t t i n g t h e e m i t t e r
25 // | complete the t r a n s m i s s i o n
26 digitalWrite (13 ,1) ; // | Turn on LED on p o r t 13 f o r
27 // | c h e c k i n g data t r a n s m i s s i o n
28 delay (10) ; // |
29 } // |
5.2 Receiver
1
2 #i n c l u d e <V i r t u a l W i r e . h> // | RF r e c e i v e r l i b r a r y
3 i n t num [ 2 ] ; // |
4 i n t num int ; // |
5 i n t num int ant ; // |
6 i n t rang =3; // |
7 void setup ( ) { // |
14
8 S e r i a l . begin (9600) ; // |
9 vw set ptt inverted ( true ) ; // | R e q u i r e d f o r DR3100
10 vw set rx pin (12) ; // | R e c e i v e r d i g i t a l data p i n
11 vw setup (4000) ; // | Data t r a n s f e r v e l o c i t y ( bps )
12 pinMode ( 1 3 , OUTPUT) ; // | Port 1 3 , LED t o c h e c k data r e c e p t i o n
13 vw rx start () ; // | S t a r t t h e r e c e i v e r PLL r u n n i n g
14 } // |
15 void loop ( ) { // |
16 n u m i n t a n t=num int ; // | Storage of previous reception
17 u i n t 8 t b u f [VW MAX MESSAGE LEN ] ; // | Declaration of buffer variable
18 u i n t 8 t b u f l e n=VW MAX MESSAGE LEN; // | Maximum l e n g t h o f b u f f e r v a r i a b l e
19 i f ( v w g e t m e s s a g e ( buf ,& b u f l e n ) ) { // | Comprovation o f data r e c e p t i o n
20 f o r ( i n t i =0; i <b u f l e n ; i ++){ // |
21 num [ i ]= i n t ( b u f [ i ] ) ; // | S t o r a g e o f data r e c e i v e d on t h e
22 } // | buffer variable
23 num int =10∗num[ 0 ] +num [ 1 ] ; // | Union o f data r e c e i v e d i n a
24 i f ( abs ( num int−n u m i n t a n t )<rang ) { // | single variable
25 f o r ( i n t i =0; i <b u f l e n ; i ++){ // |
26 S e r i a l . p r i n t ( char ( buf [ i ] ) ) ; // | T r a n s m i s s i o n o f data v a r i a b l e t o
27 } // | S e r i a l Console
28 Serial . println () ; // |
29 } // |
30 } // |
31 delay (100) ; // |
32 } // |
5.3 Computer
The function of the computer is to read the data sent by the receiver and
plot a real-time graph of the sensor values located on the Transmitter.
This is being done by using a MATLAB script which gets the string
data in the serial port of the computer connected to the Receiver by USB.
1 clear all ; close all ; clc ;
2 numSec =5000;
3 t =[];
4 v=[];
5
6 %s 1 = s e r i a l ( ’ / dev / cu . usbmodem411 ’ ) ; % define s e r i a l port
7 s 1 = s e r i a l ( ’COM8 ’ ) ;
8 s 1 . BaudRate =9600; % d e f i n e baud r a t e
9 s e t ( s1 , ’ t e r m i n a t o r ’ , ’LF ’ ) ; % d e f i n e the terminator f o r p r i n t l n
15
10 fopen ( s1 ) ;
11
12 try % use try catch to ensure f c l o s e
13 % s i g n a l the arduino to s t a r t c o l l e c t i o n
14 w=f s c a n f ( s1 , ’%s ’ ) ; % must d e f i n e t h e i n p u t % d o r %s , e t c .
15 i f (w== ’A ’ )
16 d i s p l a y ( [ ’ C o l l e c t i n g data ’ ] ) ;
17 f p r i n t f ( s1 , ’%s \n ’ , ’A ’ ) ; % e s t a b l i s h C o n t a c t j u s t wants
18 % something in the b u f f e r
19 end
20
21 i =0;
22 t 0=t i c ;
23 w h i l e ( i <numSec )
24 i f ( ˜ i s n a n ( f s c a n f ( s1 , ’%d ’ ) ) )
25 i = i +1;
26
27 t ( i )=t o c ( t 0 ) ;
28 t ( i )=t ( i )−t ( 1 ) ;
29 v ( i )=f s c a n f ( s1 , ’%d ’ ) ; % must d e f i n e t h e i n p u t % d o r %s , e t c .
30 v ( i ) = v ( i ) −4;
31 disp (v( i ) ) ;
32 s e t ( gcf , ’ c o l o r ’ , ’ white ’ ) ;
33 drawnow ;
34 i f i >20
35 t p r i n t=t ( i −20: i ) ;
36 v p r i n t=v ( i −20: i ) ;
37 plot ( tprint , vprint ) ;
38 axis ( [ tprint (1) tprint (21) 0 60]) ;
39 else
40 plot (t , v) ;
41 axis ( [ 0 6.8153 0 60]) ;
42 end
43
44 g r i d on ;
45 t i t l e ( ’V Test ’ ) ;
46 x l a b e l ( ’ Time ’ ) ;
47 y l a b e l ( ’ Input ’ ) ;
48
49 end
50 end
51
52 c a t c h me
53 d i s p (me) ;
54 f c l o s e ( s1 ) ;
55 end
16
6 Conclusions
These are all improvements for future developments, but all based
on the work done on this project. It was our main goal to set up a platform
for a telemetry system, so that we could base more sophisticated systems
using what we developed here.
17
References
18