KEMBAR78
Dialnet SoftwareBasedAFSKGenerationOnArduino 6828028 | PDF | Software Defined Radio | Radio
0% found this document useful (0 votes)
18 views5 pages

Dialnet SoftwareBasedAFSKGenerationOnArduino 6828028

Uploaded by

joshmanani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views5 pages

Dialnet SoftwareBasedAFSKGenerationOnArduino 6828028

Uploaded by

joshmanani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Software Based AFSK Generation on Arduino

Lu
GranaSAT Aerospace Group Electronics Department
University of Granada University of Granada
Granada, Spain Granada, Spain
hfegetude@gmail.com amroldan@ugr.es

Abstract Master courses need to have a practical element, A. State of the art.
applying already known concepts to concrete problems. In this
APRS transmitter and receivers, even not so popular, are
paper, the design and manufacturing of a radio link using APRS
protocol over AX.25 will be presented as coursework during widely used for high distance transmission systems, as we can
several lab sessions. The aim is to create a system that is able to see in aprs.fi, a web page that collects data from APRS
poll data from several sensors and send them wirelessly with a emitters and put them online, many devices use this system.
software implemented signal generator in a microprocessor. These emitters are usually built around a PC and a Terminal
Node Controller (TNC), a device that, if attached to a radio
Keywords Wireless Communication, APRS, AFSK, AX.25, amplifier and modulator, will transmit the required signal.
SDR and Sound Modem These devices are usually expensive and not as portable,
I. INTRODUCTION issues that the design presented here will try to overcome.
The current availability of breakout modules and the power II. METHODS
of microprocessors facilitate the creation of products able to In order to design a successful device the standard product
read data from several sensors and transmit such data to one or design flow will be executed in the following order: Design
several receivers. This paper tries to explore this concept by
Specifications, System Analysis, System Design and testing.
using a not so usual transmission method in the current
technological scene, which is AX.25 data packages over AFSK A. Requirements of the Design
modulation. The proposed design is a suitable candidate for The design requirements of a product define the absolute
laboratory work in a multi-disciplinary course where many minimum functionality of a device to be considered finished
students with different backgrounds could be working together and functional; therefore, these requirements are meant to be
in groups of 5-8 people with background in electrical design, met when the work is finalized. These requirements are as
signal processing or computer science, for example any follows:
Product Design course of a master in technology, for example a
master in Wireless communication systems. This product could 1. The system shall be able to transmit data over AX.25 with
be used to test wireless satellite communication by having a AFSK modulation
reliable emitter, also this could be used as the main board in a
2. The system shall be able to read from several external
weather balloon.
sensors, these sensors are: a magnetometer, an
This work can be divided in three main parts, as the basic accelerometer, a gyroscope, a barometer, a GPS and a
diagram in figure 1 shows. A software design group, a thermometer.
hardware design group and finally an Embedded Software
3. The data generated by the sensors shall be logged onto a
group, each group could work independently from each other if
SD card and transmitted over AX.25
the work is correctly shared among the participants and
periodical meetings are done. 4. Images shall be taken with a camera module and placed
onto the SD card.
5. A GUI capable of reading data from the USB Serial Port
or an SDR and display such data.
These requirements shall be discussed by the students in each
group in order to reach a final action plan and how each
requirement shall be fulfilled. After such discussion a technical
paper could be given to the tutor synthetizing these
requirements, simulating a possible client.
B. Proposed Solution, System Anaylisis
During this production step, the group of students shall
agree during several meetings on how to split the group in
the different subsections and also, agree on the various details
Fig. 1: Product design flow

1
that the solution may have. In this paper a possible solution LSM303 integrating both an accelerometer and a
will be presented. magnetometer. This system is also interfaced through I2C
The proposed block diagram for the system is depicted on and the documentation found online is wide. [3 ]
Fig. 2. This solution consists of an Arduino Mega as the main
MCU [1] due to its easy implementation and number of
peripherals. All of the sensors will be read from an I2C port or
a serial port. Due to the current availability at the laboratory, an
OV7670 camera module will be used. This module contains a
FIFO making it easier to be interfaced with. Finally, the output
AFSK will be generated and outputted with PWM signal and
then low-pass filtered, this solution will not require any extra
digital modules since the analog signal will be software
generated, therefore only an external modulator to set the
frequency at 144.8 MHz will be required.
A GUI programmed with Python is desirable to be created
due to its simplicity and ease of access to external modules
such as the Serial Port and the audio input from an SDR.
C. System Design Fig. 2: 3D model of the final PCB
This part contains the actual in depth solution to the
product and its implementation. These tasks shall be
distributed among groups of students depending on the
background of each of them.

Fig. 3: Final PCB


The Gyroscope system is integrated by an MPU6050 that
also contains and accelerometer, suitable for contrasting the
date from the LSM303. The full scale of this device is
[4]
Fig. 2: S As a GPS unit, the NEO-6 from u-blox is selected due to its
ease of use through the serial port and automatic
1) Hardware design configuration and calibration is chosen.
The hardware design team shall be in charge of selecting An OV7670 plus a FIFO chip is selected to take the images
the right hardware components and sensors as well as creating into the MCU. The OV7670 requires an input signal of
a PCB to hold all the components together and correctly 8MHz and will output data at the same rate. Reading from
interfaced. A 3D model is also desirable to improve the such device, though possible, will make the work way
presentation of the product; an example of a 3D modeled harder with no clear advantage.
board is show below in figure 3. The Arduino will produce and AFSK signal that is not
Small prototypes interconnecting one of more hardware suitable to be transmitted due to its low frequency therefore
parts are desirable since it will allow the rest of the team in a radio module such as the HX-11 shall be used to elevate
charge of the embedded software and software a faster the central frequency to 144.8 MHz, placing it in the Free /
development as the one depicted in figure 4. Amateur radio band.
The final selected sensors are. After the items, where selected and studied a board as the
BMP180, which integrates both a temperature sensor and a one depicted in figure number 4. The board was manufactured
barometer, this module is interfaced through I2Cpresenting by an external company for a small amount of money. This
a range of -40 to 65 board includes:
200-1100 hPa in the barometer. [2] 1. An external battery connector with a DC-DC converter

2
2. Level shifters in order to interface 3.3 V logic with 5 V
logic.
3. An external connector for an antenna.
4. Test points in order to facilitate debugging.
2) Embedded Software Design
One of the main advantages of using the Arduino platform
is the wide availability of software libraries to poll data from
common hardware modules with ease. All these software
libraries will be used to communicate with the I2C devices as
well as parse the data coming from the UART port. All of these
devices will be polled periodically in order to obtain regular
data from the environment. This data will then be transmitted
wirelessly by the implemented AFSK transmitter. The analog
signal that will drive the modulator will be entirely generated
in software at baseband frequency and then elevated by the
external radio modules to 144.8 MHz.
a) AX.25 frame generation[5]
The first step will be to generate a suitable AX.25 frame
for transmission; this header will contain all the collected
parameters with their correspondent identifier separated by a
backslash. After that, the header will be generated Fig. 5: AFSK Generation algorithm
corresponding to [5].
This interrupt function will collect the sample and place on
b) AFSK Generation the comparation register of the ATmega 2560 (OCR) that will
The actual implemented modulation is AFSK1200 NRZ set the output pin low on a successful match. Once the counter
that means that the produced tone will oscillate between 1200 reaches 255 and resets, the output pin is set again to high. A
and 2200 Hz sending data at 1200 bauds. In order to generate picture displaying this idea is shown in figure 6.
such tones, the 8-bit Timer/ Counter implemented inside the
the sampling rate, the
samples per baud and the total lookup table size can be
obtained using equations 1, 2 and 3:
(1)
(2)
(3)

Then the phase accumulator algorithm shall be followed


AS described in [6]. The program will first load a bit into
memory from the AX.25 frame buffer, if that bit results to be 0
then the phase delta will be toggled to the other tone. This is Fig. 6: PWM Signal of the Arduino
because a NRZ modulation is used, thus the transmitting
symbol is only switched once a 0 is found and kept otherwise. c) Interfacing with OV7670 FIFO module [7].
Once the phase delta is obtained, the instantaneous phase can
be obtained in equation 4 for each iteration: achieved with a parallel port connection. The VSYNC pin
from the camera module itself is exposed, displaying a high
(4)
pulse every time a new frame capture is about to begin.
The actual sample value is obtained by a lookup table,
which values where calculated using the following
formula.described in equation 5.
(5)
Then the phase accumulator will continue to increment the Fig. 7: Capturing a frame into FIFO
phase by the phase delta previously selected until the number
of samples per baud are meet. In such case, a new sample shall
be collected to restart the cycle again. This is graphically
explained in figure number 5.
Regarding the actual software implementation both the
outputting task and frame generation activity where done in
parallel to save time and memory. All the generated samples Fig. 8: Reading from the FIFO
were placed in a software ring buffer and read by an interrupt
that will trigger every time a new sample has to be output. Once this pulse occurs the Arduino must reset the write
pointer of the FIFO and enable writing on it. This is achieved
by setting the WEN pin low during all the transaction and

3
pulsing the WRST pin. The timing diagram previously
described is displayed on figure 8.

Fig. 10: Final PCB produced


1) AFSK generation
The signal was successfully generated using the software
designed, figures 11 and 12 show the output signal captured by
a scope after being filtered Low Pass 10Khz to avoid
displaying the PWM signal itself. The measured deviation was
no more than 200Hz from the aimed frequency, which makes it
feasible to be demodulated by a cheap radio module such as an
Fig. 9: Software architecture USB SDR for a latter data analysis using dedicated software.
Below an example captured frame is shown:
[1887791]GSA-11>APRS,WIDE2-1:/16-03-
memory, the read pointer of the FIFO must be set to the 95/00:31:43/0000.00N/00000.00EO/RoX=0.00/RoY=-0.89/RoZ=-
beginning of the memory. Meanwhile pulses shall be 0.71/AcX=1.57/AcY=-0.08/AcZ=-0.04/MaX=-0.09/MaY=-
0.34/MaZ=0.34/T=22.63/P=940.44
generated into the input read clock, obtaining an image byte
per pulse, as displayed in figure 6. This frame was captured using an USB SDR through SDR#
3) Software Design with the AFSK demodulator QTMM, which is displayed in
In order to create a successful that is able to read both from the figure 13. The measured range of the measured transmission
USB port, logging debug data for development and radio data
from an SDR can be achieved easily thanks to the many open be significantly improved using a properly designed antenna
source projects that are available online. For this task the and a RF amplifier.
selected libraries/ frameworks / programs are:
Rtl-sdr, open source drivers for the common SDR
dongles that allow to stream the received signal as an
audio signal.
Direwolf, complete radio suite allowing to transmit
as a TNC and receive data from an SDR, in this
project it will be used as an AX.25 decoder
PySerial, Python package that allows the interaction
with a serial port programmatically.
TkInter, framework used for creating graphical
applications in python.
In figure 9, the software architecture of the project is depicted.
Having that open source projects already chosen the task Fig. 11: 1.2 kHz generated signal
transform into a high level programming project where the
only parts that need to be implemented by the students are
the APRS frame parser, that will take the raw APRS string and
transform it into numeric variables that will be displayed by
the GUI made with TkInter.
In order to obtain the data from the radio module, an instance
of Direwolf will be run which will load all the received APRS
data onto a file, that same file will be read by the created
python script and then fed into the APRS frame parser.

III. RESULTS
The final PCB was produced a manufactured by an external
Fig. 12: 2.2 kHz generated signal
collaborator, the result is shown in figure 10.

4
In software design, concepts about microcontrollers low
level C programming techniques are expected to be used to be
able to generate the date at the sufficient speed. In addition,
concepts of basic data treatment from sensors and polling are
required. If the GUI is finally implemented, the student will
learn how to read from external ports in a computer and display
data in an understandable way using a high-level language such
a Python.
CONCLUSION
The exposed work is a very complete course project
Fig. 13: Signal demodulation with SDR# and QTMM suitable for a master degree in a technical field that expects
students from very different backgrounds that will challenge
2) Image capture
them to cooperate while and use their previously acquired
The captured image is shown in figure 14, this image
technical knowledge to overcome the course. This laboratory/
shows a test pattern generated by the camera with the purpose
project session is meant for teaching the students the value of
of having a known image to test capture and color reception of
team work and how it can achieve the solution of high level
the frame.
technological problems, therefore individual evaluation is
IV. DISCUSSION discouraged, in order to make the students share the work
properly.
During this possible Product Design course project the
student could potentially acquire knowledge of how a modern REFERENCES
device is designed and fabricated making it a perfect lab work [1] l
to understand this field. The student will be put in a situation [2]
where a product must be designed with other student from
[3]
different backgrounds, having to auto evaluate their own
[4]
knowledge in order to create a successful work.
Regarding the electronic design, the student will gain [5] J
knowledge about RF design and routing along with concepts of [6] Ibrahim, S. H., Ali, S. H. M., & Islam, M. S. (2012). Design a 24-bits
digital transmission protocol such as I2C or UART. Also pipeline phase accumulator for direct digital frequency synthesizer. In
modern PCB design a manufacture will be learn, as well as Proceedings - 2012 International Symposium on Instrumentation and
Measurement, Sensor Network and Automation, IMSNA 2012 (Vol. 2,
hardware debugging. pp. 393 397). https://doi.org/10.1109/MSNA.2012.6324603
[7] Wang, R., Mi, Z., Yu, H., & Yuan, W. (2011). The design of image
processing system based on SOPC and OV7670. In Procedia
Engineering (Vol. 24, pp. 237 241).
https://doi.org/10.1016/j.proeng.2011.11.2633
[8] Dilek, S. M., Ayranci, A., Seker, A., Ceylan, O., & Yagci, H. B. (2012).
AX.25 protocol compatible reconfigurable 2/4 FSK modulator design
for nano/micro-satellites. In 2012 20th Telecommunications Forum,
TELFOR 2012 - Proceedings (pp. 416 419).
https://doi.org/10.1109/TELFOR.2012.6419235

Fig. 14: Captured camera test pattern

You might also like