Thursday, June 4, 2015

The Massive Update Post (v1)

Yes, I know that I have failed to update my blog and literally just plain ignored stuff. I admit. And now, since I feel bad about that, i will try to fix this. Hopefully this one ginormous post will undo most of the damage inflicted on my own will. 

As you can very clearly see, I have been busy. And when I say busy, I mean REALLY busy. No online activity, not even on Google+! Well all this is due to a very good reason. Or perhaps a couple of reasons. Well earlier, I was busy in college, with no time even to process the photos in the camera. But even after that, I had tonnes of stuff to do, Computer stuff. LINUX STUFF!

My Laptop Work-space, with the unfinished lighting project
My Desktop Work-space (1)

My Desktop Work-space (2)

No, not just the software concept of Linux, which is open for all. Even the Open soured hardware has kept me busy. So when I found out about the Raspberry pi, I just could not resist it. Again, I'm quite late to join in the RPi party.

So when I got the first Rpi, I was plain confused, as to what should I do with it? There were so many possibilities! Then an idea struck me, and I decided to hook it up with my TV. At that time, i Installed RaspBMC, which is now called OSMC. Just install that image to an SD Card and boot the Pi up, and voila, you have a fully functional and with a little adjustments, insanely beautiful home theater system, which is also capable of streaming movies photos music and even act as a NAS device for your home. For the money, that is really really awesome.

If you wish to see more about this...

On the TV front, it is now working as a Steam machine as well, Casting games from my laptop to the TV. 35$ steam machine? Definitely impressive.

I was so impressed by the Pi, that i ordered another one, with sensors and stuff. I was daydreaming this completely automated room of mine.. Walk in, the lights turn on, and according to the ambient temperature, either the AC turns on or the fan. And when I proceed to sit on the desk, the desk lamp lights up. The concept seemed pretty plausible. So I got:-
Relays - to control high power stuff
PIR Sensor – to detect movement
Ultrasonic Ranger  - For that desk lighting
Light sensors and temp sensors

Raspberry Pi, GrovePi, and some sensors.

The day I received all this was also the very same day RPi 2 was announced, with much better specs for the same price. :| 

With all this cool looking stuff in front of me, I realized that I forgot about one very important part. And that was the knowledge of how to code that stuff to do what I want them to do. 

Thankfully, I have the GrovePi boards and the manufacturer (Dexter Industries) have a rather excellent set of documentation to get idiots like me started. Within one week.. I was controlling most of the sensors, together, in unison. I would walk into my room and a small LED strip would light up. And when my laptop got too hot, it would automatically turn on my DIY laptop cooling stand.

And then I hit another roadblock. And this was a big one. For any home automation system to be useful, it has to know the exact location of the persons(s) in the home. In my case, it would have to know how many people are in my room. For example, I configure the sensors in such way that when someone enters the room, it detects the motion and turns on the light. That's easy. What is difficult is that how would the system know if a person is still in the room, but not moving.. for example, sitting on laptop, reading a book, or perhaps, sleeping? For the system.. there was movement, so it turns on the lights for around 10 seconds.. then how does it know that it still needs to keep the lights on? How does it know if it has to turn the lights off if I go to sleep? That is a very big challenge.
I planned on using two light sensors and lasers to make a “people counter” apparatus. If the two lasers are cut in, say direction 1 to 2, then the system can say that a person has entered the room, and turn on the lights. If the lasers are cut in the opposite direction, the system gets the info that person has left the room. Theoretically it sounds good. It might also work. But practically, this system requires a lot of trial and error, for example, what should be the spacing between the lasers, what should be the time lag required to cut the laser path, and so on. And even if I had managed to program this correctly, there was the sleeping problem, which i haven't found the solution until now. All this is also ignoring the massive level of modifications needed in the house. So I ended up dumping this project.

Then, just some time ago, I came across two projects, both made with the base of RasPi, but fairly easy and potentially very awesome to build and make.
One of them, is a WLAN based plotter.Here is the tutorial.

The other was RGB LED strips controlled by a phone. And I was hooked to both. Although I managed to finish the WLAN plotter (in theory), The mood lighting setup is still struck as I cannot find the necessary components, ie, MOSFETs, to control the LED strips. For the curious, i will be using PWM, or pulse width modulation, to control the lighting.
Basic RGB LED tutuorial

The mobile controlled RGB LED Strips

Not that good at cable management

Basic wiring of the plotter

All this also made me realize that there is so much to learn from even the smallest things that we usually choose to ignore. And also no matter how much you end up reading about stuff, until you actually get down to doing it, you will not understand it. Who knew that those boring Basics of Electronic classes could be so much fun, when you actually started playing with that stuff!

Hopefully, I will be able to finish most of the small projects before my vacations are over. And if it turns out to be decent, I may as well write a guide. In case anyone is interested, the whole mood lighting setup will cost around 4k rupees, including the cost of Rpi.

I'd like to end this one with a travel recommendation to the Sundarbans. That place is simplyLEGENDARY. Wide open waters, with islands spotted all over, and forest so dense, you cant even see 10 meters into the island. Plus as there is no electricity, nearly all the tourist lodge i saw were completely working off solar energy, which again is awesome as well as essential in a place like sundarbans. But since one picture is worth a thousand words, I will let the pictures do the talking, with some pictures from the insanely laid back life of Kolkata.

These people were quite patient. Boat rides cost 1 rupee. 

This is the biggest banyan tree in the world, circumference of around 1 km!

My favorite Documentary type photo

You can always check my Google+ to find more pics.

Here's hoping I make another post here, before August.