กลับไปหน้ารวมไฟล์
stock-counter-36d2ce-en.md

An Arduino Nano ESP32-based counter to track available stock of one item. It automatically gets and uploads the current stock with Arduino Cloud. You can also report the current stock on the dashboard. The stock is displayed by an SSD1306 OLED screen and controlled by 2 push buttons.

Project Introduction

The IoT Stock Counter is a smart utility device designed to simplify inventory management. By leveraging the power of the Arduino Cloud, this system allows you to monitor and update the quantity of a specific item from anywhere in the world. Whether you're tracking office supplies, retail stock, or home pantry items, this compact device provides both physical interaction and remote visibility.

Hardware Infrastructure

  • Arduino Nano ESP32: The heart of the project, providing powerful processing and built-in Wi-Fi for cloud connectivity.
  • SSD1306 OLED Display (128x64): A sharp, high-contrast screen used to display the current stock count and Wi-Fi connection status.
  • Push Buttons (x2): Used for manual stock adjustment. One button increments the count, while the other decrements it.
  • Breadboard and Jumpers: Facilitate quick and organized wiring of the components.

IoT & Cloud Workflow

This project utilizes the Arduino IoT Cloud to synchronize data between the physical device and a digital dashboard:

  1. Real-time Sync: Every time a button is pressed locally, the stock variable is updated on the Nano ESP32 and immediately uploaded to the cloud.
  2. Remote Monitoring: You can view the live stock count on your smartphone or computer via the Arduino Cloud dashboard.
  3. Remote Control: The dashboard also features an input field, allowing you to manually override or reset the stock count from the web interface, which then syncs back to the OLED display.

Functional Logic and User Interaction

The software logic is designed for ease of use and reliability:

  • Button Debouncing: The code includes timing checks to ensure that a single button press is only counted once, preventing accidental double-counts.
  • Persistent Storage: By syncing with the cloud, the device ensures that if power is lost, it can retrieve the last known stock value as soon as it reconnects to the Wi-Fi.
  • Dynamic UI: The OLED screen provides clear feedback. When a button is pressed, the screen updates instantly, and a "Syncing" icon may appear to confirm the cloud upload is in progress.

Practical Applications

This system is highly scalable. While this prototype tracks one item, the logic can be expanded to monitor multiple bins or integrated with a barcode scanner for a professional-grade inventory solution. It is an excellent example of how IoT can solve mundane problems through creative engineering.

ข้อมูล Frontmatter ดั้งเดิม

title: "Stock Counter"
description: "An IoT device to keep track of how much of one thing you have in stock"
author: "two0ort"
category: "Screens & Displays"
tags:
  - "Internet Of Things"
  - "Monitoring"
  - "Tools"
views: 8
likes: 0
price: 299
difficulty: "Easy"
components:
  - "1x 0.96\" OLED Display 128 x 64 SSD1306 I2C"
  - "1x 10 jumper wires 150mm male"
  - "2x Push Button"
  - "2x Breadboard - 400 contacts"
  - "1x Arduino Nano ESP32 with Headers"
tools: []
apps:
  - "1x Arduino Cloud Agent"
  - "1x Arduino Cloud"
downloadableFiles: []
documentationLinks: []
passwordHash: "ff46a376177105513a2995fa83bdbdfbef85c20180bef42c24f05da2fb75b9ad"
encryptedPayload: "U2FsdGVkX1/87Yp347aSBLAYuJyx8lHTz3Sr6RwaHmkFk93YT7m2PmGf0VyTypvmZRPD5ZeG4QBx3qzszwaPqg=="
seoDescription: "Create an IoT Stock Counter using Arduino. Track inventory levels in real-time with this efficient and easy-to-build DIY device."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/stock-counter-36d2ce_cover.jpg"
lang: "en"