Thursday, 31 December 2015

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.

Wednesday, 30 December 2015

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.

Sunday, 27 December 2015

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).

Friday, 25 December 2015

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="http://www.youtube.com/v/FB1cCoib7xQ&hl=en_US&start=143&end=180"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://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="http://www.youtube.com/v/FB1cCoib7xQ&hl=en_US&start=143&end=180&autoplay=1"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://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>

Friday, 18 December 2015

How to download portion of YouTube's video or audio

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!!!

Wednesday, 16 December 2015

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. :)

Friday, 4 December 2015

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 untill 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

Wednesday, 2 December 2015

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. :)

Tuesday, 1 December 2015

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. :)

Friday, 27 November 2015

Sketch for MQ-7 Carbon Monoxide Sensor

Right, in this post I'm going to share with you a Arduino sketch, by using the sketch you can get reading from the MQ-7 Carbon Monoxide Sensor and control many things as you like.

Before I share the sketch with you let me tell you what did I do when I got this sensor on my hand. Actually I bought this sensor by mistake. I wanted natural gas sensor which can detect the quality of the air so that it can tell me when the air gets polluted. Any way after getting this sensor I started looking for the sketch, so after some search I found a link on the Arduino website which was linked to another site, and when I clicked on it my Avast (antivirus software) didn't let me go (probably because of some kind of virus site). Then I have found another site with the sketch, but this time I didn't quite understand the sketch. So I opened my soil moisture sensor sketch and after making some changes I was able to get reading from this sensor, still I'm not sure how accurate is this but you can try it by yourself and have a look.

I think it works fine as I've tried it and got good result. :)

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 >=200){
Serial.println(sensorValue);
    digitalWrite(led, HIGH);
  }
  else {
Serial.println(sensorValue);
    digitalWrite(led, LOW);
  }
 
delay(500);
}

What does this sketch do?
Well, it measures level of the carbon monoxide in the air and turns the LED on when it reaches 200 or above. You can change it to what ever level you want and add more things to control with this sensor.

Things you need:
  • 1x MQ-7 Carbon Monoxide Sensor.
  • 1x Arduino board (in this case I've used Arduino Nano).
  • 1x LED.
  • 1x 10k Ohm resistor (just to make the LED a bit dimmer).
  • Few jumper wires.
Note:
This sketch gets readings twice a second if you want more then lower the number "delay(500);"
 according to your needs.

I hope this helps you. Thanks for reading. :)

Friday, 20 November 2015

Is trafficmsoon scam?


Well, don't get fooled by their adverts "Turn Your $10.00 Into $18.00 Every Hour" which is attention grabber and makes you fall into their trap, like I did. But luckily I didn't invest much in this seemingly scam site.

Let's see some evidence:
As you can see, I bought few adpacks here, two medium adpacks and one VIP Adpack on 2015-11-15, and even though they are different but growing up at the same rate, infact the top medium adpack is growing faster then VIP Adpack. Why is that? I thought you get more when your adpack amount is big, but over here something strange happening. I don't really know why.

Any way coming to the next question. They say "Turn Your $10.00 Into $18.00 Every Hour" but I've bought these adpacks on 15th November 2015 and today is 20th November 2015 and my $10.00 grew up to $0.13. wow, what a profit!!! I think their one hour must be our months or maybe years long.

It took 5 day to get $0.13 back then think about it, if it continues like this how long will it take to reach $18.00? well, if you divide 0.13 in 5 = 0.026 x 692= 17.992 It will take 692 days to reach $17.99 so do you call that one hour? When a company lies to its customers then that company is no longer trustworthy and reliable. Simple as that.

Before I was thinking 90% of this page (trafficmsoon) being scam, but now I'm 100% sure that this is a scam site. Let me give you another evidence. I posted this post link on the Facebook page of trafficmsoon and I told the admin not to delete the link (so that people know that trafficmsoon is not reliable) I even said to admin that if you delete this link that means you are really scammer, but he deleted the link and blocked me from commenting on that page.

If you have been fooled like me on any site like this, then please let know in comment below and help other people not to fall in any kind of trap like this. Thanks

Wednesday, 18 November 2015

Arduino doorbell with custom tunes and buttons


You might think what's so special about this doorbell.
Well, it might be not that special but think of it this way, you have three doorbell buttons and different tunes for each button. One is for your friends and family, one is for postman and one is for normal people.
Every time when postman comes he pushes the dedicated button, you will know that that's a postman, because of the different sound it (arduino doorbell) will make. So for example, you got something coming by post, you will be happy and rush to the door to open it.
Ad

You might aswel think what if post man hits the other button?
Com on, most of the time people don't play around like that, specially adults. So that means you will get the right kind of doorbell sounds most of the time.

Forget the doorbell for a moment, you can even use this sketch as a door or window alert. Something like if someone opens a door or window then it will notify you which door is open or which window is open. So this sketch could be helpful in many ways.

What do you need to make it work?
* 1× Arduino board.
* 1× Catalex Serial mp3 player with micro sd card.
* 3× Push button switches.
* 3× 10k ohm resistors.
* Some jumper wires.
* And finally the sketch, which you can find right below.
Note:
Remember you need to have three soundtracks in your sd card and rename it by 001, 002 and 003.

The sketch
#include <SoftwareSerial.h>
#define ARDUINO_RX 5//should connect to TX of the Serial MP3 Player module
#define ARDUINO_TX 6//connect to RX of the module
SoftwareSerial mySerial(ARDUINO_RX, ARDUINO_TX);
static int8_t Send_buf[8] = {0} ;

#define CMD_SEL_DEV 0X09
#define DEV_TF 0X02
#define CMD_PLAY_W_VOL 0X22

const int buttonPin1 = 8;
int buttonState1 = 0;

const int buttonPin2 = 9;     // the number of the pushbutton pin
int buttonState2 = 0;         // variable for reading the pushbutton status

const int buttonPin3 = 10;
int buttonState3 = 0;

void setup()
{
    mySerial.begin(9600);
          Serial.begin(9600);
      delay(500);//Wait chip initialization is complete
      sendCommand(CMD_SEL_DEV, DEV_TF);//select the TF card 
      delay(200);//wait for 200ms

     pinMode(buttonPin1, INPUT);
     pinMode(buttonPin2, INPUT);
     pinMode(buttonPin3, INPUT);
}

void loop() {
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3); 

  if (buttonState1 == HIGH) {
sendCommand(CMD_PLAY_W_VOL, 0X1E01);//This doorbell is for friends and family.
  }
 
else if (buttonState2 == HIGH) {
sendCommand(CMD_PLAY_W_VOL, 0X1E02);//This doorbell is for post men.
  }

else if (buttonState3 == HIGH) {
sendCommand(CMD_PLAY_W_VOL, 0X1E03);//This doorbell for is normal people.
  } 
}

void sendCommand(int8_t command, int16_t dat)
{
  delay(20);
  Send_buf[0] = 0x7e; //starting byte
  Send_buf[1] = 0xff; //version
  Send_buf[2] = 0x06; //the number of bytes of the command without starting byte and ending byte
  Send_buf[3] = command; //
  Send_buf[4] = 0x00;//0x00 = no feedback, 0x01 = feedback
  Send_buf[5] = (int8_t)(dat >> 8);//datah
  Send_buf[6] = (int8_t)(dat); //datal
  Send_buf[7] = 0xef; //ending byte
  for(uint8_t i=0; i<8; i++)//
  {
    mySerial.write(Send_buf[i]) ;
  }
}

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

Ad


Wednesday, 11 November 2015

£45k Costly argument just to prove someone wrong


Never do this kind of silly things in your life to prove someone wrong as this guy has done and now got stuck in a huge problem. Let's see what he says..

"While arguing with the missus i claimed that i do what i want and told her if i wanted to buy a helicopter on ebay then i would. She told me you cant get helicopters on ebay so i proved her wrong. Turns out when you hit 'buy it now' you don't get a second chance or a 'are you sure you have £45,000 to spend on a helicopter' message before it actions your wish to purchase such a thing. I don't really want a helicopter but it seems i need £45,000 to make it disappear from my ebay basket."

Well, because he didn't want to buy the helicopter and doesn't have enough money to make the helicopter disappear from his basket, he turned toward crowd funding and opened a page to get some help, but the funny thing is that in 12 days he only managed to raise £10.00 and few people even helped him with some nice advise.

Caroline de'Berry says:
"You could have simply requested a mutual cancel and contacted the seller!? And like a previous comment you pressed buy then confirm. I smell something in your story and it's not a cinnamon bun!"

Duane Johnson says:
"When you click buy it now you get asked to confirm . You clicked buy it now then clicked confirm .. To me your just another timewaster... Sum1 won my caravan on ebay n didnt pay i didnt turn round to them n say cheers for wating my time heres a tenner for charity...."
-------
Someone commented on this post anonymously with an irrelevant link but because it came with helpful info so I'm sharing here with all.

"I think that everything said made a ton of sense. But, what about this? suppose you added a little information? I ain't suggesting your content is not solid., but suppose you added a post title that grabbed a person's attention? I mean "£45k Costly argument just to prove someone wrong." is a little boring. You might look at Yahoo's home page and watch how they write post headlines to grab people to open the links. You might add a video or a pic or two to grab readers interested about what you've got to say. Just my opinion, it could bring your posts a little bit more interesting. Here is my web site......"

Well, first of all thank you very much for a nice advice and suggestion. I don't really know if anyone shares my post or not, I thought I just write sometimes some tips (which most of it my own experiences) and sometimes just some common sense stuff, just to entertain and have some laugh or take some lesson from it.

You've said the title is boring and talked about how to grab people's attention.
Well, first of all I'm not a professional article writer, but hopefully I will become one some day if professional people like your self  keep advising me and suggesting me. So thanks a lot. :)

Thursday, 5 November 2015

How to play soundtracks with Catalex Serial MP3 Player


It took me long time (few hours a day for few days) to find out how this mp3 works. Let me tell you what really happened. I just wanted to play some sound tracks on command in Arduino, so I thought let me buy a serial mp3 player and put all the sound tracks in a micro SD card and then play them on command which ever I want.
Ad

That's why I bought the mp3 player above, but unfortunately they didn't send an user manual with it. So I started searching on the net as usual, but couldn't find it, after looking for long time finally I've found one, but the manual was so difficult to understand that I thought what's the point making this kind of manual if people can't understand easily.

Then I turned to one of my Arduino expert friend and asked him for help, but he was kind of busy and was not replying my massage for few days. So I thought you know what let me just try myself and experiment with the code, and then let's see what happens. So after working hard I came up with this simple sketch with few useful options.

Let's see some specification:


What to do?
1. Format your SD card @ Fat16 or Fat32

2. Rename all the sound tracks as 001, 002, 003 and so on. If you want to remember which track is which, then write the name after the numbers, for example 001soundofbird, 002dogbark and so on.
One thing keep in mind that when you write the name, never leave a space between the words, for example 001 sound of bird002 dog bark and so on.

3. Copy  those sound tracks and paste on the card. Remember not to make any folder/directory in SD card. Please see my other post if you want to play songs from other folders.


What does the sketch below can do?
  • If you have uploaded the sketch successfully then it will play the first sound track when you first open your serial monitor or press the reset button.
  • Play  soundtrack on command . That means it will play which ever soundtrack you tell it to play.
  •  Pause, it can pause the playing soundtrack.
  • Play, it will play the soundtrack after pausing.
  • Play next soundtrack.
  • Play previous soundtrack.

Ad

The sketch
#include <SoftwareSerial.h>
#define ARDUINO_RX 5//should connect to TX of the Serial MP3 Player module
#define ARDUINO_TX 6//connect to RX of the module
SoftwareSerial mySerial(ARDUINO_RX, ARDUINO_TX);
static int8_t Send_buf[8] = {0} ;

#define CMD_SEL_DEV 0X09
#define DEV_TF 0X02
#define CMD_PLAY_W_VOL 0X22
#define CMD_PLAY 0X0D
#define CMD_PAUSE 0X0E
#define CMD_PREVIOUS 0X02
#define CMD_NEXT 0X01

void setup()
{
    mySerial.begin(9600);
          Serial.begin(9600);
      delay(500);//Wait chip initialization is complete
      sendCommand(CMD_SEL_DEV, DEV_TF);//select the TF card 
      delay(200);//wait for 200ms
      sendCommand(CMD_PLAY_W_VOL, 0X1E01);//play the first song with volume 30 class
}
String str;
void loop() {
if(Serial.available())
{
str = Serial.readStringUntil('\n');

if(str == "2")
{
sendCommand(CMD_PLAY_W_VOL, 0X1E02);//play the second track with volume 30 class
Serial.println("Second sound track.");
}
if(str == "3")
{
sendCommand(CMD_PLAY_W_VOL, 0X1E03);//play the third track with volume 30 class
Serial.println("Third sound track.");
}
if(str == "4")
{
sendCommand(CMD_PLAY_W_VOL, 0X1E04);//play the forth track with volume 30 class
Serial.println("Forth sound track.");
}
if(str == "ps")
{
sendCommand(CMD_PAUSE, 0X0E);//pause the playing track
Serial.println("Pause");
}
if(str == "pl")
{
sendCommand(CMD_PLAY, 0X0D);//play it again
Serial.println("Play");
}
if(str == "pr")
{
sendCommand(CMD_PREVIOUS, 0X02);//play previous track
Serial.println("Playing previous track.");
}
if(str == "nx")
{
sendCommand(CMD_NEXT, 0X01);//play next track
Serial.println("Playing next track.");
}
 }
}

void sendCommand(int8_t command, int16_t dat)
{
  delay(20);
  Send_buf[0] = 0x7e; //starting byte
  Send_buf[1] = 0xff; //version
  Send_buf[2] = 0x06; //the number of bytes of the command without starting byte and ending byte
  Send_buf[3] = command; //
  Send_buf[4] = 0x00;//0x00 = no feedback, 0x01 = feedback
  Send_buf[5] = (int8_t)(dat >> 8);//datah
  Send_buf[6] = (int8_t)(dat); //datal
  Send_buf[7] = 0xef; //ending byte
  for(uint8_t i=0; i<8; i++)//
  {
    mySerial.write(Send_buf[i]) ;
  }
}

What are the  commands in this sketch?
  • If you send 2, 3 or 4 via the serial monitor then it will play the second sound track, third sound track or forth sound track. What ever number you choose it will play that track and the text will appear on monitor that which track is playing. For example if you send 3 then it will play the 3rd track and you will see "Third sound track." on the serial monitor.
  • ps is for pause. If you want to pause any sound track which playing right now, then just send ps and it will pause straight way.
  • pl is for play. If you want to play it again after pausing then send pl it will start playing the same track again from where you left from.
  • pr is to play the previous track.
  • nx is to play next track.

Which Arduino board does it support?
Well, in the manual it says "Compatible with Arduino UNO / Leonardo / Mega2560 / DUE" but I have tried with Arduino Nano and it's works perfectly, so I hope it will work with other board too.

Places to edit:
* If you don't want to hear the first sound track automatically, when ever you open the serial monitor or press the reset button, then delete this (sendCommand(CMD_PLAY_W_VOL, 0X1E01);//play the first song with volume 30 class) line from the sketch.

*
if(str == "2")
{
sendCommand(CMD_PLAY_W_VOL, 0X1E02);//play the second track with volume 30 class
Serial.println("Second sound track.");
}
As you can see number 2 in "2" which you can change to somthing else to play second sound track. For example "track 2" or "my love" in which ever way it will play the same soundtrack and that is soundtrack number two. You can change the serial print "Second sound track." to what ever you want.

Note: You can do this to other functions too. For example ps, pl, pr, nx and so on.
 
* Choosing sound track to play.  For this simply change the number at th end of this (0X1E02).

* Play with volume. Unfortunately I only know two level of volume in this 15 and 30 the code is below.
sendCommand(CMD_PLAY_W_VOL, 0X0F01);//play the first song with volume 15 class
sendCommand(CMD_PLAY_W_VOL, 0X1E01);//play the first song with volume 30 class

Can you send commands by using mobile phone? 
Of course you can. There is an app called BlueSerial Beta which is very useful, I use a lot.

That's all for now, if I find out more options I will try to add on and in the meantime you can let me know if you didn't understand anything in this post or if you have found out some new function code. Thanks a lot. :)
Ad



Friday, 23 October 2015

How to fix sound problem in windows 8


Few weeks ago I had a sound problem in my laptop (which runs on windows 8) but I could not think of any fault, so I thought let me just restart the laptop and see what happens. So I've re started the laptop and the sound came back. I said wao that was pretty easy!! But unfortunately it happened again yesterday and I thought last time I restarted the laptop and it started working. So why not do the same thing again. Then I have restarted the laptop, but didn't work. Did it again still didn't work. When I saw it is not working at all, then I did the final check up which you can see below.
Ad

Step1: Go to the control panel.

Step2: Click on Hardware and Sound

Step3: Click on Device Manager. You can Skip the first two steps just by searching "Device Manager" straight in the window's search engine.

Ad

Step4: Click on the arrow next to the speaker logo, then right click on the Conexant SmartAudio HD and then click Update Driver software.


Now it will download and install the driver from the Internet (if it's out of date) and when it's successfully updated it will show a box where it says "Do you want to restart your computer now?" you just need to restart the computer.

That's all  I did and my sound is back on track. :)

Note:
If you find this problem suddenly then Restart you PC by selecting the option "Restart" when you turn you PC off. It will solve the problem automatically.


Ad



Multiple soil moisture sensor at once in Arduino


In this post I will share a sketch which can control many soil moisture sensors at once. As you can see in picture above, I have used 2 soil moisture sensors to turn on and off 2 leds. I would have used more sensors if I had but that's all I had so I have used them all. Don't worry you can add more sensors if your Arduino board has too many pins control the thing you want.
Ad

The sketch:
int led1 = 4;
int led2 = 5;

void setup() {
// initialize serial communication at 9600 bits per second:
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
Serial.begin(9600);
}


void loop() {
// read the input on analog pin 1:
int sensorValue1 = analogRead(A1);

if (sensorValue1 >=600 && sensorValue1 <=800){
Serial.println(sensorValue1);
    digitalWrite(led1, HIGH);
  }
  else {
Serial.println(sensorValue1);
    digitalWrite(led1, LOW);
  }
 
int sensorValue2 = analogRead(A2);

if (sensorValue2 >=600 && sensorValue2 <=800){
Serial.println(sensorValue2);
    digitalWrite(led2, HIGH);
  }
  else {
Serial.println(sensorValue2);
    digitalWrite(led2, LOW);
  } 
delay(1000);
}

Places to edit:
int led1 = 4; // you can change it to what ever digital pin you like.
int led2 = 5; // you can change it to what ever digital pin you like.

int sensorValue1 = analogRead(A1); // I have  made A1 (analog pin number 1) for the first soil moisture sensor and A2 (analog pin number 2) for second sensor.

if (sensorValue1 >=600 && sensorValue1 <=800){ // Here the >=600 means if the value is over 600 and under 800  <=800 then it will turn on the first LED, and if the value is under 600 and over 800 the the LED will be turned off. You can change the number as you wish, but keep in mind that less value numbers means the soil is more wet and more value numbers means the soil is less wet.

What do you need:
  • 2x LEDs. What ever color you like.
  • 2x Soil Moisture Sensors.
  • 2x 10k ohm resistor. You can leave it if you want, I've used it just to make the leds dimmer.
  • One Arduino board. In this case I've used Arduino nano.
  • Few jumper wires
That's all for this post I hope this will help you. :)


Tags:
Multiple soil sensor Arduino

Ad



Sunday, 18 October 2015

How to search hashtags on facebook?

Everyone probably knows how use #hashtags on Facebook, but do you know how to search the specific hashtag that you want?

Well, you might say, what's so hard about that? Just put hashtag (#) before the word and search it.
Hmm, not really! because I've tried that many times and that didn't work.

So what can you do?
Well, you can find the specific hashtag by using two methods as I know.

First method:
Write the word you want to search after hashtag, for example #funny and post it, after you have successfully posting it, click on the hashtag.

Note: 
This may seems easy but the problem is that you  probably don't like to post just anything and everything, because once you post something it will pop up on every single one of your friend's wall, so you might not like every people to know what you are searching for.

Second Method:
Copy the link in the brackets (https://m.facebook.com/hashtag/) and paste in your address bar, then write the word you want to search after forward slash, for example funny in (https://m.facebook.com/hashtag/funny) then hit enter or go. That's it will show all the posts under #funny.

Note:
If you are using desktop the the URL would look like this (https://www.facebook.com/hashtag/funny).


Friday, 16 October 2015

Some handy youtube shortcuts you might be interested to know


As we you know some of us have been watching Youtube years after years still some of us doesn't know some basic shortcuts of Youtube video player. So here are some tips which might save you some time and make your life bit more easier.

Tip1:
While playing the video some us hits the "space Key" to pause the video, but the pause key for Youtube is the letter {K}.


Tip2:
If you want to mute the sound then simply press the letter {M} on your keyboard.

Tip3:
Press {F} to watch in full scree and press again to make it small.

Tip4:
By pressing the letter {J} you can go back 10 second and by pressing letter {L} you can go 10second forward.

Tip5:
If you click on the left arrow {} it will go 5 seconds back and if you click on the right {
} it will go 5 seconds forward. 
Press and hold {} for going fast backward and press and hold {} to go fast forward.

Tip6:
To start from the beginning press {0}.

Tip7:
Any video on the youtube is divided into 10 equal parts like 10%, 20%, 30%, 40% and so on. You can click on any number from 1 to 9 to start watching from the percentage you want, for example if you press 5 then it will start from middle of the video and if press 9 then it will play last 10% of the video.

I hope this shortcuts will help you and hopefully you'll remember me every time you press on a shortcut key. Lol, just joking. :)


Thursday, 15 October 2015

Does fame and money make people arrogant?

Well, I was thinking not to write anything about this topic but after reading some comments I couldn't hold myself back any longer.  It made me think that why all the famous people stay humble at the beginning and when they become famous they start showing their true colour. I know you might say not all of them like that. Yes, you probebly right but we can see most of them are like that though.

So what can normal people do about it?
Well, normal people can play big role in this. Imagine the root cause of it, it's most likely fame and money, and how do they get these two things? They get it because of normal people becoming mad and hardcore fans of them. Imagine what would happen if most of the fans if not all of them ignore these (famous) people, trust me they would beg you. It happened in the past and keep happening and will happen in the future too.

Let me give you a small example. There were few youtubers and they were quite popular all over the globe, so once they said that they are going to make a tour and said to their fans that we are going to meet andgreet here and there and we are taking part in this event and that event so you lot come. And they (fans) did show up in huge amount even though they (youtubers) charged them (fans) for tickets heavily.

But something happened when they went back to their country, they got split up and they don't make much videos together any more. And recently one of them announced that he's going on tour and asking his fans to come over but guess what, this time he is not charging for the tickets. Wow big deal!!! So that's kind of indicates that he knows this time people might not come that much or probebly they might not come at all, but because he has to hold his position that's why he's making it free. So in this story we can see that fans still can drag famous people down to their knees.

OK, coming back to the main cause of writing this post. Actually recently a Youtuber from Bangladesh become popular (even though in my view he is not that popular yet) he has got 135,203+ subscribers on youtube and 146,533+ on Facebook and his name is Salman Mohammad Muqtadir.

Yes, that's him and now let's see some of his comments.

I hope you've already understood up to the "Isnt it fuuny?" but you migh get some difficulties to understand what he wrote after that. Don't worry I'll try to help you out. He says "it doesn't matter how loud you yell, or how upset you become, or how much you swear (probebly he meant at him), your reach is up to that comment box. So don't cry. I won't swear at you, you may aswel do something, I'll salute you then. I swear!"

I liked it how he said "I'll salute you if you do something" (he probebly meant good positive things maybe), but look at the other things he said to him "your reach is up to that comment box" Lol, it seems like his (Mr. salman's) reach is to every single human on earth or something. Calm down!

Not everyone is lucky like you.
Some people try their best to show their talents but they can't do it because of lack means. You probebly got popularity from your youtube videos which viewed by normal people hundreds and thousands of times, and who knows he probably one of the hundreds and thousands who made you popular. Please try to appreciate people and not hurting them.

Let's see one more comment from him.

Wow, the way he says "each penny spent on my vacation by me. I worked hard for it.", making videos, taliking or making some move front of a camera is too hard for some people. But there are so many people in the same country (BD) who work hard (by this hard I mean really hard) from morning to evening and get only 2/3 dollars a day, and who knows from many of these poor people might be fans of him.
So once someone gets too many fans then making money is nothing for him. It's just like grabbing water from the rain. Forget hardship, he can even make money jsut by sitting like a begger with some sponsored shoes (don't get me wrong, just saying).

I know how AtiQur RahMan SherLock's feeling, because I've been and still going through that situation. Tell this " life is full of blessings" to someone who doesn't have money and can't go anywhere for vacation. Forget vacation, he can't even efford to have food 1 time a day, he will tell you how life is full of blessings.

It makes people very sad when a guy in a ferrari roaming around, enjoying his life then comes to a poor guy and says "wow life is so amazing and full of blessings". Think about the situation of the poor guy, how would he feel.

Request to famous people:
Please appreciate your fans, end of the day you are what you are because of those fans. If they dump you then you'll be unknown person again and no one will recognise you. Do good stuffs, because people look upto you and everyone tries to follow you and get success in their life.

Request to fans:
Please try not be a hardcore, mentally programmed like robot fan of someone. If you see something which you think is not suitable for him to say or do, then ignore him or dump him if necessary. You'll find many more entertaining people or things in the word to entertain you.

Please don't get me wrong. Stop hating each other and spread love and make the world a peaceful place to live on. Peace!!!

Tuesday, 13 October 2015

How to make sound with soil moisture sensor


What bettar way of knowing that your plant or garden wants water by giving you sound alert! Well, in this post I'll share a sketch which exactly does that. It make a sound alert when it needs water plus turns on a led to give you a visual alert too.

Let's see the circuit now.

And the sketch.
int led1 = 4;

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


void beep1(){

  tone(8, 440, 200);
  delay(50);
  noTone(8);
  delay(100);
 
  tone(8, 440, 200);
  delay(100);
  noTone(8);
  delay(100);
 
  tone(8, 440, 200);
  delay(200);
  noTone(8);
  delay(100);
 
}

void loop() {

int sensorValue = analogRead(A2);

if (sensorValue >=300 && sensorValue <=800){
Serial.println(sensorValue);
    beep1();
    digitalWrite(led1, HIGH);
  }
  else {
Serial.println(sensorValue);
    digitalWrite(led1, LOW);
  }
delay(300000);
// reads every five minutes
}

I've already talked about led, analog pin, and value in detail on my other post, if you need help on that then please see that post. Over here I've just added one extra function and that's Arduino's built in tone function. To make the sound you won't need any extra hardware, you just need few lines of code and that is

tone(8, 440, 200);
delay(50);
noTone(8);

  • The number 8 is in the code is for buzzer or speaker, remember if you change the pin number in one place change the number from other place too. Both should be the same number, otherwise your speaker won't work. 
  • 440 and 200 is to control the pitch of the sound. It will make different sound if you change the numbers up and downd.
  • delay(50); This number is to make the sound shorter or longer.
That's all for this post. Thanks :)

Friday, 9 October 2015

Turning led on and off with soil moisture sensor

Once you know how to turn a led with soil moisture sensor then you can do anything you like, for example turning on a motor and turning it off or turn on a tap to water the garden or turning light on and off and so on.

In this post I'll share with you a simple sketch but as I've said before by changing a bit you can control lot of other things, so let's see the sketch first.

The sketch to turn a led on and off
int led1 = 4;

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


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

if (sensorValue >=600 && sensorValue <=800){
Serial.println(sensorValue);
    digitalWrite(led1, HIGH);
  }
  else {
Serial.println(sensorValue);
    digitalWrite(led1, LOW);
  }
delay(1000);
}
Pins:
  • GND of the sensor goes to GND of the Arduino.
  • VCC of the sensor goes to 3V. Even though in the manual it says it can handle 5volts and I've tried few times but it didn't work so I think 3 volts is fine.
  • A0 of the sensor goes to analogue pin 0 of the Arduino
  • I have made pin number 4 for LED but it's up to you which ever pin you want to use. 

What can you change?
  •  int sensorValue = analogRead(A0); // In this you can change the analogue pin 0 to other pins, but make sure you change in the "sensorValue" pin as well.
  •  if (sensorValue >=600 && sensorValue <=800){ // First let me tell you what this line actually does. Basically by putting 600 and 800 in the above line you telling the sensor that if the value number (which obviously tells you how moist the soil is) is above 600 and under 800 than turn on the led1 and that's done by this line digitalWrite(led1, HIGH);.
  •   if (sensorValue >=600){ // If you don't like the between value like shown at the example avobe than this code will do the trick. Basically this code means if value digits are more than 600 then it will turn the led on.
And if the moisture level is below 600 and above 800 it will turn the led1 off which is done by this line (digitalWrite(led1, LOW);). You can change the numbers (600 and 800) according to your need.
  •  (delay(1000);) This means the sketch takes reading from the sensor and prints it on serial monitor after every second, you can make it slower for example make it get the readings after each 15 minutes or faster like five times in one second as you wish.
To make it slow or fast you just need to change the number.
Here are some examples,
1000 means 1 second and
1000x60 seconds = 60000 that's one minute, and  that's how you can calculate.
That's all for this post, I hope you can make interesting things with this sketch and if you didn't understand something then please feel free to ask me in the comment below. Thanks :)

How to create clickable link in a blogspot comment

I've seen many people trying to post a comment with a clickable link on my posts, either they want to promote their websites or they want to refer to a site which explains more about that subject, which I don't mind them leaving the link on my posts, but remember I don't like people try to promote their site excessively, in that case it will be considered as a spam and unfortunately I'll have to delete it.

Any way coming to the main point, how can you make clickcble link? Well, it's simple just use normal html hyperlink code like the code below.
  • <a href="http://www.amazingtips247.co.uk/">Amazingtips247</a>
  • Remember to copy the code above from beginning to the end.
  • Replace the link (http://www.amazingtips247.co.uk/) with the link that you want.
  • Remember to name the link (>Amazingtips247<) accordingly. 
That's all for this tip, I hope you've liked it and I'm leaving the first comment as an example to let you see. :)
Note:
I'm sorry to say that my first link comment is not working, that's because I've changed to normal comment option to Google+ and I'm sure this is still works on normal blog.

Wednesday, 7 October 2015

Whatsapp hyperlink for website


In this small post I want to share with you a small yet very helpful tip. This tip is helpful for website owners, web masters, bloggers and normal visitors as well.

I'm talking about how you can share your website link straight on Whatsapp. As you know nowadays many people use their smart phones and tablets to brows the internet, and when they see something interesting and want share with their friends & families, they have to go through lot of hassle by going to the menu then clicking on the share then choosing Whatsapp then send the link to your friend.
Wouldn't it be a good idea if they just click on a link and it send the message or link straight to their whatsapp? Well, I think almost everyone will like the idea.
Ad

So let us see the code and make it work then.
<a href="whatsapp://send?text=http://www.amazingtips247.co.uk/2015/09/the-super-lucky-saudi-man.html">Whatsapp this page</a>

  • Copy the code above (from <a to /a>) and paste it on your site. 
  • Now after saving your site, open it on mobile and you will see a link like this (Whatsapp this page).
  • Now click on it.
  • Them select the person you want to send the link to, from the contact list.
  • That's it you are done. Now if someone visit your page on a moblie device and clicks on "Whatsapp this page"  and then select the person. They will see "http://www.amazingtips247.co.uk/2015/09/the-super-lucky-saudi-man.html" in their whatsapp ready to be shared. 

Remeber this works only on mobile devices.
Note:
Instead of the link if you write something for example <a href="whatsapp://send?text=This is testing message.">Send the message</a> then if someone click on "Send the message" they will see "This is testing message." in their whatsapp ready to be shared.
Ad

***
Related posts ::
How to see and save WhatsApp's sent pictures?
How to get specific whatsApp voice note from your mobile
How to share any link with Viber, WhatsApp and more (For normal people)
How to prevent WhatsApp from using up your mobile data

Friday, 2 October 2015

Circuit diagram of L293d motor driver and how to wire it up

After seeing some complicated circuit diagram of L293D motor driver online. I thought why not make it more easier for people. And that's why in this post I'm sharing a colourful circuit diagram of L293D. So that you can clearly understand which wire is going where.
Ad


In the diagram above you can see all the wires are in different colour except for both motor wires. Well, I've made it one colour for both, because the pin 3, 6, 11 and 14 can turn into + or - at any time. So I though there is no point of making  them in different colour.

OK, let's go through some important pins. Pin 3 and 6 is for left motor and pin 11 and 14 is for right motor. Pin 1, 9 and 16 for Arduino 5v and Pin 4, 5, 12 and 13 is for GND of both Arduino and the external power. Pin 2 and 7 is for controlling left motor and pin 10 and 15 is to control the right motor. And finally the pin number 8 is for v in of external power.

Now let us see the sketch, but before I share the sketch let me tell you what it actually does.
  • It starts with 2 seconds delay, just to give some time to settle down when you press the reset button.
  • Turns on the green LED to let you know that it's ready to go.
  • Goes forward 2 seconds.
  • Turns left.
  • Comes back.
  • Turns right
  • Comes back
  • Goes backward for 2 seconds.
  • It will do all the above tasks once then will stop, if you want to make it do again then press the reset button.
The sketch 


int lmotorf = 2;
int lmotorb = 3;
int rmotorf = 4;
int rmotorb = 5;
int greenled = 6;

// the setup routine runs once when you press reset:
void setup() {              
  // initialize the digital pin as an output.
  pinMode(lmotorf, OUTPUT);
  pinMode(lmotorb, OUTPUT);
  pinMode(rmotorf, OUTPUT);
  pinMode(rmotorb, OUTPUT);
  pinMode(greenled, OUTPUT);


  delay(2000);
  digitalWrite(greenled, 1);
  delay(500);
  digitalWrite(greenled, 0);
  delay(10);

  
  digitalWrite(lmotorf, HIGH);   // turn the leftforward on.
  digitalWrite(rmotorf, HIGH);  // turn the rightforward on.
  delay(2000);      // wait for a miliseconds
  digitalWrite(lmotorf, LOW);  // turn the leftforward off.
  digitalWrite(rmotorf, LOW); // turn the rightforward off.
  delay(1000);
 
  digitalWrite(rmotorf, HIGH);
  delay(500);
  digitalWrite(rmotorf, LOW);
  delay(1000);

  digitalWrite(rmotorb, HIGH);
  delay(500);
  digitalWrite(rmotorb, LOW);
  delay(1000);
 
  digitalWrite(lmotorf, HIGH);
  delay(500);
  digitalWrite(lmotorf, LOW);
  delay(1000);

  digitalWrite(lmotorb, HIGH);
  delay(500);
  digitalWrite(lmotorb, LOW);
  delay(1000);
 
  digitalWrite(lmotorb, HIGH); 
  digitalWrite(rmotorb, HIGH);
  delay(2000);
  digitalWrite(lmotorb, LOW);  
  digitalWrite(rmotorb, LOW);
  delay(50);
 
}

// the loop routine runs over and over again forever:
void loop() {
          
  delay(50);            
}


Few pin names which you might not have understood.
  • lmotorf = Left motor forward.
  • lmotorb = Left motor backward.
  • rmotorf = Right motor forward.
  • rmotorb = Right motor backward.

Just by getting control of the motors you can do lot of things. For example moving robotic arms up and down or turning it side to side and so on. This is a simple sketch, but just by editing a bit you can control the motor on your command. If you didn't understand something, please let me know in the comments below.

Let's see the sketch in action

Ad

  • l293d motor driver with motor connection
  • l293d ckt diagram
  • l293d diagram
  • l293d motor driver circuit diagram
  • l293d motor driver pin diagram
  • l293d motor driver
  • 4 motor driver circuit diagram
  • circuit diagram for motor drive
  • diagram of l293d
  • image of l293d motor driver
  • motor drive circuit from l293d
  • motor driver ic l293d circuit