Skip to content

MORISON-K/counter_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Smart Object Counter System

A simple AVR-based object counter that uses an IR obstacle sensor to detect passing objects, displays the count on a 16x2 I2C LCD, and provides visual feedback via an RGB LED.

See implementation: counter.c (key symbols: F_CPU, IR_SENSOR_PIN, RESET_BUTTON, RED_PIN, GREEN_PIN, BLUE_PIN, set_color, I2C_init, LCD_init, LCD_print, LCD_setCursor, main).

Features / Objectives

  • Real-time counting of objects passing an IR sensor.
  • Live count displayed on 16x2 I2C LCD.
  • RGB LED status: green on detection, blue idle.
  • Manual reset button to clear the count.
  • Implemented with low-level AVR register programming (no Arduino libraries).

Components

  • Arduino Uno (ATmega328P) — controller
  • IR-08H obstacle sensor — detection
  • KY-016 RGB module — visual status
  • 16x2 LCD with I2C backpack — display
  • Push button — reset
  • Breadboard, jumper wires, 5V supply

Wiring (summary)

  • IR OUT -> Arduino D2 (PD2) IR_SENSOR_PIN
  • IR VCC -> 5V
  • IR GND -> GND
  • RGB RED -> D9 (PB1) RED_PIN
  • RGB GREEN -> D10 (PB2) GREEN_PIN
  • RGB BLUE -> D11 (PB3) BLUE_PIN
  • Reset button -> one side to PD3 (D3) RESET_BUTTON, other side to GND (use internal pull-up)
  • LCD SDA -> A4, SCL -> A5, VCC -> 5V, GND -> GND

(Refer to counter.c for exact pin macros and behavior.)

Operation

  1. On power-up the LCD shows "Object Counter" and initializes peripherals via I2C_init and LCD_init.
  2. The program polls the IR sensor on IR_SENSOR_PIN. A LOW on this pin indicates an object and increments the count (debounced via software).
  3. On detection the LED is set via set_color to green and the new count is printed using LCD_print/LCD_setCursor.
  4. When idle the LED displays blue. Pressing the reset button (active LOW) clears the count.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages