Water level indicator with different colour lights

This is a simple water level indicator. The ultrasonic sensor measures the water and then turns on the different leds according to the water level.


The sketch
#define COMMON_ANODE
int redPin = 4;
int greenPin = 5;
int bluePin = 6;
int trigPin1 = 7;
int echoPin1 = 8;

void setup()
{
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
  Serial.begin(9600);
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void firstsensor(){ // This function is for first sensor.
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 >=8 && distance1 < 9) {  // Change the number for long or short distances.
  setColor(0, 255, 0); // green
 }

  if (distance1 >=6 && distance1 < 7){
  setColor(0, 255, 255);// aqua

  }
 
 if (distance1 <=5){
 setColor(255, 0, 0); // red
  }
}



void loop() {
Serial.println("\n");
firstsensor();
delay(100); 
}


void setColor(int red, int green, int blue)
{
#ifdef COMMON_ANODE
red = 255 - red;
green = 255 - green;
blue = 255 - blue;
#endif
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}

Robot that can jump, spin and does backflips


The robot technology has developed a lot, and by a lot I mean really a lot. Look at this robot, it's almost like human and doing stuff that many human can't even do that. The backflip is really a killer.

Best comments:

1. [This technology will be used by the military to invade poor countries and end lives sadly.]
2. [No power cable folks, huge leap literally.]
3. [Astonishing, quite amazing, so hard to achieve.]
4. [I cant even do a backflip myself but now there is a humanoid robot that can do it.]

Making smart bin with Arduino

With this code you can make a bin which can open its lid without touching it. It uses 2 ultrasonic sensors one is to measure how much rubbish is inside the bin and another ultrasonic sensor to open the lid if it finds that there is some more space for rubbish.

1x Arduion Nano.
2x Ultrasonic sensors.
1x Servo Motor.
1x RGB led.
1x breadboard
1x Capacitor. (To control the servo smoothly)
and quite a few jumper wires.

I won't explain more in this because the reason has been already explained in the all Arduino posts page. If you have come from the YouTube then you have already seen how cool the smart bin is.
The sketch
#include <Servo.h>

Servo myservo;
int trigPin2 = 3;
int echoPin2 = 4;
int trigPin1 = 5;
int echoPin1 = 6;
int redPin = 10;
int greenPin = 11;
int bluePin = 12;

int pos = 170;    // variable to store the servo position
#define COMMON_ANODE
void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
  pinMode(trigPin2, OUTPUT);
  pinMode(echoPin2, INPUT);
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
  Serial.begin(9600);
}


void firstsensor(){ // This function is for first sensor.

 setColor(0, 255, 0); // green
  delay(15);
 setColor(0, 0, 0); // green

  int duration1, distance1;
  digitalWrite (trigPin1, HIGH);
  delayMicroseconds (10);
  digitalWrite (trigPin1, LOW);
  duration1 = pulseIn (echoPin1, HIGH);
  distance1 = (duration1/2) / 29.1;

  if (distance1 >=5 && distance1 <=30) {  // Change the number for long or short distances.
    for (pos = 170; pos >= 90; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);             
    delay(20);                      
  }
delay(2000);

  for (pos = 90; pos <= 170; pos += 1) {
    // in steps of 1 degree
    myservo.write(pos);             
    delay(20);                      
   }
  } else {
secondsensor(); 
  }  
}

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 >=2 && distance2 <=6) {  // Change the number for long or short distances.
  full();

} else {
 delay(1000);
  firstsensor();
  
  } 
}


void full(){ // The bin is full.
 delay(1000);
 setColor(255, 0, 0); // red;
 delay(15);
 setColor(0, 0, 0); // red
full();
}

void setColor(int red, int green, int blue)
{
#ifdef COMMON_ANODE
red = 255 - red;
green = 255 - green;
blue = 255 - blue;
#endif
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}

void loop() {
secondsensor();

}




Foldable Smartphone with Dual Screen


Did you come across this Dual Screen Smartphone yet? If not then here is good news for you. Unbox Therapy has recently reviewed this smartphone which made by a company called ZTE.

Here are some noticeable features:
  1. Gorilla glass 5 on the front and back.
  2. Type-c connector.
  3. Power switch which also combination of fingerprint reader.
  4. Configurable quick launch button, could launch camera, TV mode or other.
  5. 20 Megapixel camera. It's only camera in the phone and it can be used as a selfie and main camera.
  6. Dedicated button to for changing screen display modes. Mirror, extended, dual and single.
  7. SIM tray micro SD capabilities as well. That means you can add some extra memory to the phone.
  8. 2x speakers. One bottom facing and another front facing.
  9. 4 GB ram. 64GB internal storage plus can be extended by using SD card.
  10. Operating system: Android 7.1.2 but the company working on rolling out the latest version of Android for the device.
Ad



Jane Channell hit by broom during race


Best comments:

1. Being Canadian she probably went back and apologized to the broom.

2. Damn I never heard of this sport. It actually looks like a really fun sport, going really fast with your face so close to the ground/ice. Must be an amazing view.

3. Well technically the broom didn't hit her. She hit the broom.

4. I'm surprised that she isn't furious about that.

5. I thought she was a boy when she wore the helmet.

6. The olympics are coming up soon so that's why these sport videos have been dredged up from the depths of youtube and back into recommended.

7. Video should be called: Getting chased by a broom.

8. After that broom fell, I was expecting Harry Potter to fall down.

9. Women are broom magnets.
 

How to show any YouTube comment at the top


This is a very good way to show a comment at the top. Imagine you find a very funny or important comment and you want show it to someone, when you send the video url and tell the other person to find the comment, then that person might not find the comment at all. But if you do this then he will get the exact same comment that you want him to read.
Ad

Step1: Got to the comment, doesn't matter if it's a sub-comment or the main comment. (0:17)

Step2: Highlight the comment (you don't need to highlight all of it, you can just highlight the beginning part) with the commenter's name (0:23) and the right click on it.

Step 3: After clicking on the "View Selection Source" copy the comment Id.make sure you copy it including "lc=".

Step4: Now got to the address bar and paste it right after the video id, but make sure you add "&" after the video Id and hit enter. For example https://www.youtube.com/watch?v=QXfhGxZFcVE&lc=z135in1qdn2ncnd2r22jfrng4keofrpbu04 So the yellow highlighted text is the video id and green highlighted text is comment id, but things in between them are important too.

Now you can just copy the hole url and send it to who ever you want and that person will find the exact same comment at top of all comments.
Ad



What's wrong with advertisers

Really I try my best to stay positive, but when you see most of the things happening to you are negatives then I don't think anyone still can show positivity and carry on with life. As you can see in the picture, YouTube demonetize the video because they thought it's not advertiser friendly. Really? It was just a tutorial how to download Facebook videos. It didn't have anything sexually suggestive, bad language, or anything like that. I've seen many people swearing in the video yet their videos are full of ads.

And when I requested to review it manually, they said the video needs to get 1000 views in last 7 days. In another way of saying f..k off with your video, that s..t is useless. I'm writing this as record, if my site ever get popular then I can show them the struggles I've going through. I know people don't give a s..t to unpopular people and they can suck ..... of people who becomes star over night.
Since then I've unlisted the video and possibly delete it, because what's the point of trying to help if you can't get anything in return. You probably thinking "oh you are a selfish" you know what. No one does anything for free, just think deeply and you will find out. You might find out yourself a selfish too.

° Are extreme content creators really making millions from ad revenue
° Is google lying about AdSense's invalid clicks
° How Google has changed showing ads over the years






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