This project is a digital counting system using an Arduino, equipped with:
- LCD display for live count and limit
- EEPROM storage for saving settings
- Relay for triggering external devices when a set limit is reached
- Buzzer feedback (enable/disable)
- Multiple buttons for user interaction
- Sensor input (e.g., IR beam break, magnetic switch, etc.)
Diagram showing the wiring and connections of the Arduino Counter System.
| Component | Description |
|---|---|
| Arduino (Uno/Nano) | Main microcontroller |
| LCD (I2C 16x2) | Display count and limit |
| Relay module | Control external load |
| Buzzer | Optional audible feedback |
| Push Buttons (x4) | Start/Stop, Reset, Limit +/- |
| Digital Sensor | Any digital sensor (e.g., IR) |
| Function | Arduino Pin |
|---|---|
| Sensor Input | D5 |
| Relay Output | D12 |
| Buzzer Output | D3 |
| Start Button | D6 |
| Reset Button | D7 |
| Increase Limit | D8 |
| Decrease Limit | D9 |
-
Count Events: Count each time a digital sensor is triggered (active LOW).
-
Start/Stop Toggle: Toggle counting with the Start button.
-
Set Limit: Adjust limit using Increase/Decrease buttons.
-
Reset Options:
- Short Press Reset: Resets current counter only.
- Long Press (β₯1 sec): Resets both counter and limit.
-
EEPROM Storage:
- Counter value
- Counter limit
- Buzzer enable state
-
Relay: Turns OFF when the counter reaches the limit.
-
Buzzer: Feedback for button presses and events (can be disabled).
| Address | Variable | Size |
|---|---|---|
0-1 |
counterLimit |
2B |
2-3 |
counter |
2B |
4 |
buzzerEnabled |
1B |
| Command | Description |
|---|---|
b |
Toggle buzzer ON/OFF |
-
Start the system β press Start button.
-
Trigger the sensor β each event increments the count.
-
Once count == limit β relay turns OFF, buzzer beeps thrice.
-
Press Reset:
- Short: Resets counter.
- Long (β₯1s): Resets counter + limit.
-
EEPROM ensures all values are preserved on power loss.
- Wire up the components per the pin map.
- Upload the code to your Arduino.
- Open the Serial Monitor (9600 baud) for debug info or toggling buzzer.
- Use the buttons to interact with the system.
- Buttons are assumed to be active LOW with
INPUT_PULLUP. - Buzzer and relay are digital outputs.
- Sensor must give LOW when triggered.
- You can expand this system for automation, production counting, or security applications.
