DinossauroBebado / Laser_VC

GNU General Public License v3.0
1 stars 0 forks source link

Laser

This repo is about a wireless laser that is controled remotely by Serial Comunication

I'm using with openCv to track a tennis ball

image off the laser with a red flare and blue background

In this case I'm using a Python sript

Work's with two Esp 8266 and the ESP-NOW protocol

So there is an Esp Main that is conected to the computer via USB and it's job is to receive the serial data parse it and send to the ESP Child via the protocol

When received the data is maped to the servos degres of operation and send it to the X and Y Servos

alt text

Eletronics

The eletronics is a laser diode controled by an transistor and a analog level converter because the laser and the servos works best with 5v while the eso is 3.3V even so it´s powered by 5V

Parts List

alt text

Code

Code About
Master.cpp Code uploaded to the masters ESP
Chield.cpp Code uploaded to the child
Main.py Main code with the integration : Begin Here
SerialComMouse.py If you want to control the laser with your mouse
Indentificar.py The function for face and the ball recognition
FindHSVValues.PY Code to adjust the HSV values for the ball recognition function otmization

Dependencies

Here i'm using Platoform.io to upload to the microcontroler so this is because there is so much set up files.And you will need to install some things to make the esp and servo libs to work some quick google should work.In case you want to use the Arduino IDE just delet the #include and install the servo.h lib with the esp in the IDE

ESP

#include <ESP8266WiFi.h>
#include <espnow.h>
#include <Servo.h>

Python

pip pip install opencv-python
pip install tkinter

SetUp

In the python code you need to change the usb port in the SerialComunication.py

In the esp master change the int8_t broadcastAddress[] variable to the Child mac adress to figure this out HERE


PS: This is my first try at writing documentacion so any problem feel free to contact me. :P