What is the best serial communication app for arduino

Well, talking with my personal experience I've found BlueSerial Beta is the best app for Android devices. It's very simple to use, just connect via bluetooth and you are sorted. You can get reading from different sensors and send commands to control things. 

One more thing I liked about this app is that, it doesn't get your privet informations. For example: your phone status, media files, connection to your wifi and all those bullshit that some apps ask for. 

It makes me very angry when an app ask for permission of something that is not relevant, like asking for permission of getting call status when I just use the app for Arduino serial communication. I don't get that! Unless they trying to get your info and do business with it.

Anyway this app doesn't require that kind of permissions.

On command Arduino timer



Well in this post you will know how you can turn on something for certain time and then turn it off, simply by sending some command via serial monitor.

Let's see the sketch first.
The sketch

int led = 4;

void setup() {
  Serial.begin (9600);
  pinMode(led, OUTPUT);

}
String str;

void on(){
  digitalWrite(led, HIGH);
}

void off(){
  digitalWrite(led, LOW);
}

void onesec(){
  digitalWrite(led, HIGH);
  delay(1000); // Change the numbers if you need to.
  digitalWrite(led, LOW);
  Serial.println("The led is off now.");
}

void fivesec(){
  digitalWrite(led, HIGH);
  delay(5000); // Change the numbers if you need to.
  digitalWrite(led, LOW);
  Serial.println("The led is off now."); 
}

void tensec(){
  digitalWrite(led, HIGH);
  delay(10000); // Change the numbers if you need to.
  digitalWrite(led, LOW); 
  Serial.println("The led is off now.");
}


void loop() {
 
if(Serial.available())
{
str = Serial.readStringUntil('\n');

if(str == "1s"){
Serial.println("Led turned on for 1 second.");
onesec();
}
  if(str == "5s"){
Serial.println("Led turned on for 5 seconds.");
fivesec();
  }
 if(str == "10s"){
Serial.println("Led turned on for 10 seconds.");
tensec();
  }
  if(str == "on"){
Serial.println("The Led has been turned on.");
on();
  }
   if(str == "off"){
Serial.println("The led has been turned off.");
off();
  }
 }
}


What are the functions?
  • Turns on the led for 1 second and command is "1s".
  • Turns on the led for 5 seconds and command is "5s".
  • Turns on the led for 10 seconds and command is "10s".
  • Turns on the led and command is "on".
  • Turns off the led  and command is "off".
Note:
The led is just for an example, you can control many other stuff with this sketch or just by changing a bit.

How to set the numbers?
In Arduino there are 1000 miliseconds in a second so you might have to do the math, but here are few examles for you.

1000 = 1 second
10000 = 10 seconds
30000 = 30 Seconds
60000 = 1 minute

900000 = 15 Minutes
1800000 = 30 Minutes
2700000 = 45 Minutes
3600000 = One hour.
36000000 = 10 Hours
And the rest of it I think you can do it by yoursel.

How to download YouTube Thumbnains

Have you ever found a nice Youtube thumbnail and thought to download it, but didn't know how to do it?
Well in this post you will find out how you can download the original size of a Youtube thumbnail that you want.

1. Click on the video you want thumbnail from.
2. Press and hold "Ctrl" and then click on the letter "U" (Ctrl+U).
3. Press and hold "Ctrl" and then click on the letter "F" (Ctrl+F).
4. Copy "thumbnailurl" and paste in the small search box (usually at the bottom of the page).
5. Click on the URL next to thumbnailurl.
6. Right click on the image and click on "Save image as".

If you are a Youtuber then you migh ask what's the best custom thumbnail size?
Well, what I have found the most perfect size was 791x483 (Width=791pixels and Height 483pixels).

How to embed a Youtube video and set where to start the video from and where to stop

In this post I will show you how you can embed a YouTube video and set the video where it should start and where it should stop.

First let's look at the code:

<object width="640" height="385">
<param name="movie" value="https://www.youtube.com/v/FB1cCoib7xQ&hl=en_US&start=143&end=180"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="https://www.youtube.com/v/FB1cCoib7xQ&hl=en_US&start=143&end=180" type="application/x-shockwave-flash" allowscriptaccess="always" width="640" height="385"></embed></object>

As you can see yellow and green highlighted places. These are the places where you need to make a change. For example:  start=143 the numbers you see after = is actually numbers of seconds, so that means you telling the player that it should start playing the video after 143 seconds.

The end=180 means you telling the player to stop after 180 seconds.

FB1cCoib7xQ This is the video ID, you can copy any video ID from YouTube and paste in the green highlighted place and it will play that video.   

Note:
Remember both start and end numbers should be the same (I mean if the first start number is 60 than the second start number should be 60 too).

How to make it play automatically?
By putting &autoplay=1 after the end code you can make it play automatically.

<object width="640" height="385">
<param name="movie" value="https://www.youtube.com/v/FB1cCoib7xQ&hl=en_US&start=143&end=180&autoplay=1"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="https://www.youtube.com/v/FB1cCoib7xQ&hl=en_US&start=143&end=180&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" width="640" height="385"></embed></object>

How to download a portion of a youtube video

Well, it's very easy! I've been asked so many times about this matter that I've lost the count. Anyway I though why not write an article about it and give the link to them.
OK, let's start with the Video.

Step 1:
Open the site called www.clipconverter.cc and then go to YouTube and open which ever video you want get a portion from.

Step 2:
Copy the URL of that video (which you will find at the top) and paste the URL in the box on www.clipconverter.cc






Step 3:
Choose the video format you like MP4, 3GP, AVI or MOV then choose where you would like the video to start from and where you like the video to end, and then click "continue". 

Step 4:
Choose the video Quality and click on "Start" or you can click on "Download" aswell, but in that case it will not convert the original YouTube video.


Step 5:
It's done now you can download the video.


Note: If you want to download audio then use the same method but choose audio format like MP3, M4A or AAC

That's all for this post. Enjoy!!!

How to delete an app from facebook page

If you are having problem with any Facebook Apps and you want to remove it, but you don't know how to do it, than this post will show you how easily you can remove an app from Facebook page.

Step one:
Log in to your Facebook and on the tab click on the "More" and then click on "Manage Tabs".


Step two:
After clicking on the "Manage Tabs" it will pop up a small window where you will see a tab "Add or remove tabs" click on that.

Step three:
Now we are on the final page, where you can see all the apps you  have installed. Click on the small "x" which ever app you want to remove.

That's all for this post, hopefully it helps you. :)

Sketch for MQ135 air quality control sensor



In this post I'm going to share the Arduino sketch for MQ135 (air quality control sensor). I've tried the sketch and it gets reading pretty well. I've tried in my room, on a gas cooker and in the bin. I've found the highest reading on gas cookers, as you probably already know why. So this sensor can be very useful in many places and with this sketch you will be able to control many things too. Over here I've just used a LED, but obviously you can control other stuff aswell instead of LED, it's just for an example.

The sketch

int led = 5;
void setup() {
// initialize serial communication at 9600 bits per second:
 pinMode(led, OUTPUT);
 Serial.begin(9600);
}


void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);

if (sensorValue >=150){
  Serial.println(sensorValue);
    digitalWrite(led, HIGH);
  }
  else {
Serial.println(sensorValue);
    digitalWrite(led, LOW);
  }
 
delay(100);
}


  • When the reading value goes above 150 it will turn the led on otherwise the LED will be be turned off. You can change value "if (sensorValue >=150){" as you wish.
  • As you can see in the diagram (at the top) that the VCC from the sensor going to 5V of Arduino, and GND of sensor going to GND of Arduino, and Aout of the sensor going to analog pin 0 of Arduino. You can change the pin but you have to change in the sketch "analogRead(A0);" aswell if you change it.
* This sketch takes 10 readings in a second "delay(100);" you can take more or less readings just by increasing or decreasing the number.

Note:
  • This sensor draws lot of power so you might have to connect to external power if you need to.
  • To get the actual reading you have to wait a bit, because you will get high reading at the beginning and then when it comes down until it starts showing the readings which doesn't go down any more.

That's all for this post I thing, if you didn't understand anything you can let me know by leaving a comment below. Thanks

What makes spammers to spam?

Well, after reading too many spam comments I thought my self, why do people spam and what make them write these spam comments?

After thinking about it for some time I kind of got the reason behind it (spam) and solution to get around it.

The reason behind the spamming is: 
*Pleasure*  
Most of us has got a goal in our life and that ultimate goal is *Pleasure*.  We can see very clearly that 99.99% of us don't want to be get hurt  or go through hardships without any reward.

You probably think that why did I say pleasure and not success, even though people are running after success and fighting for it.

Well that's right my friend, but over here I'm talking about the enjoyment and pleasure you get after success. 
Let me give you an example. If someone says to you that if you pass your driving test, you will be ban from driving for ever. Will you go for the driving test? No, I don't think so. On the other hand (without the ban statement) you get so much benefits and enjoyments after the passing your driving test, and because of this benefits and enjoyments people go through so much hardships. 

You will get many more examples like this but any way coming to the point. So even spammers have goals, and they want to enjoy their lifes too. 
But how can they do that? 
Well, they need money of course. 
And how will the money come? 
It needs to have some kind of source, and that source is online spamming (if they are looking for money online). There are many ways of spamming online but one of them is dragging visitors to their websites. 

How do they do it?
They drag visitors by posting comments and leaving links with it, it doesn't matter to them that the comment they leaving is actually going with the article or not. They know someone will definitely click on that link and that's the main purpose of putting the link.

Solving the problem:
If you (spammers) think carefully, you can solve this unwanted spamming problem with few simple ideas.
  • Collaborating with other bloggers and website owners.
  • List of link. You can spare some space on your site and put all the links of collabrators' sites and they can do the same, so if any visitor finds something interesting they will visit other sites from yours and at the same way you will get visitors from other sites.
  • Rotating links. Well, if can't afford space for a list then you can put a rotating script which will rotate one or two links every time someone visits the site or refreshes the page.
  • Writing an article and share it with others. In this one what you can do is that write an full article and give it the other website owner and tell him to link with your site. In this way you will get visitors too.

  • Buy visitors. I know you might not like this option but think about it, if you don't like the free options above then why can't you buy visitors and stop annoying other people.
 I hope this will help you to stop spamming on other sites. :)

Deleting sent messages on Viber



Did you know that you can now delete your sent massages on viber? Well, yes that's right! So from now on no more embarrassment and awkward feelings when you send a wrong message to a wrong person or apologizing for spelling mistakes. You can just delete the sent message and send a new one, the other person won't be able to see your deleted message.

Actually the other day I have seen an article about this, so I thought why not share with you lot so that you can get benefited aswell.

How can you do that?
It's very simple, just update your Viber then click on the message you want to delete, and hold on for a second or so, then you will see few options on your screen, then click on "Delete for everyone".

So step 1: Update the Viber.
      step2: Click & hold on the message.
      step3: Click on delete for everyone.

That's all, I hope it will help you. :)


Newly posted:
Reason why rich getting richer and poor getting poorer