Graphical Programming Tutorial for Arduino – Simple Number counter

Byamber

Graphical Programming Tutorial for Arduino – Simple Number counter

Introduction

This project demonstrates how you can use Arduino to count the number of people that come in and out of a mall using two sensors。

Sensors need to be placed at the entrance and exit points of the park to work as expected. Basically, you increase the number of times everyone comes in, and decrease the number of times they go out.

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • I2C LCD 1602 Display x 1
  • PIR Motion Sensors
  • F/M jumpers
  • USB Cable x 1
  • PC x 1

Connection

Before you write the code you have to build the circuit. To do this, connect the LCD pins as follows:

Osoyoo UNO LCD1602
GND GND
5V VCC
A4 SDA
A5 SCL

Note:

  • For Mega2560: the I2C connections are on SDA=20 and SCL=21. So go ahead and wire these up, along with the two power leads to the 5V and GND terminals.
  • For Arduino Leonardo: connect SDA to digital pin 2 and SCL to digital pin 3 on your Arduino.

Overhere, we connect the first PIR sensor to D2 of the UNO board, the other to D3. From sketches of Fritzing, you can look at the connections to be done in a simpler way:

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Click Save aftogramming is done. Select the board type and serial port to upload the code to the UNO board.

Running Result

Every visitor comes in(D2 triggers interruption), the number of parks on the display is increased by one. Every time a visitor goes out(D3 triggers interruption), the number of parks on the display is reduced by one..

About the Author

amber administrator

You must be logged in to post a comment