Control board for operating motors (BLDC) with configurations via wifi (app) and hardware

Published Sep 19, 2022
 200 hours to build
 Advanced

A board capable of controlling a BLDC MOTOR oriented to sliding gates, being able to open and close with variable speed, self-closing, gate travel learning, Wi-Fi and hardware configurations, inputs for security photocells, among other features.

display image

Components Used

Buzzer 5V
Buzzer 5V
1
Resistor 1K 0603
Resistor 1K 0603
44
ACS712 Hall Effect-Based Linear Current Sensor
ACS712 is a fully integrated hall effect-based linear current sensor IC.
1
7805 Voltage Regulator
7805 Voltage Regulator
1
ESP8266 WiFi Module
ESP8266 is a system on chip (SoC) which provides WIFI capability for embedded applications. This enables internet connectivity to embedded applications. ESP8266 modules are mostly used in Internet of Things(IoT) applications.
1
3.3V Voltage Regulator AMS1117
LDO Voltage Regulators 1A,Pos Fix Vltg LDO Linear Reg
1
Diode 1N400x
Diode 1N400x
2
L6388E Gate Driver IC
Gate Drivers Hi-Vltg and Lo Side Driver
1
LMR36510 Switching Voltage Regulator IC
Switching Voltage Regulators SIMPLE SWITCHER® 4.2-V to 65-V, 1-A synchronous step-down converter with 26-uA IQ 8-SO PowerPAD -40 to 125
1
74LS08 AND Gate
Logic Gates Quad 2-Input.
2
KBPC3504 Bridge Rectifiers
Bridge Rectifiers 400 V - 35 A
1
PIC18F45K22 8-bit Microcontroller
8-bit Microcontrollers - MCU 32KB 1536bytes-RAM 8B nanoWatt
1
IRF3205 MOSFET
MOSFET MOSFT 55V 98A 8mOhm 97.3nC
6
2N3904 Transistors
Bipolar Transistors - BJT Bipolar Transistor, TO-92, 40V, 200mA, NPN
4
CD4051 Multiplexer
Multiplexer Switch ICs CMOS Sgl 8-Ch Ana Multipl/Dmultiplexer
1
Capacitor 100nF
Multilayer Ceramic Capacitors MLCC - Leaded K 50V 100NF +/- 10 % X7R AMMO E3
10
NTC Thermistor
NTC Thermistor
1
Resistor 22 kOhms
Metal Film Resistors - Through Hole 22K OHM 1/4W 1%
6
Resistor 47 Ohms
Metal Film Resistors - Through Hole 47 OHM 1/4W 1%
6
PC817 Optocoupler
PC817 Optocoupler
5
433MHz RF Module Tx Rx
433MHz RF Module Tx Rx
1
Terminal Blocks 2 POS 3.5mm
Fixed Terminal Blocks PT 1.5/2-3.5H 2POS HRZ 3.5mm SCREW
24
General Purpose Relays 12V 7A
General Purpose Relays 7A, General Purpose Relay
2
Tactile Switches
Tactile Switches 12 x 12 mm 12 mm 100 gf Short Crimped Black Through Hole SPST
2
Wire
Hook-up Wire 788133 RED 100 FT
1
Wire Stripper and Cutter
Wire Stripper and Cutter
1
Fuse 15A
Cartridge Fuses 500V 3AB Cartridge fuse, 15A
1
Fuse 3A
Industrial & Electrical Fuses 3A 600VAC 300VDC Slo-Blo
1
Description

The BLDC motor controller for sliding gate.

It is a project that I have created based on the need to be able to open and close a sliding gate from 3 possible ways, taking into consideretion that there are already operating motors for sliding gates, but not that they meet the characteristics that this project does, Being a control board for DC motors, this has a lower consumption of power than the AC motor operators that currently exist, the fact of being DC allows me to control the opening and closing speed of the doors, something that I cannot do with the AC motor , in addition to having opening, closing and stop via RF control (433Mghz), I have added the same features, but from an app via Wi-Fi, and from a 3 buttoms that can be installed inside a house, apartment, or place where communication is required. This proyect also has hardware configurations which I will describe in detail below.

Lest get started describing the schematic:

Starting at the bottom right we have a transformer that will be responsible for providing power to the circuit and the motor, this transformer will have a ratio of 1:5, since we will reduce the domestic voltage 120v to 24 volts, this transformer is 500W,  I have chosen a 500W transformer since we could have current peaks of up to 12Amperes. This transformer is followed by a bridge rectifier to convert the 24 volts ac into dc. The bridge rectifier has been chosen at 35 amps so when the motor is working at maximum torque the bridge rectifier is working at 40% of its maximum current capacity, then we have a filter capacitor of 18000 microfarads.


Transformer Features:
• 500 Watts of power.
• Due to the design of the motor casing, it is required to be a toroid.
• Ferrite as core material due to its low loss characteristics, little space and weight required.
• Voltage input 120Vac output 24Vac.
• Minimum current of 18 Amps.

Power Supply (LMR36510):

After the transformer and the rectified part we have the main power supply (LMR36510) that will reduce the input 24Vdc to about 15 Volts dc in order to power the parts of the circuit that require this voltage, such as the photocells, relay, magnetic lock , external buttoms, and the lamp, taking into account the consumption of each of the components connected to the power supply, I decided to choose this one that provides me with up to 1 amp maximum output, in its datasheet the manufacturer shows the topology above as indicated To use this integrated buck converter, the manufacturer also provides us with a table with the values of the components to be used for three different voltages, and in case of using another output voltage, it provides us with the formulas to calculate the resistance, capacitor and coil. also we have a 7805 (5V) voltage regulator conected after the power supplay, wich provide power the processor.

 

Regulator 3.3v (NCP1117LP):

After the voltage regulator (5v), i have another voltage regulator connected wich give 3.3V in the output, this voltage regulator provide power to the esp8266.

Module wifi (ESP8266):

The wifi module will be in charge of sending the data requested by the app to the microcontroller and vice versa, this wifi module is an esp8266 or also known as esp 01, which will be working in AP (Access point) mode, creating a wifi network (2.4Ghz ) with a password, this network will be pointing to a static IP address and a port to be able to make a socket to connect with the app. This module works at 3.3v with a consumption of less than 50 milliamps, it has a port (4 headers) to be able to reprogram it without having to remove it from the circuit, it also has two headers to put the esp8266 in boot mode, the boot mode consists of putting the GPIO0 pin to ground via a momentary jumper so that the micro can be programmed. I have chosen this module, since all electronic devices today are trending towards IOT (Internet of Things) technology, susers feel more comfortable having control or being able to monitor what is happening on their cell phone. 

Module RF (CY11):

The RF module will allow me to receive the signals sent by the control at a frequency of 433 Megahertz and decode them through the microprocessor. This module is very practical to use,  it has 5 pins, 3 being powered (2 GND, and one VCC) , an input for an antenna and to be able to amplify the reception that is 400 theoretical meters according to its manufacturer, and the last pin that is the one that sends the data.

 Indoor Buttoms:

In this part of the circuit you can see 3 buttons that will allow us to control the sliding gate (Open, close and stop the door) from inside a house or desired place with a maximum distance of 20 wired meters, I have decided to use optocouplers to isolate the input circuit and the processor through light, the buttons will handle a voltage of 15v and on the other side of the optocouplers I will have 5v which are the ones that will be connected directly to the microprocessor, in the emitting part I have used 10Konhms resistors and the receiver side 1k onhms pull down resistors. It should be noted that I have used buttons for the schematic, but in reality it is a terminal which to go there, and the buttons connected to the terminal via cables.

Programm buttom:

Here and added a button which will allow me to program the controls that I want to control the door, this button will be left pressed for a while and the microprocessor will go into standby mode, once the button key is pressed, the buzzer beeps indicating that it has taken the signal and saved it. This button will also allow me to clear previously saved controls by pressing it for a longer time.

Limit Switch (career endings):

 

A fundamental part of the circuit are the limit switches that will indicate the position of the door (limit switches), completely open or completely closed and for this I need to use two switches, also connected to pull up through 1kohm resistors and when closing one of them get a logical 0, in the circuit they are directly connected to the processor.

Sensor current (ACS712):

 

The sensor to use is from a module that comes for Arduino, this works by hall effect where we put all the current of the circuit through it, and this will give me a voltage proportional to the current that crosses its pins. As you can see in the circuit I will not use the module, if not, I will take the integrated one and use the same module configuration, but directly on my pcb, this module is very simple to use and has a maximum current limit of 30 amps, the topology seen above is the one offered by the manufacturer.

 

Driver Bootstrap (L6388E):

In the control part of the brushless motor I have chosen a bootstrap driver that adapts to the needs of the circuit, which are to drive the motor windings which are in a Y configuration, these will be driven at high frequency and with a voltage of 24v , with this circuit and the processor I will be able to control the motor, in speed,  turns, and braking.

 

 Brushless Motor:

In the image you can see the connection of the BLDC motor where we have 3 coils connected in Y, and an encoder that works by hall effect that gives me the position of the motor through 3 cables in the following format (000, 001, 010, 011, 100, 101, 110, 111), the encoder is powered by 5 volts. I have chosen this motor because it is the one I have been able to get locally along with a casing, this motor is 24V with a maximum power of 220W, which is a relatively low power compared to other motors, this motor handles up to about 12Amps of current .

 

Did Switch:

The did switches will allow me to make certain configurations without needing the app, in case the user is archaic or simply does not want to use the app, these did switches will allow me to configure the auto-closing time with the first 3 (10s, 20s, 30s ), I can even add those times by activating more than one of them, the 4th is the lamp, if it is “on” the relay will start to activate and deactivate to do the blinking when the door is opening or closing, this is for the lamps that do not have the blinking effect, in case it is “off” the relay will keep providing the fixed 15 volts and thus connect a lamp that flashes (blinks alone), the 5th is the pedestrian in case it is on “on” the user will be able to open the door up to a certain point with button B of the control, if it is “off” this function is deactivated, the same for the 6th switch is the one for the output for the side lock, if it is in “on” I will be able to activate that output of the control button c and if it is "off" I will not be able to do it, the 7th switch called OFF, it is a switch that disables all the previous functions in case the user decides to do it from the app.

 

Output Relays:

 

These two relay outputs that we can see will go to a terminal block so that the user can connect, in the first a visual indicator lamp, it will turn on (flashing) when the door is opening or closing, and in the second the user can connect a lock magnetic that you can control from the 3rd button of your control.

 

Processor:

 

This is the processor wich is able to control all the operations, as you can see in the picture it is a PIC18F45K22, it has all the caracteristic (Interruptions, PWM, Timers, etc.) needed to make this proyect come true. 

Pictures of the prototipe:

 

Signals of the coil:

Video the motor working:

https://youtube.com/shorts/RnDztO68yB0

Limit Switch made it in solidworks:

 

Some pictures of the 3D model (SolidWorks):

 

Note: I don't have a video with the complete operation of the project because when I was doing tests I burned the drivers and the pcb that I had made is still in China.

Codes

Downloads

Schematic_BLDC controller Download
PCB_BLDC Controller Download
3D Board Download
Comments
Ad