kblox Neo+ Robotics Kit
About Lesson

SMART PARKING SYSTEM

Introduction

In this project, we are going to make a smart parking system. For making this project we are going to use two IR sensors, one LCD 16*2, a v, and jumper wires for connection. The 5V pin of Kblox Neo is connected to common +ve of Breadboard and GND pin to common -ve. The data pins of the LCD are connected to a digital pin (D6,5,3 and 2) of the Kblox Neo. Signal pins of IR sensors are connected to the D9 and D8 pins of the Kblox Neo. As soon as the IR sensor detects any object it sends a signal to the Kblox Neo and the Kblox Neo sends a signal to the LCD that the slot is occupied so LCD shows the slot is Full. If the IR sensor does not detect any obstacle, the LCD shows the slot empty.

 

 

Components required

  • Kblox Neo
  • IR sensor [Qty-2]
  • LCD 16×2
  • Resistor 1K [Qty-1]
  • Jumper wires

Code

#include "kblox.h"

kblox kit;
kblox_lcd lcd(12, 11, 6, 5, 3, 2);    // define lcd pins


void setup() {
  // put your setup code here, to run once:
  kit.ir_begin(8, 9);         // define ir sensor pin 
  lcd.begin(16, 2);           // initialize lcd 
  lcd.setCursor(5, 0);
  lcd.print("Welcome");       // print on lcd 
  delay(2000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.setCursor(5, 1);
  lcd.print("system");
  delay(2000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("slot A");
            lcd.setCursor(10,0);
            lcd.print("slot B");

          }

            void loop() {
            //put your main code here, to run repeatedly:

            int A = kit.ir1_read();     //store first ir data in varialbe
            int B = kit.ir2_read();     // store sencond ir data in variable B

            if(A==HIGH){                //if first IR is high print sloat A full else empty 
            lcd.setCursor(0,1);
            lcd.print("Full");
          }
            else
            {
            lcd.setCursor(0,1);
            lcd.print("Empty");
          }

            if(B==HIGH){               //if second ir is high print slot B full else empty
            lcd.setCursor(11,1);
            lcd.print("Full");
          }
            else
            {
            lcd.setCursor(11,1);
            lcd.print("Empty");
          }

          }

Applications

  • Can be used for making Path following robots.
  • Can be used for making People counter.
  • Can be used for making an Intruder detector.