Automatic Gel Alcohol Dispenser With Esp32

by CarlosVoltT in Circuits > Arduino

1145 Views, 1 Favorites, 0 Comments

Automatic Gel Alcohol Dispenser With Esp32

portada.png
🙌 Dispensador de alcohol en gel automático con esp32 - PCBWay.es

In tutorial we will see how to make a complete prototype, to assemble an automatic gel alcohol dispenser with esp32, it will include step-by-step assembly, electronic circuit and also the source code explained all step by step.

Circuit

circuito sanitizador gel.jpg

The circuit of this project is composed, of the ky-033 module, which has a reflective optical sensor, which is the TCRT5000L, an esp32-t module, although we can also use an Arduino, in any of its views, with some minimal modifications to the source code, an MG995 servo motor, in its 360-degree version, so that we can take a complete turn with a high torque , inside it is built with metal gears, and of course a printed circuit, which I will leave the gerber file below so that they can download for free.

Features of the ESP32-T Module

esp32pinout-227x300.jpg

Connectivity

The ESP32 module has all the wiFi variants:

  • 802.11 b/g/n/e/i/n
  • Wi-Fi Direct (P2P), P2P Discovery, P2P Group Owner mode and P2P Power Management

This new version includes low-power Bluethoot connectivity

  • Bluetooth v4.2 BR/EDR and BLEBLE Beacon
  • In addition, you can communicate using SPI, I2C, UART, MAC Ethernet, Host SD protocols

Microcontroller features

The CPU consists of a Tensilica LX6 Model SoC with the following features and memory

  • Dual 32-bit core with 160MHz speed
  • 448 kBytes ROM
  • 520kByteS SRAM

Have 48 Pins

  • 18 12-bit ADC
  • 2 8-bit DAC
  • 10 pin contact sensors
  • 16 PWM
  • 20 Digital inputs/outputs

Power and consumption modes

For proper operation of the ESP32 it is necessary to supply a voltage between 2.8V and 3.6V. The energy you consume depends on the mode of operation. It contains a mode, the Ultra Low Power Solution (ULP),in which basic tasks (ADC, PSTN…) continue to be performed in Sleep mode

Servo MG995 360-degree Version

servo360mg995.jpg

The mg995 – 360o, is a continuous rotation servo (360o) is a variant of normal servos, in which the signal we send to the servo controls the rotationspeed, rather than the angular position as happens in conventional servos.

This continuous rotation servo is an easy way to get a motor with speed control, without having to add additional devices such as controllers or encoders as in the case of DC motors or step by step, since the control is integrated into the servo itself.

Specifications

  • Gear material: Metal
  • Turning Range: 360
  • Operating voltage: 3 V to 7.2 V
  • Operating speed without load : 0.17 seconds / 60 degrees (4.8V); 0.13 seconds / 60 degrees (6.0V)
  • Torque: 15 kg / cm
  • Working temperature: -30oC to 60oC
  • Cable length: 310 mm
  • Weight: 55g
  • Dimensions: 40.7 mm x 19.7 mm x 42.9 mm

Includes:

  • 1 Servomotor Tower Pro Mg995 continuous rotation.
  • 3 Screws for assembly
  • .3 Coples (horns).

Ky-033 Line Detector/Follower Sensor Module

tcrt5000l.png

Description

KY-033 LINE DETECTOR/FOLLOWER SENSOR MODULE This module is specially designed for easy, fast and accurate line detection, making it easy for you to assemble line tracker robots. This module is compatible with Arduino as well as any Microcontroller that has a 5V pin. Operating voltage: 3.3 – 5 VDC Working current: 20mA Detection distance: 2-40mm Output signal: TTL level (low level there is an obstacle, High level with obstacle) Sensitivity setting: potentiometer.IC Comparator: LM393 IR Sensor: TCRT5000L Operating Temperature: -10 to +50oC Dimensions: 42x11x11mm Effective Angle: 35o

Source Code

#include Servo myservo;

const int sensorPin = 12;//Pin del sensor infrarrojo optico refectivo

int value = 0;

void setup() {

myservo.attach(23);//Pin para el servo motor MG995 de 360 grados

pinMode(sensorPin, INPUT); //definir pin como entrada

}

void loop() {

value = digitalRead(sensorPin ); //lectura digital de pin del sensor infrarrojo

if (value == LOW) {//Si detecta un objeto cerca se cumple esta función

actuador();//LLama a la función actuador

}

}

void actuador(){

myservo.write(180);//Baja el actuador lineal

delay(700);

myservo.write(90);//Detiene al servo motor

delay(600);

myservo.write(0);//Sube el actuador lineal

delay(500);

myservo.write(90);//Detiene al servo motor

delay(2000);//Esperamos 2 segundos para que no se vuelva a ctivar el servomotor inmediatamente

}

This code can be used with any Arduino, but we should be careful to modify the use of pin 23 (with arduino mega no problem) by any Arduino pin from 2 to 13 (minus 12 because it is used for the reflective optical sensor), since for example in Arduino one or nano pin 23 does not exist.

The servo to use for this project is 360 degrees, so it rotates complements by putting a value of 180o, in a direction -myservo.write(180)-, we stop it with -myservo.write(90)- and we do turn it in the opposite direction with -myservo.write(90)-, that is why it is very important to wait a short time with delay for the linear actuator, to move to the desired position.

Files

ST files

http://rogerbit.com/wprb/wp-content/uploads/2020/10/Archivos-STL.zip

Or you can download them from the original car, but the file above includes a modification to one STL files that look at the video.
https://www.thingiverse.com/thing:3334797

Gerber file

http://rogerbit.com/wprb/wp-content/uploads/2020/10/Gerber_PCB__ESP32.zip

Servo Library Compatible With Esp32

To control the motor, you can simply use the PWM capabilities of the ESP32 by sending a 50Hz signal with the appropriate pulse width. Or you can use a library to make this task much simpler.

http://rogerbit.com/wprb/wp-content/uploads/2020/04/ServoESP32-master.zip

The End

As you can see, this is a very simple project to assemble, but they will have to have a 3D printer or make printing parts in order to assemble it. The subtraction of the components can be obtained in electronics stores, and they can even assemble everything in a protoboard, without having to do the PCB.

RECOMMENDED PROJECT

https://www.youtube.com/watch?v=vxBG_bew2Eg