My Thoughts At The Sea Shore

It’s funny how your mind goes blank in an instant while it was laden with thoughts just a while ago. In response to a magnificent amalgamation of humane facets & nature’s blessings, your mind refuse to devour whatever your eyes see but the heart makes space to embrace it.

Your senses brighten up to grasp whatever they could. And you gradually slips into total awareness of your surrounding like you do when carefully counting the tiniest of stars while gazing into the silent starry nights.

Even a fainting sound reverberate in mind. Each one carrying their own uniqueness of melody. When those distinct sounds combine, they make a rhythm. A rhythm of dissonance, on the song of which this world dances.

It’s seems worth to ponder – was I always so occupied to never have pondered over it before? Thoughts that I possess now could have resolutely been triggered somewhere else as well? So is it this extensive stretch of water that stands out or there is something else it holds in disguise?

In the general world of commotion, things are playfully dynamic. We do witness medium size well-shaped trees like the ones planted here. We do come across these colorful walls of mansions & we even take a glance over the rock statues that stands as the silent spectator of this dynamism but we don’t make sense out of them. Probably being trapped in this generality kept us from having a broader perspective.

While I sat in reverie at the sea shore artificially adorned with benches, artistically constructed rock chairs, plain roads and lots of people around. I saw things. I observed them. With my awaken senses, I tried to make sense out of them.

I saw a little girl clad in rugged attire selling bubble-blower with fan on top that occasionally whirled with sea breeze. It spun slow and fast intimidating children around who desired to buy it while she tried to make a sale. Those who blew the bubble were successful in making that 20 rupees deal. It added a fairy aura to the whole scene.

I saw a sadhu having conversation with a middle-aged man from a distant land. He seems quite young though, certainly not of age when one would think of getting over the worldly relations and turn into a monk. May be he had an epiphany of exploring ‘into the wild‘. They seem to enjoy it as apparent from their occasional laughs.

I saw a girl, blonde haired, probably in her late twenties scribbling something on a parchment laid on her thigh after she looked towards the sea and thought something. She is sitting alone in her own company bearing a beautiful smile. The face glitters with the lights of setting sun.

I saw another middle-aged guy having his evening jog. Perspiration drips through his body as he repetitively takes round of the finitely stretch road on the shore. A long hair tied behind and a french-cut beard wearing a light inner-ware & track shorts, he seems more of a regular sprinter. I chuckle watching him panting haphazardly.

the_beach_fun

I saw the kids playing beach-football. Only that their football is more like a toy and there is certainly not much people to make a professional team. Its just siblings playing, later joined in by their friends. I join in too. I let myself be a child while I happen to be with one. Here playing involved repetitive hitting the ball and making sure it reaches them overcoming the friction imposed by sands. They would do the same for their turn. I never liked regressive sport anyway.

I saw several groups of friends gathered at places like separate entities exemplifying the same bond that holds them together – friendship. Their giggling, their excitement, their occasional taunting on their mates while others gang up and usual scolding in reward, their planning for the rest, attempted to bring out the best, forgetting about their upcoming test (true story!), its how they chill out.

I saw a family at the roadside as they break the monotonocity of being in a leisurely closet called ‘home’ to get some fresh air. And I saw numerous such families aligned. The women got along with the gossips while the men had their own ‘mandli‘. If men are from Mars and women are from Venus, its time for the colonial celebrations. Older members of the family have their own gang.

I saw the couples dipping into their conjugated love. They were sitting slightly away from the crowd in some lonely corners so as to steal their moment of privacy. One’s hand were kept in other’s when one’s shoulder moves to support other’s head. What marks them is the twinkling in their eyes not because of the sea but when one’s pair catches the glimpse of other’s. I can only speculate about it as I didn’t have anyone besides me to experience it myself. Its one of those hard times you realize you’re still single 😛 I somehow fan off my feelings move to my next observation.

There is a market on the other side. Food delicacies, crockery, clothes, hand-made ornamental items – I heard the voice of vendors making attempt to lure the visitors. I saw poverty-ridden children pleading for buying them chaat or chhole being sold at the tiny stalls. They pleaded to everyone passing by. They didn’t ask for money though or probably I was too moved to notice by this circus of hunger-atrocity. My heart melts and I drench in the shower of humanity. The shattered pieces are consolidated by the smile that prevails after an act of kindness.

I saw the huge lines of parked vehicles few feet away. Each seem to be waiting for their turn to get driven by, again. But its moment of peace for them too. I wonder if they had a soul, it might have a re-union party for them.

I saw the policemen patrolling to justify their work. However serene does everything seem, they should maintain a decorum. I thought of writing about how it is relatively easier for them to dodge the mundanity of life (in fact I wrote and erased it later), the bottom-line is the same job could be much cooler at some places than somewhere else.

Untitled design

Glinting tints

I saw my friends feeling an unbounded joy. I feel myself as if broken a chain that kept me tied me so far. I felt everyone and everything around getting free from constraints.

I did see gigantic stretch of water, I did see the lights dancing on the wave,  which gradually shifted from sun’s to moon’s (though its always of sun’s actually – lets not mix up science & philosophy!).

I did see tides rising up, making their way to the shore and hitting the massive rocks, only to get retracted, loosing their energy and ultimately dying out. The sound of consistent collision filled the environment. They roared to tell the new comers about the thrill that lies ahead.

I saw the small ships , sailing not far away from the shore, coming back from a fisherman’s voyage. As the noisy engine drives the propeller, it tears the water and moved the boat fearlessly forward to wrap up a victorious journey.

I also saw some big ships in the distant water looking like tiny lumps of wood floating. The parallax of observance renders the scene like a rendezvous of pirates.

I saw tiny fishes making their jump as if telling there lies the life beneath as well.

I saw the entire commotion making a peace with silence to spare this space where people make an escape.

I saw the entire universe walking my steps as I marched towards a silent destination to pen down my thoughts.

P.S – It was an ocean actually but ‘sea shore’ rhymes 🙂

 

Thready – Threat Detection Using Drones

This was our submission to IBM Drone Hackathon held on 30-31 January during ηvision2016 at IIT Hyderabad. You can access the project folder on my Github account here.

Prologue

We received a mail regarding the Drone Ideathon (Phase-I) in the last week of December, 2015. Students had to submit ideas as to what would they use a drone for, which would then be reviewed by IBM delegates.

Around 20 ideas were submitted out of which 5 were selected for the Phase-II (hackathon). These were the teams which IBM would be actually providing drones to work on. Ours was one of them. We had around 2 weeks to prepare a working demonstration and test it.

IBM provided us with one DJI Phantom 3 and one Parrot AR 2.0 drone. We were in a team of 2 consisting me and my friend Prathmesh.

The Project

Our idea was to develop an IoT device for in-house detection of threat using drones named ‘Thready‘. For our prototype, we chose to focus on the concentration of poisonous gases in the atmosphere. It was somewhere inspired by the recent Pathankot attack incident where a soldier died while he was inspecting the dead terrorists and a triggered-bomb exploded.

Hardware – 

Firstly, we needed stack where we can connect our sensors to wifi. The first plausible option that comes is to use Raspberry Pi. But the sensors being used were analog in nature. Raspberry Pi is quite complicated to work around with common sensors.

Another option was to use ESP2866 wifi module for Arduino but one would rather build a time machine that to figure out how to work with this (sarcasm intended!). Given the strict timeline of the project besides hectic academic schedule, we certainly had to look for alternatives.

particle-photon-1

Particle Photon 

Particle Photon‘ came as a savior for us. Its a recently launched Arduino-based micro-controller with inbuilt wifi module. All you’ve to do is register your device on https://build.particle.io with provided credentials.

There you can start a project and compile your codes in their inbuilt editor. Clicking on the settings tab, you can know your ‘device id’ and ‘access token’ which would be required in the later stage.

It also has a dedicated android app for you to connect your particle device with the wifi router. You can find it on Play Store here. Once connected, particle will start emitting its own signal which you can connect to and kickstart your IoT project.

Circuit –

Our circuit was quite simple. We were using MQ-2 MQ2 Gas Sensor Module for smoke detection. It can measure the concentrations of upto 8 distinct gases given you can distinguish or better use different unit for each gas you want to measure.

This would have certainly complicated the circuit. We decide to go with measuring ‘carbon dioxide‘ measurement for this was one gas we could easily test out for. Just blow your breath out and there the concentration shoots up FTW!

Since we were developing an in-house application, we thought of incorporating obstacle avoidance technique but that meant delving into the whole complex drone-working mechanism which obviously we didn’t have the time for. Nonetheless, I had procured an HC-SR04 Ultrasonic Distance Measuring Transducer.

It didn’t take me much time to figure out working with it. Just make few connections, write a simple Arduino code and there you have any obstacle distance displayed on the serial monitor. Knowing something doesn’t go wasted and I used this sensor in my ‘Smart Dustbin’ project for Inter-IIT Tech Meet. You can find the sample code here.

smart_dustbin

Interface 

Normal users don’t understand the code and stuff. You have to provide them with simple interface that shows how plausible the danger is.

Once we got the sensor data successfully displayed on the serial monitor, our next task was to transmit it over wifi to be displayed on the web & Android app we made.

Back-end

Particle photon has amazing support for code deployments and querying. Obviously we had to read its documentation to know all of its feature since we were using it for the first time.

Initially we wanted to use something like Flaskr – A SQLite based blogging application based on Flask (A python micro-framework for web) for our web app. Its because we wanted to store our data over time as well. Flask is quite easy to use and you may have your web app running in no time. But beware if you’re new to this. Some part of the flask server setup may bug you to hell even if you think you’re following the documentation properly. You can read my experience here.

After lots of head-scratching moments, we chucked the idea of using flask considering the time it would have taken to code the database support and get it working properly. Reading through the ‘particle photon’ documentation, we came across Particle Cloud API – https://api.particle.io/v1/devices/230024001447343339383037/events/?access_token=77394ac5db47xxxxxxxxxxxxxxx6c74f5c1d15c7 (its ours, you can’t see the access token :P)

Though normally one would have gone with API testing alternatives like hurl.it or requestbin but Particle Cloud API was perfect for us. Learning about the data publishing using spark photon was a challenge in itself. You can read snippets of my on-the-go learning experience here.

After lots of juggling through forums and discussion, we found the trick that did the work – spark.publish() function.

Front-end

This was a cake-walk for me once we figured out the back-end. I have been into web development for around two years now. Being a design enthusiast, I knew how I want my interface to be. But wait there is a catch!

highchart2

The chart. Yes this stupid chart gave me a hard time. By now the gas concentration was successfully being displayed on the interface but I wanted a real-time dynamic chart rendering to let the user easily visualize the data. Once the value exceeds the threshold (which may differ place to place which you could measure by flying the drone for sometime and noting down the average of the data – we were able to successfully answer it when asked by the evaluation team), the data and chart changes color, preferable the line & text turns red.

First I needed to decide what kind of chart would be the perfect fit. Initially I though pie-chart would be the best with its segment expanding and contracting with the values. But there was another learning chapter waiting for us to read.

I had thought using Google charts would do the work easily but that was my misconception. I couldn’t find any effective method to display a dynamic chart in the entire documentation. Even if I did somewhere hidden in the distant corners of the forums, it didn’t work out and I was stuck. Jumping between different types of charts and experimenting the code everytime only wasted our precious time. But it was a lesson worth to take.

Then I moved on to the alternatives like plot.ly and HighCharts. Since the time was less, I thought of sticking with the one that looked more promising – it was HighCharts for me.

I wrote the JavaScript code for querying the Cloud API URL mentioned earlier and get the data in JSON format. Parsing the JSON was easy as I had done it numerous times earlier. Further I wrote the code for chart rendering and fed the data to it in terms of variable I had stored the concentration in. Also I switched to more interactive ‘line chart‘ which was being updated with the upcoming data over time-axis.

When you’ve done everything right, you expect the system to work but when it doesn’t, you feel miserable. I was facing the similar situation when I was expecting the real time chart to be displayed successfully on the webpage but everytime the variable changed, the line disappeared and only the timeline seemed to be moving.

I was unable to figure out where the problem was even after lots of debugging and adding breakpoints. In the scarcity of time, I tweaked with the code numerous times even doing the changes where it was least expected, yet no result.

Finally I decided to round off the concentration value using Math.round() method, just to see since nothing was working out. I re-ran the web app and voila! There it was – my beautiful dynamic chart being plotted in real time.


var x = (new Date()).getTime(), // current time
y = Math.round(parseInt(conc_value)/10);

That was probably the most relieving ‘localhost:3000‘ I visited in recent days. I still haven’t figure out as to why only rounded value worked out but I was finally ready for my confident presentation with a working prototype besides. Finally it was ready for actual testing on drone.

Mounting

We tested our project on DJI Phantom 3 drone. The organizers have made a packaging box where our equipment could be kept and then it was firmly mounted on the drone. I quickly setup the connections, dumped the code and ran the web app.

As the drone flied, we were able to see the concentration continuously changing over time. Since we were flying outdoor where it was a bit dusty, I could see the large variation in the data but monitoring the gas-prone zones in the campus was sometimes I was least concerned about, at that time.

Future Work

  • Make it more portable. Getting rid of the wired connection and making a compact circuit on a PCB.
  • The database for storing the fluctuation over a large time frame to monitor the environment of a location. This would be probably the first and the easiest task to accomplish.

Learning

This project was a huge learning experience for me. Given the compact timeline, figuring out things (when you’re working with them for the first time) becomes a bigger challenge. There were times when we felt helpless given no one was there to guide us. The relief that I got after successful demonstration in indescribable but it has a long way to go.

When you build something end-to-end, only then you know what it takes to get the entire system working.