Morse code Broadcaster App & Receiver using Arduino
Me and Ranit Bhowmick had been working on this for over a month now.
This was really an ambitious project and we tried to pull off something big !
The
 app takes in a string of words - encodes it into Morse code and 
broadcasts it in form of light pulses using the phones flash light in 
accordance with both of the frequency parameters. Changing those 
parameters changes the speed of the broadcast.
On the other end there's a Arduino with a photo-resistor which keeps 
sleeping and wakes up only when senses the first light pulse. ( So, 
basically it's a auto on/off feature ) which receives and reads those 
light flashes, processes it and decodes it into it's original form. ( 
Again, in accordance with those parameters ) Displays it and goes back 
to sleep !
This is how wireless data transfer works ! It's just a simplified form 
of a WiFi or a cell tower.
We've recreated a model wireless communication system from scratch ! 
What is the most important skill that you can have in a field like Robotics ? I mean, how do show off that you've learnt enough ? No matter how simple the project is - personally, I think it is when you have an idea inside of your head and you're able to turn that into reality using the knowledge you've gained.
Coming up with an Idea
So, I've been trying to come up with something crazy, totally out of the box. Something that had never been done before. And, I remember reading about Morse code in this article long ago. Now, in case you don't know - Morse code is basically a method used in telecommunication to encode text characters as standardized sequences of two different signal duration, called dots and dashes. What if I can make something in Arduino which receives these signals and decodes them to display the original message or sequence of strings. I didn't just want to do that, I wanted to turn up the heat ! What if the signals it receives are in form of light pulses. So, if I can develop an app in android for a smartphone which broadcasts the code in form of a sequence of light pulses and the Arduino receives and decodes it, what I get at the end of the day is a wireless communication system.I would've created a model wireless communication system from scratch !
Turning that Idea into reality
I
 needed to have all of these up and running with a single week including
 Android app which needed to be designed, developed and published. 
Because our exams were right around the corner ! So, I got in touch with
 one of my classmates to help me out in this project. Luckily, she 
agreed !
Before
 starting everything, we Carried out a simple test to find out whether 
it was possible to create such a device which could detect the light 
flashes or pulses with accuracy, agility and efficiency. We're in the 
middle of a second wave here in India. So, had to do everything online. 
Anyway, when this was out of the way - I started working on the App. 
Now, this is not just any app - This was going to be my app. And you 
know what we do here in this channel "WE WORK WITH STYLE !"
So,
 I spent days ! Trying to find a look and theme which best suits the app
 while remaining simple and user friendly ! I Was screening the whole 
time ! I never had to use XML before. And it's so hard to get things 
done in it. I
 was using ue4 to develop this fitness app previously and it's so 
user-friendly and easy to get things done which enabled me to focus on 
the artistic side of the things. But this, this was a nightmare !
Anyway,
Throughout
 the development process it went through a lot of iterations - as the 
app functionality and user experience was altered. But at the end I 
settled with something like this ! It looked good enough.
Now, finally coming down to the development part,
What I was worried about, the main functionality ! Went well. 
The
 whole turn on and turn off - flash pulse thing was time dependent so 
had to make up a complex multiple recursive pipeline for everything to 
work in sync and with strict time accuracy, because using just a simple 
delay won't work - obviously when you have so much stuff on your plate.
Which
 - later gave me headaches when I had to comeback and look at it ! But,
 debugging this thing was a disaster. Because there isn't a flash unit 
on a emulator so it kept giving me all sorts of exceptions. Which, I had
 to work around by pumping out log entries in every god-dam line. And 
why is it such a headache to inflate a view and create a simple alert 
pop up ?
After almost 5 days of work - Everything was up and running and it looked good visually.
I had a small info windows with our names on it as well.
And it showed a cute little "Broadcasting" alert-box while working. Lastly,
 when Sayanti sent me the map to fill up the internal database - I fused
 it with my code and the app was fully functional and ready !
Some screenshots from the App
Now
 I had to do the reverse in a different language. To get the Arduino 
side of things working ! We've been carrying out tests to it was easy to
 get things up and running ! In
 our app we had these two parameters 'frequency' which determined the 
time duration of a 'dot' in the Morse code and the blank gap between the
 individual units in a code. And 'frequency_gap' which determined the 
same for a 'dash' and the blank gap between two different entities or 
characters.
These values between the app and the Arduino needs to be synced up in order for the whole thing to work. The
 code in Arduino detects, calculates and separate the light pulses in 
accordance with their pulse duration and the blank gap which is then 
decoded into readable text. With all these in mind, it took me 
about 2 days to program the whole thing in the same recursive manner and 
fortunately it was working perfectly !
As soon as Sayanti 
provided me with the reverse map and all the other necessary snippets ! 
The main engine was done ! I wanted to display the decoded text through 
 an LCD screen. So, programmed it in as well. With this done, the system
 was finally ready. Watch a detailed vlog on my channel to know How a 
did it.
And you can download this app for your own projects ! That is all of it. 
Over
 the last few days I've been improving this system and I'll continue 
working on it for some days. Meanwhile, I've published this app. Named: 
Morse code broadcaster to the Amazon store.
So, you can go, download and use it for free !
I'll be publishing it in the Google Play store soon as well !
Ive
 since added a number pad which allows the user to change the frequency
 parameters in the Arduino and some buttons to help define the minimum 
luminosity which the program should consider as darkness and to carry 
out other calibrations.
 




 
 
Comments
Post a Comment