Arduino Project
Arduino Finger Counter Using Computer Vision V3
Course Introduction
In this lesson, we control a servo to open the gate using the gesture password 5-1-5, and close it with the gesture 4, based on data received via serial communication.
Red and green LEDs indicate the gate status: by default, the gate is closed with the red LED on; when the correct password is entered, the gate opens and the green LED lights up.
This code controls the servo and LEDs on an Arduino Uno by receiving finger count data from a Python script, which detects the number of fingers shown to a camera and sends the data to the Arduino via serial communication.
Note
If this is your first time working with an Arduino project, we recommend downloading and reviewing the basic materials first.
1.1 Install Arduino IDE(Important)
1.2 Introduction of Arduino IDE
Python Installation Guide
Wiring

Common Connections:
LED
Connect the LEDs cathode to a 1kΩ resistor then to the negative power bus on the breadboard, and the LEDs anode to the 2 to 3 on the Arduino.
Digital Servo Motor
Connect to breadboard’s positive power bus.
Connect to breadboard’s negative power bus.
Connect to 9 on the Arduino.
Writing the Code
Note
You can copy this code into Arduino IDE.
Use the Arduino Library Manager and search for Servo.h install library.
Select the board(Arduino UNO R4 Minima) and then clicking the Upload button.
Then use the Python code FingerCountSender (2) . You can click here FingerCountSender (2).zip to download it.
Update the Python script to use the correct serial port(COMx).
Then run the python code to open the camera window.
