Thursday, 31 March 2016

How to get football notifications without an app

If you are a football lover then you probably want to know what's going on on the football pitch all the time, but unfortunately if you are busy you might miss those special moments. Not any more missing out from now on, because now I will show you a site where you can see live commentary and set the notifications as you wish without any apps.

You probably say what's wrong with app? Just download from app store and install it.
Well, I know it's easy to do that but how many apps would you like to download? If you download apps for everything then your mobile will be full of apps and it will be hard to navigate through the other apps.

Any way coming to the point and the site is called bet365. You might be thinking that it's a betting site. Yes it is a betting site, but I'm not telling you to go and bet. I'm saying that it has some good features that you can use without even betting.

Hopefully you will enjoy the tip!


Wednesday, 30 March 2016

Need help to set up BV107_1 WiFi to Serial


I bought this about two weeks ago from ebay.
And after going through the step by step procedure, I couldn't make it work. So I thought the seller might help me out if I ask him, but unfortunately it turned out useless.
He says "what did you expect would happen?".
What kind of question is that? Of course I wanted to transfer and receive data via this module. I did reply to him but he didn't reply me back so I need help from you. If know how to set it up please let me know in the comment below. Thanks :)

How influential is UNILAD?


Well it's hard to say how UNILAD started at the beginning. It's probably started with a small Facebook fan page (which posted funny stuffs occasionally) but now it has grown massive. It has many pages on Facebook it self and the main page has got nearly 13 million likes. It seems like it can turns anyone's life around in matter of days.

Let me just give one example, yesterday they posted a video from YouTube which gone viral after posting on UNILAD.


That channel (Casually Explained) had about 47,000 subscribers but in one day it's blown up to 110,671 by getting 63,585+ in one day.

How lucky are those people who've managed to grab the attention of UNILAD an made their life brighter!


Friday, 25 March 2016

Plant asks for water when it needs and somebody around it




In this post I'm going to share a sketch which can make a plan talk (ask for water) if anyone goes next to it. Let me tell you how it works. First it takes the readings from soil moisture sensor. And when it detects that the plant need some water, it turns on the motion sensor and then if anyone goes front of the motion sensor it (motion sensor) triggers the Mp3 player to play the sound.

You might be thinking what's the point making this with motion sensor?
Well even though you can make it without motion sensor, but that will keep playing the sound again and again. And on the other hand if you add the motion sensor it will only play the sound when someone around it and that seems kind of real interaction to me.

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
int led = 7; // pin for led
int sensor = 2; // pin for motion sensor


void setup()
{
  pinMode(sensor, INPUT);    // initialize sensor as an input
  pinMode(led, OUTPUT);
      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
}


void motionsensor(){ // This function is for motion sensor.

  if (digitalRead(sensor)){  
  sendCommand(CMD_PLAY_W_VOL, 0X1E001); //play the sound track
  delay(5000); // length of the sound track
    } 
}


void loop() {

delay(1000); // gets the readings after 1 second
 int sensorValue = analogRead(A1); //analogue pin 1 for soil moisture sensor

  if (sensorValue >=500){
    Serial.println(sensorValue);
    digitalWrite(led, HIGH);
    motionsensor();
  }
  else {
    Serial.println(sensorValue);
    digitalWrite(led, LOW);
  }
  
}

void sendCommand(int8_t command, int16_t dat)
{
  delay(20);
  Send_buf[0] = 0x7e;
  Send_buf[1] = 0xff;
  Send_buf[2] = 0x06;
  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 do you need?
1x Motion sensor
1x Soil moisture sensor
1x Serial mp3 player
1x Micro SD card where you will save the sound track, make sure you name it 001.
1x Arduino board
1x led (this led will give visual indication that the plant needs water.)
1x Resistor (to make the led less bright)
few wires that's all.



Wednesday, 23 March 2016

Security alert for motor motorbikes



No wonder we shouldn't look down to anyone. This inventor from Bangladesh has made security alert for motor motorbikes even though he didn't have much resources.

With that device you can start the ignition and turn it off by using a mobile phone. If anyone tries to start the motorbike and take it away, you get a call from the motorbike and if you receive the call it will turn the motorbike off permanently. If anyhow they managed to start the motorbike then you send a command to the device then it will turn off and they won't be able to turn it on again. And if they still take the motorbike away by truck or anything then you can find out where the motorbike is and go there to get it.

He has managed to catch few thieves with this device. After seeing this people started thinking that his device really can privent thieves from stealing their motorbikes.
This is really an inspiring story!


সিকিউরিটি এলার্ট..
রাশেদুল বারী আবিষ্কার করেন, মটরসাইকেলচুরি রোধে সিকিউরিটি এলার্ট.!

Inventor: Rashedul Bari
From: Chundipur, Bangladesh

Dht11 and soil moisture sensor at once

Someone wanted to know how he can compile sketch of a DHT11 and a soil moisture sensor so that he can monitor humidity, temperature and moisture at the same time.

Well this is the sketch which does all those things at once plus you can control something with humidity, temperature or moisture of the soil.
Ad


The sketch

#include <dht11.h>

dht11 DHT11;

#define DHT11PIN 2
int led1 = 3;
int led2 = 4;
int led3 = 5;

void setup()
{
  Serial.begin(9600);
  Serial.println("DHT11 TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT11LIB_VERSION);
  Serial.println();

pinMode (led1,OUTPUT);
pinMode (led2,OUTPUT);
}

void loop()
{
  Serial.println("\n");

  int chk = DHT11.read(DHT11PIN);

  Serial.print("Read sensor: ");
  switch (chk)
  {
    case DHTLIB_OK:
        Serial.println("OK ");
        break;
    case DHTLIB_ERROR_CHECKSUM:
        Serial.println("Checksum error");
        break;
    case DHTLIB_ERROR_TIMEOUT:
        Serial.println("Time out error");
        break;
    default:
        Serial.println("Unknown error");
        break;
  }
int sensorValue = analogRead(A3);

  Serial.print("Humidity = ");
  Serial.print((float)DHT11.humidity);
  Serial.println(" (%)");

  Serial.print("Temperature = ");
  Serial.print((float)DHT11.temperature);
  Serial.print(" (C) ");
    Serial.println(" ");
   
  Serial.print("Soil Moisture Sensor = ");
  Serial.print(sensorValue);

 if (DHT11.humidity >60){
   digitalWrite (led1, HIGH);
 } else {
      digitalWrite (led1, LOW);
 }

  if (DHT11.temperature >30){
   digitalWrite (led2, HIGH);
 } else {
      digitalWrite (led2, LOW);
 }

if (sensorValue >=500){
    digitalWrite(led3, HIGH);
  }
  else {
    digitalWrite(led3, LOW);
  }
   delay(3000);
}


Pins:
A3 which is analogue pin 3 in the arduino, if you want you can change the pin but make sure you change the pin in the code ( int sensorValue = analogRead(A3); ) as well.

Pin 2 is for DHT11
Pin 3 is for first led which is controlled by humidity.
Pin 4 is for second led which is controlled by temperature.
Pin 5 is for third led which is controlled by soil moisture sensor.

Note:
One thing I've noticed with the soil moisture sensor is that when I connected the vcc with 3v it was getting readings up to 715 but when I connected the vcc to 5v it started getting readings 1000+ so don't really know what going on but it's up to you which ever wire you want to connect with.

Tags:
Dht11 and soil moisture code

You may also like...


DHT22 with sound alert Arduino



Controlling stuff with dht11 Arduino

Ad



Saturday, 19 March 2016

Youtube hyperlink which starts from certain place

Have ever thought of sending a Youtube link to some one and thought how wonderful it would be if you could play it from certain place?

Well don't worry you can do that very easily just by changing few characters.

https://www.youtube.com/watch?v=OHRQ9XwIsnE&#t=4m25s

You will see 11 characters after v= that's Youtube's video ID, you can change it to what ever video you want.

 &#t=4m25s After #t= is place to change. In this case we are trying to play the video to start from 4 minute and 25 seconds.

If you want to make  hyperlink for website then use this code <a href="https://www.youtube.com/watch?v=OHRQ9XwIsnE&#t=4m25s">Living With Lions In Africa</a>

You can change the video ID for different video and change the time to make it start from the place you want.

Friday, 18 March 2016

How to print different variables in a straight line? (Arduino)

I was facing this problem when I was making something in which I wanted to count how many times it turned on a led, and I wanted to print all the variables in one line but coudn't do it.

I wrote this
Serial.print("Led has been turned on ");
Serial.println(counter);
Serial.print("times.");

and the result came out like the picture below.


After trying a bit I found the solution, and that was so simple. If you want to print something in the same line then just use Serial.print and if you want to print something in a new line then use Serial.println.

After using this
Serial.print("Motion has been ditected ");
Serial.print(counter);
Serial.print(" Times.");

 I got the result below.


I thought it would be helpful to share. :)

Thursday, 17 March 2016

Counting motions with motion sensor (Arduino)




You probably wondering how you can count some activities with motion sensor by using Arduino.
Well it's pretty easy to do that by using few lines of sketch below.


int led = 6;                // the pin that the LED is atteched to
int sensor = 7;              // the pin that the sensor is atteched to

int val = 0; // variable for reading the pin status
int counter = 0;
int currentState = 0;
int previousState = 0;

void setup() {
  pinMode(led, OUTPUT);      // initalize LED as an output
  pinMode(sensor, INPUT);    // initialize sensor as an input
  Serial.begin(9600);        // initialize serial
}

void loop(){

  if (digitalRead(sensor)){   // read sensor value
  digitalWrite(led, HIGH);   // turn LED ON
    }
 
 else {
      digitalWrite(led, LOW); // turn LED OFF
    }
   
val = digitalRead(sensor); // read input value
if (val ==  HIGH) { // check if the input is HIGH
currentState = 1;
}
else {
currentState = 0;
}
if(currentState != previousState){
if(currentState == 1){
counter = counter + 1;
Serial.print("Motion has been ditected ");
Serial.print(counter);
Serial.print(" Times.");
Serial.println(" ");
}
}
previousState = currentState;   
       delay(100);
  }

What does the sketch do?
Well the sketch is for PIR motion sensor. It takes the reading from the sensor and when sensor detects a motion it turns on the led (you can turn on anything you want) and at the same time it counts how many times it detected the motion.

I didn't draw a diagram of circuit because I thought it's too easy. Anyway, enjoy! :)

Tuesday, 15 March 2016

How to count something with ultrasonic sensor (Arduino)



If you are turning on and off something with ultrasonic sensor and you want to keep a record of something that how many times the ultrasonic sensor has turned on that thing than this sketch can do the job for you.


int ledPin = 7; // pin for the LED
int trigPin = 8;
int echoPin = 9;

int val = 0; // variable for reading the pin status
int counter = 0;
int currentState = 0;
int previousState = 0;

void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
Serial.begin(9600);
}

void loop(){
delay(500);// reading will be taken after ....miliseconds
Serial.println("\n");

int duration, distance;
    digitalWrite (trigPin, HIGH);
    delayMicroseconds (10);
    digitalWrite (trigPin, LOW);
    duration = pulseIn (echoPin, HIGH);
    distance = (duration/2) / 29.1;
  
    if (distance < 15) {  // Change the number for long or short distances.
      digitalWrite (ledPin, HIGH);

    }
 else {
      digitalWrite (ledPin, LOW);
    } 

val = digitalRead(ledPin); // read input value
if (val ==  HIGH) { // check if the input is HIGH (led on)
currentState = 1;
}
else {
currentState = 0;
}
if(currentState != previousState){
if(currentState == 1){
counter = counter + 1;
Serial.print("Led has been turned on ");
Serial.println(counter);
Serial.print("times.");
}
}
previousState = currentState;
}


Remember the led is just an example. You can count many more things like how many times it (sensor) turned on the relay and so on... A screenshot can be seen below.


What do you need:
1x Led
1x 10k ohm resistor (optional) it might be be very bright without it.
1x Ultrasonic sensor
1x Arduino board
and few wires.

Note:
This works only when you keep the serial monitor open on your PC or phone, if you close it and open again than the sketch will start from one again.
Enjoy!!!

Saturday, 12 March 2016

How to control something with phone and normal switch (Arduino)


Well, in this post I want to share a small sketch which can turn on and off a relay or what ever you want via bluetooth serial monitor.

To control one thing with smart phone and normal switch we have to use "Two way switching method" like the picture below.
Ad

As you can see in picture above that you can turn on/off the light by using relay and switch.

Let's see the sketch now.

int relay = 9;

void setup() {
Serial.begin(9600);
Serial.setTimeout(100);
pinMode(relay, OUTPUT);
}
String str;

void loop() {
if(Serial.available())
{
str = Serial.readStringUntil('\n');
if(str == "z")
{
digitalWrite(relay, LOW);
Serial.println("z");
}
if(str == "x")
{
digitalWrite(relay, HIGH);
Serial.println("x");
}
 }
}


Pin 9 is for relay.
When you send letter z via serial monitor, it will turn on/off the relay and same with the letter x.

Note:
You probably thinking that why letter z and x working as same instead of telling us in the light is on or off.
Well, that's because if you make letter z to turn on the light and at the same time it tells you that the light is on, but some one else turns off the light by using the normal switch, so in this case even though the relay is on (which turned on the light) but the light will be off because of the normal switch (which turned off the light).

Please watch the video to see the sketch in action.



What do you need?
1x Aduino bluetooth transceiver.
1x 10k ohm resistor.
1x 20k ohm resistor.
1x Relay
1x Switch
Few wires and download an app called BlueSerial Beta from app store. That's all. :)
***
Tags:
Arduino bluetooth relay control

Ad


Wednesday, 9 March 2016

How to make Master and Slave ultrasonic sensors

Some one wanted to know how to make two ultrasonic sensors work together but one should be given more priority on another.

Well, that's pretty easy. You probably have seen my other post called multiple ultrasonic sensors at once on that post you can see few lines of sketch like below.
Ad

firstsensor();
secondsensor();
thirdsensor();
delay(100);

The above code shows that there are three sensors and they all work at the same time, but obviously the Arduino board collects the data from all the sensors first then prints all of them together at once.

But if you arrange them like this (code below), it will first get the data from first sensor then print it then will go for the second sensor after 500 miliseconds, and you change the delay as you wish.
firstsensor();
delay(500);
secondsensor();
delay(500);
thirdsensor();
delay(500);

So that's one way of giving priority to a sensor, but in this post I want to share a sketch by which you can control one sensor with another sensor. The true master and slave relationship.

Let's see the sketch first.
int ledPin1 = 3;
int ledPin2 = 4;

int trigPin1 = 6;
int echoPin1 = 7;

int trigPin2 = 8;
int echoPin2 = 9;


void setup() {
  Serial.begin (9600);
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
 
  pinMode(trigPin2, OUTPUT);
  pinMode(echoPin2, INPUT);
 
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
}



void secondsensor(){ // This function is for second sensor.
    int duration2, distance2;
    digitalWrite (trigPin2, HIGH);
    delayMicroseconds (10);
    digitalWrite (trigPin2, LOW);
    duration2 = pulseIn (echoPin2, HIGH);
    distance2 = (duration2/2) / 29.1;
 
      Serial.print("2nd Sensor: ");
      Serial.print(distance2); 
      Serial.print("cm    ");
  
    if (distance2 < 20) {  // Change the number for long or short distances.
      digitalWrite (ledPin2, HIGH);
    }
 else {
      digitalWrite (ledPin2, LOW);
    }   
}



void loop() {
Serial.println("\n");
  int duration1, distance1;
  digitalWrite (trigPin1, HIGH);
  delayMicroseconds (10);
  digitalWrite (trigPin1, LOW);
  duration1 = pulseIn (echoPin1, HIGH);
  distance1 = (duration1/2) / 29.1;

      Serial.print("1st Sensor: ");
      Serial.print(distance1); 
      Serial.print("cm    ");

  if (distance1 < 30) {  // Change the number for long or short distances.
    digitalWrite (ledPin1, HIGH);
    secondsensor();
    delay(100);
  } else {
    digitalWrite (ledPin1, LOW);
  }   
}

Ad

How does it work?
Well, the first sensor controls the second sensor. For example, when the first sensor picks up any object within 30cm then it will turn on the led1 and the second sensor will start working. But if the first sensor can't find anything withing 30cm then it will turn off the led1 and the second sensor will not work. But don't think that second sensor is connected to the first led, it's this code "secondsensor();" by which you can control second sensor. The first sensor is controlling both the led1 and second sensor.

That's all for this post if you want the diagram of the sketch than please have a look at top picture.


Ad


Friday, 4 March 2016

How to remove voicemail notification icon on android phones


Did this ever happened to you that you got a voicemail, and you know who sent it and you don't want to hear the voicemail, so you just tried to clear it but it never go away?

Well, that happened to me so many times and that notification icon made me pissed off. But I've found the solution so I thought why not share with other people aswel.

Step1:
Hold that icon and slide it down.

Step2:
Click and hold for a second on the "New voicemail" tab as you see in the picture above.

Step3:
When you click on the "New voicemail" tab you will see a new tab called "App info" like the picture below, and click on the "App info".

Step4: 
Now click on "Clear data" as you can see in the picture below.
Step5:
Now you should be able to see pop up window saying "All of this application's data will be deleted permanently. This includes all files, settings, accounts, databases etc." click ok.


That's all.

Wednesday, 2 March 2016

How to run a 12V water pump with soil moisture sensor



The best way you can run a 12V dc motor with Arduino is to use L293D, which can supply from 5volts to 36volts. The below diagram is for a soil moisture sensor with a motor which could be 12V DC.
Pins:
  • Pin 1,16 and 9 are for Arduino 5V only.
  • Pin 4,5,12 and 13 are for both Arduino and external power ground.
  • Pin 8 is for only external VCC.
  • Pin 3 and 6 are for motor.
  • Pin 2 and 7 are for controlling the motor which ever way you want.
Let's see the sketch now.

int motorf = 2;
int motorb = 7;


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


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

if (sensorValue1 >=600){
Serial.println(sensorValue1);
  digitalWrite(motorb, HIGH);
  }
  else {
Serial.println(sensorValue1);
  digitalWrite(motorb, LOW);
  }
 
delay(500);
}

int motorf = 2;  This is for motor to spin one way.
int motorb = 7;  And this is for motor to spin other way.

To control the spin of the motor you simply change "f" to "b" or "b" to "f" in [ digitalWrite(motorb, HIGH); ]

if (sensorValue1 >=600){ This means if moisture reading is above 600 then it will turn on the motor.


delay(500); This means it will get the reading every half a second, you can increase as you like.