Skip to content

Hand Gesture Based Ac Dimmer(Python, OpenCV, MediaPipe, Arduino)

Notifications You must be signed in to change notification settings

bilkeonur/HandGestureAcDimmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hand Gesture Based AC Light Dimmer

Control AC Light with Hand Gesture (Python - OpenCV - MediaPipe and Arduino)

Youtube Video

IMAGE_ALT

Installation

Step 1

Upload Dimmer.ino to Arduino

Step 2

Install Dependencies

pip3 install opencv-python
pip3 install mediapipe
pip3 install pyserial

Step 3

Run and Enjoy

python3 dimmer.py

Circuit Diagram

CircuitDiagram

PCB Design

PCBBack PCBFront PCBSolderedBack PCBSolderedFront

Dimmer Module Schematic and PCB

Schematic PCB

50 Hz Sine Wave and Zero Cross Detection Input

In alternating current, the zero-crossing is the instantaneous point at which there is no voltage present. In a sine wave or other simple waveform, this normally occurs twice during each cycle. It is a device for detecting the point where the voltage crosses zero in either direction.

The zero-crossing is important for systems that send digital data over AC circuits, such as modems, X10 home automation control systems, and Digital Command Control type systems for Lionel and other AC model trains.

https://en.wikipedia.org/wiki/Zero_crossing

Signal frequency > 50hz

SineWave

Fully rectified signal frequency > 100hz

ZeroCrossDetectionInput

T=1/F -> T=1/100 -> T=0.01 Second -> T=10ms

With the code below, we add a function that is triggered every 10ms

attachInterrupt(digitalPinToInterrupt(ZERO_CROSS_PIN), zeroCrossInterrupt, RISING);
void zeroCrossInterrupt()
{ 
  delayMicroseconds(dimLevel*75);
  digitalWrite(DIM_PIN, LOW); //Turn On Triac
  delayMicroseconds(10);
  digitalWrite(DIM_PIN, HIGH); //Turn Off Triac
}

About The Author

Onur BiLKE

Computer Engineer

Android & IOS & Backend Developer && Embedded System Designer

License

Copyright 2022 bilkeonur

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Hand Gesture Based Ac Dimmer(Python, OpenCV, MediaPipe, Arduino)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published