Thursday, May 03, 2012

Cartoon Scape - Anna Hazare teams up with Ramdev to fight corruption

Funny Cartoon appeared on THE HINDU - Cartoon Scape

Anna Hazare teams up with Ramdev to fight corruption. Too late to act perhaps. For he even didn't am in doing..


Original link below...

Wednesday, May 02, 2012

Arduino Based Auto Timer / Stop Watch Timer for stroking time Measurement

See my Instructables below for full version of this article
The Need:
Last week around at work I had another usual un-usual  problem to face with.  Having to make lots of mechanisms n components to work with-in seconds or fracs at times I kind-of knew this was always coming.


And invariably so my poor mind couldn't think of anything but Arduino for a handy solution that should be compact, flexible, highly customizable, rugged and most importantly easier to work around.

Step 1The Problem:


i
The Problem:
What we had is an arm moving around from an actuator which we would like to tap with some contact type micro switces (limit switches) to give a feed-back signal as the awkward figure suggests.

Step 2Components:


i
Components:
I franatically searched for the components from the Junks I always treasured with the hobby kit coming-in handy..


LCD Display (16x2) - 1
Micro Switches - 2
Hook-up wires for (bread board) - Plenty (see Fritizing schematic for actuals)
Bread Board - 1 (for Prototyping)
LED - 1 (fok blinking indication)
Resistors 330 & 2K - 1 each
potentiometer 4k - 1  ( I had used one 2k Resistor and a 4K POT in comb. instead of a 6k pot to control the display as it came so handy from the junk parts)

Arduino - 1 (Duemelanove is what I had)

Step 3The Methodology


i
The Methodology
  • IMG_5639.JPG
  • IMG_5633.JPG
  • Image1256.jpg
  • Image1255.jpg
Now that all I/O's are wired in order as per the schematic, it pretty much works-out itself and it all boils down to the programming now..


I had used the StopWatch library to evoke the timer and initiated the millis() function to record time step value as soon as Arduino is started.



But what I need is just a differential timer with the simple math which gives us the time on air or otherwise.



All that I did is declared some run-time variables and do some math to display the difference value to show only the time between micro-switches getting energised. Otherwise to display the time correctly in the format is similar to Dan Thompson's method as it only records the time values in millis and we have to convert the values to sec, min, hr and microsecs.



The other problem i encounter is the sign reversal as arduino cannot handle large buffer. I finally managed to overcome this error by using the unsigned longint as integer data type.

Step 4Display Shield


i
Display Shield
The display shield is constructed of pretty much the same components over a matrix board with pin rails for piggy-backing Arduino.


Had used some old components from an electronic choke for compacting

Step 5Arduino Sketch - Programming

Final sketch\code for Arduino below:
/*
Sketch \ Code by Chuppandi aka Subu
Chuppandi@gmail.com
www.chuppandee.blgospot.com
*/


#include
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // LCD pins decleration
int switchPin1 = 3;// switch1 is connected to pin 3
int switchPin2 = 2;// switch2 is connected to pin 2
int ledPin = 13; // LED is connected to pin 13 in arduino
int val1;
int val2;
int frameRate = 500;                // the frame rate (frames per second) at which the stopwatch runs - Change to suit
long interval = (1000/frameRate);   // blink interval
char buf[15f00];                       // string buffer for itoa function
unsigned long starttime = 0;
unsigned long endtime = 0;
unsigned long lasttime = 0;
unsigned long currenttime = 0;
StopWatch sw_millis;    // MILLIS (default)
StopWatch sw_micros(StopWatch::MICROS);
StopWatch sw_secs(StopWatch::SECONDS);
void setup() {
    lcd.begin(16,2);
    pinMode(switchPin1, INPUT);
    pinMode(switchPin2, INPUT);
    pinMode(ledPin, OUTPUT);
    Serial.begin(9600);
    sw_millis.start();
    sw_micros.start();
    sw_secs.start();
}
void loop() {
  val1 = digitalRead(switchPin1);   // read input value and store it in val
  val2 = digitalRead(switchPin2);   // read input value and store it in val
    if (val1 == LOW && val2 == LOW)
   {
    digitalWrite(ledPin, HIGH);   // turn LED on
    currenttime = (sw_millis.elapsed() - lasttime) ;
    Serial.print("sw_millis=");
    Serial.println(sw_millis.elapsed());
    Serial.print("sw_micros=");
    Serial.println(sw_micros.elapsed());
    Serial.print("sw_secs=");
    Serial.println(sw_secs.elapsed());
    lcd.clear();
    lcd.print("SECS:");
    float sec = sw_millis.elapsed()/10;
    lcd.print(sec);
  int elapsedMinutes = (currenttime / 60000L);
  int elapsedSeconds = (currenttime / 1000L);
  int elapsedFrames = (currenttime / interval);
  int fractionalSecs = (int)(elapsedSeconds % 60L);
  int fractional = (int)(elapsedFrames % frameRate);       // use modulo operator to get fractional part of 100 Seconds
   fractionalSecs = (int)(elapsedSeconds % 60L);        // use modulo operator to get fractional part of 60 Seconds
  int fractionalMins = (int)(elapsedMinutes % 60L);        // use modulo operator to get fractional part of 60 Minutes
   lcd.clear();                                         // clear the LCD
lcd.print("TIME:");



   if (fractionalMins < 10){                            // pad in leading zeros
      }
    lcd.print(itoa(fractionalMins, buf, 10));       // convert the int to a string and print a fractional part of 60 Minutes to the LCD
      lcd.print(":");                                 //print a colan.
if (fractionalSecs < 10){                            // pad in leading zeros
      lcd.print("0");                                 // add a zero
      }
lcd.print(itoa(fractionalSecs, buf, 10));          // convert the int to a string and print a fractional part of 60 Seconds to the LCD
   lcd.print(":");                                    //print a colan.
if (fractional < 10){                                // pad in leading zeros
      lcd.print("0");                                 // add a zero
      }
lcd.print(itoa(fractional, buf, 10));              // convert the int to a string and print a fractional part of 25 Frames to the LCD




    lcd.setCursor(0, 1);



    endtime = currenttime;
    lcd.print(sw_millis.elapsed());
    lcd.setCursor(0, 1);



    lcd.print("us=");
*/
  delay(10);
}
// if (val1 == LOW){
//       digitalWrite(ledPin, LOW);}
else{
  lasttime = sw_millis.elapsed();
//  endtime = (sw_millis.elapsed() - starttime);
//  endtime = (currenttime - starttime);
digitalWrite(ledPin, LOW);
  int elapsedMinutes = (endtime / 60000L);
  int elapsedSeconds = (endtime / 1000L);
  int elapsedFrames = (endtime / interval);
  int fractionalSecs = (int)(elapsedSeconds % 60L);




int fractional = (int)(elapsedFrames % frameRate);       // use modulo operator to get fractional part of 100 Seconds
int fractionalMins = (int)(elapsedMinutes % 60L);        // use modulo operator to get fractional part of 60 Minutes
lcd.clear();                                         // clear the LCD
lcd.print("TIME:");



   if (fractionalMins < 10){                            // pad in leading zeros
      }
    lcd.print(itoa(fractionalMins, buf, 10));       // convert the int to a string and print a fractional part of 60 Minutes to the LCD
      lcd.print(":");                                 //print a colan.
if (fractionalSecs < 10){                            // pad in leading zeros
      lcd.print("0");                                 // add a zero
      }
lcd.print(itoa(fractionalSecs, buf, 10));          // convert the int to a string and print a fractional part of 60 Seconds to the LCD
   lcd.print(":");                                    //print a colan.
if (fractional < 10){                                // pad in leading zeros
      lcd.print("0");                                 // add a zero
      }
lcd.print(itoa(fractional, buf, 10));              // convert the int to a string and print a fractional part of 25 Frames to the LCD
    lcd.setCursor(0, 1);
    lcd.print("ACTUATOR TIMER");
}
}
// End of the program

      lcd.print("0");                                 // add a zero

fractionalSecs = (int)(elapsedSeconds % 60L);        // use modulo operator to get fractional part of 60 Seconds

    lcd.print(sw_micros.elapsed());

/*  lcd.print(" ms=");

    lcd.print("ACTUATOR TIMER");

      lcd.print("0");                                 // add a zero

#include

Step 6Packaging


i
Packaging
  • Image1285.jpg
  • Image1286.jpg
Packaging is always fun.. Just pick-up whatever you could come up with from the mighty treasure junks... you can make wonders...


Do visit my space for more updates on my Arduino erector kit.

See my Instructables below for full version of this article
http://www.instructables.com/id/Arduino-Based-Auto-Timer-Stop-Watch-Timer-for-st/


Thursday, April 26, 2012

LIFE... THE GREATEST PREDATOR OF MANKIND


Three more days is all I have.

Here I am languishing like a brat.. in full of deplorable and inexorable state..

Guess i've made a huge mess out of myself... For I had the choices with-in me aplenty paying a big tribute to my slothful life

All my dreams have gone so huge as they now look staggeringly unsurmountable... Like the way these twenty-twenty matches happens at times when the asking rate goes on rather disarrayed multitudes that are so improbable to score even given that all the legal deliveries are scored for a maximum...

Not that I haven't seen it coming. I've been trying to ward off the perilous happening all the while. The only way I could've done that is by showing some real acrion which I gravely lacked.

Having all but no chance to stop the inevitable from happening. I've got to give-in to the life's demand driven by social ire...

Yep... Three days is all I have before my life draws close to the world of my dreams, delusions rather tumultuous and designed to fail.

Hope I could do with the changes all of which set to follow for I had to change course and steer through from the insipid, placid lake to a place of high current. It could be the wild roaring river from a waterfall or rather be the infinite ocean's pulsating waves.

Life can take you to places it wishes to if you let it drive on its own after getting carried away with all those delusions. For I have absolutely no HOPE whatsoever now of getting anywhere than an ordinary man can get to.

To all those fortunate souls out there, I the hapless soul, slothy SOAB hereby concede my DEFEAT to LIFE... THE GREATEST PREDATOR OF MANKIND....

Friday, March 30, 2012

The real face of Indian Sports Authority - An institutional Failiure

Pathetic.. I know no other words to say.. The sports authority of India is in absolute shambles... They seem to see nothing beyond cricket as sports. Its unfortunate that such a non-mainstream sports is favoured or rather worshiped than anything else..

Should sachin be awarded Bharat ratna...?? Damn it I say.. even he wouldn't agree to be awarded the highest honor at the cost of other sport for the modest person he is...
Inset Message: Shashikant Hotkar , winner of Mumbai Shree for the year 2011, making papad with his family in Dharavi Slum , Mumbai.

We give so much importance to cricket and cricket players as compared to other games.. though these players perform well they still need to struggle in the daily life for living!!!!! Though they r doing hard work for making records for Indian games they doesn't get any help frm government... emphasizing the real need to change this situation



Its not about Shashikant or whether he deserves whatever he does, the perennial question is what the Sports Authority of India is doing with the worlds second largest population. Had they provided the sufficient infra structure with proper maintenance the situation would be rather different.
Its the very reason that we still are languishing at the bottom of the table every olympics struggling so hard to clinch atleast a Bronze cheering the mediocre success and crediting that to the non-sense sports Authority and the IOC who did not even to care to move their ass out for anything other than abusing the institution while even every small african countries and with people not even equalling the population of the capitol. 
When are we going to realize this very fact and act. I guess whatever the changes should be proposed should start fundamentally. Thatz where we lack. We lack the very foundation. We lack the very infrastructure. We lack the very culture where sports is treated in par with the success of other professions. Can you imagine somebody saying I play kabbadi or I play Football in india when they were asked what you do for a living ?? We'd joke at them as losers. 
This is what we should change and the rest takes care by itself when we introduce the sports as a compulsory eductaion or rather give more emphasis by giving some more credits like we do for Arts, languages, Mathematics and science.
I dont really know if these things gonna happen during my lifetime or the respected politicians would spare some time from facing their never-ending list of cases of corruption, crime, treason and the likes. Not that i should be worried about it now for I have long lost the grip of playing tennis or cricket and just play Ping pong to cut loose stress out of the maniacal work only tuning me to be a moron every progressing day.

Saturday, March 24, 2012

Life is a Battle field....

Not that I belong there anymore... It seems mid-life crisis is fast catching up.. So much.. So early... Life is not a pleasant ride anymore.. not that I wanted it to be for I always preferred to ride the tide than to watch the calm picturesque sea in solitude... 

But, life seems fast fading away.. with everyday wrapping up to another brutal, grueling day of exhaustion, experience reminding me of my way cast away from all that i've dreamt in more than one dimensions... May be I dont have it in me anymore (not that I had it ever, may be its just me..)

Trying hard tumultuously to find ways of sobering up and having ended up again and again where it all started... hoping dismally the days of misery will shomehow wash away in a licketysplit like a dream fast fading.... only these words echo in my mind everytime i take an insipid breath dozzed off asthalin deep down my throat amid wild gasps and drawing hums suffocated out of eosinophilia..

Fear not restless mind,
For the days are longer
and the winds are stronger

Worry not for what did you not find
for the worst is far from over
and the dust will make you sober

Bother not for all that you've become
For The tide would only last till the seasons gone
the fads who flow would fall along

tis time for the tide to turn and swords be drawn
for the battle of the life is finally on
just take a deep breath of silence 
for its time you wield your willow for a HOME RUN !!!


Saturday, March 17, 2012

Alexander Pushkin - Winter morning - Russian literature


One of those poems of Alexander Pushkin - part of things that keeps me going...

Therez nothing better than russian classics to brake cluttered soul to a soft slumber

Reading Alexander Pushkin's Eugene Onegin is just an experience as self-contemplation as both can brings you down to tears. One my the sheer multitude of his thoughts prompting the worthiness of our living having only the mind to read and relish and the later by revealing your true self to yourselves and how wasteful a life i lead without even a pinch of purpose to it.

Pushkin is the mozart of literature even personally akin to his life to some degree. Though his life was always described as poignant, paradoxical, fickly and the likes he rose as an invincible master of literature amdist the western and european contemporaries.

I had read from a prose in one of book i read during those may days which i still remember calls him a man of parody. He lived in a world of delusions thinking himself awful and yet living with beautiful women of his days.

Eugene Onegin is still considered to be one such paradoxical work http://www.cogsci.indiana.edu/EugeneOnegin.html


Winter morning - Alexander Pushkin

Cold frost and sunshine: day of wonder!
But you, my friend, are still in slumber -
Wake up, my beauty, time belies:
You dormant eyes, I beg you, broaden
Toward the northerly Aurora,
As though a northern star arise!

Recall last night, the snow was whirling,
Across the sky, the haze was twirling,
The moon, as though a pale dye,
Emerged with yellow through faint clouds.
And there you sat, immersed in doubts,
And now, - just take a look outside:

The snow below the bluish skies,
Like a majestic carpet lies,
And in the light of day it shimmers.
The woods are dusky. Through the frost
The greenish fir-trees are exposed;
And under ice, a river glitters.

The room is lit with amber light.
And bursting, popping in delight
Hot stove still rattles in a fray.
While it is nice to hear its clatter,
Perhaps, we should command to saddle
A fervent mare into the sleight?

And sliding on the morning snow
Dear friend, we'll let our worries go,
And with the zealous mare we'll flee.
We'll visit empty ranges, thence,
The woods, which used to be so dense
And then the shore, so dear to me