Laziness is the engine of progress.
Many readers probably remember the old black-and-white TVs on which, to switch between the two available channels, you had to turn the PTK knob.
Then came push-button televisions. Then there were control panels that were connected to the TV by wire. Finally, there are wireless IR remotes. With the advent of wireless technologies, control panels have become more widely introduced into our lives, and now many household devices are controlled with the help of them.
Besides IR, some devices are controlled by radio channel.
Technologies do not stand still and the last “squeak” is voice control. Such control, as a rule, is carried out either by bluetooth technology or via Wi-Fi.
The question arises: what should those users who have devices on IR control do?
If you have, for example, a smart TV or smart box, then there is no problem. Buy a remote control with voice control, for example, such or such a cheaper one, download the application to the device and you are the proud owner of voice control technology.
But for those who do not have the opportunity to install the application (for example, on an air conditioner or an old TV), the master made this device.
Let's watch a demo video.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389873_1-10.jpg" rel = "prettyPhoto"> < a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389855_1-13.jpg" rel = "prettyPhoto"> Step one: about the device
The wizard named his device – TURTLE IR, perhaps because it looks like a turtle.
TURTLE IR is a small infrared device that transmits an IR signal at 360 degrees, which allows you to automate and control your voice with any electronic device that supports an IR remote control.
The device is controlled by the voice assistant Alexa, which connects to home or office Wi-Fi and can be controlled either directly through it or through any gadget.
The device has a 2500 mAh battery and 12 IR LEDs located around the perimeter. All automation routines and voice commands can be easily created and edited from the Alexa app at any time without having to reprogram the entire device.
The user can turn on/off devices by voice command, change settings such as combination of DVD-player-sound system-projector, etc. You can control these devices from anywhere in the world, set timers for turning on, for example, an air conditioner, and even set the desired temperature .
Step Two: 3D Printing
This project requires only two 3D printed parts – a base and a cover. The parts have been designed so that they can be easily printed without any support.
Print parameters are as follows:
Layer height: 0.2mm
Nozzle temperature: 204
Wall thickness: 0.8 mm
Top/bottom thickness: 2 mm
After the details were printed, the surface was sanded by the master with sandpaper.
Pasted the parts with self-adhesive vinyl film.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389846_1-18.jpg" rel = "prettyPhoto"> Files for printing the case are attached .
poly base.stlpoly top.stl Step two: battery compartment
The battery is in the middle of the device. The base design includes a slot to hold the 18650 battery in place.
The battery contact plate and spring plate are glued to both sides of the groove with super glue.
Once the glue is dry, place the battery in the slot and check if it is seated correctly and whether it has proper electrical contact.
Step third: installing ESP-01
The ESP-01 does not have built-in micro USB connectors for programming like the Nodemcu or Arduino nano, so the board should be easily removed from the device in case of program changes. The wizard mounts a connector on the board, and the microcontroller will be connected to it.
You need to take a pin connector and cut off two parts of four sockets from it. Then glue them together and solder to the board. Prepare the contact pad on the board by separating the two pads of four contacts in a row and making sure they are not bridged. The protruding antennae then need to be bent and trimmed.
Then you need to check the installation of the microcontroller.
Step four: installing components in the base
In this step, you need to install the electronic modules, the power button and 4 IR LEDs into the base. The base is divided by a battery into 2 sections. One section contains the battery management and charging modules, and the second contains voltage regulation boards and microcontrollers.
The master glues the micro USB board and the TP4056 battery management module. Then he installs and fixes the power button with glue.
On the other side, he glues the board with the connector and the buck converter.
Now all that remains is to install the LEDs in the hole and fix them with glue too.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389932_1-36.jpg" rel = "prettyPhoto"> < a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389867_1-41.jpg" rel = "prettyPhoto"> Step five: cover
Unlike the base, the cover will contain 8 IR LEDs. When installing IR LEDs, make sure that the legs, cathode and anode, of all LEDs are installed in the same direction.
Step sixth: scheme
This is a schematic diagram of the device. On the left we see the battery and the battery management module. This module (TP4056) protects the battery from overcharging, deep discharge, overloading and short circuiting.
A button is installed to turn the device on and off.
A buck DC/DC converter is located at the bottom in the middle. It is needed to lower the battery voltage from 3.5 to 4.2 volts to over 3.3 volts. This must be done to power the ESP-01 module. The module has a trimming resistor and with it you need to set the required voltage.
The RX pin of the ESP-01 is set to send a digital signal for IR LEDs. Since this signal pin cannot power all 12 IR LEDs at the same time, the circuit uses six BC547 transistors along with 10K resistors as high frequency switches to make each transistor turn two IR LEDs on or off. This ensures that all 12 IR LEDs emit the IR signal at full power at the same time, ensuring maximum range and coverage.
Step seven: installing the battery
Solder the VBUS and GND ports on the MicroUSB motherboard to the IN + and IN- ports of the TP4056 board.
Solder the B + and B- ports on the TP4056 module to the + ve plate of the battery and the spring plate, respectively.
Install the battery according to the polarity.
Connect the device to the MicroUSB charger and charge the batteries. The indicator on TP4056 glows red while charging and turns blue when the battery is fully charged.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389909_1-48.jpg" rel = "prettyPhoto"> Step Eight: Connecting the Microcontroller
Connect the OUT + of the TP4056 to one of the power button pins.
Connect the other terminal of the power button to the IN + input of the 360 MINI DC buck converter and to all + ve terminals of IR LEDs.
Connect the OUT- of TP4056 to IN- of the 360 MINI buck.
Turn on the power button and measure the voltage at the OUT + and OUT- terminals of the buck. If the voltage is not 3.3V, adjust by turning the screw of the resistor.
Connect the OUT + and OUT- terminals of the buck converter to Vin and GND on the previously made board for the ESP-01.
Take two BC547 transistors and two resistors 10 kohm and connect them to the negative terminal of the IR LEDs as shown in the diagram.
Connect the base of both transistors to the RX ESP-01 pin line on the connector through 10 kΩ resistors.
Step nine: connecting IR LEDs
Now you need to connect the LEDs installed in the cover.
Wire all the positive terminals of the IR LEDs in parallel and extend the wire approximately 10 cm.Wire the open end of this wire to any positive connection point on the base that follows the power button, such as the positive terminals of the IR LEDs on the base or to IN + 360 MINI buck converter.
Take four BC547 transistors and four 10k ohm resistors and connect them to the negative terminal of the IR LEDs on the cover as shown in the circuit diagram.
Connect the base of all transistors to the RX (GPIO3) pin line of the ESP-01 on the connector through 10 kΩ resistors.
There will be 3 wires in total connecting the base to the cover:
Wire 1: + to all IR LEDs, + ve terminal
Wire 2: – connecting power to the emitters of all transistors on the base.
Wire 3: Signal wire – from RX (GPIO3) ESP-01 to the base of all transistors.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389904_1-58.jpg" rel = "prettyPhoto"> Step ten: collecting codes from remotes
At this stage, the wizard collects raw signal data from the remotes of all devices that need to be automated. The IR remote transmits a signal by sending pulses of infrared light that represent a specific binary code. These codes represent various commands such as power on/off, volume +/-, etc. After collecting the raw signal data, you can use this data to play IR signals with the collected device when you receive voice commands.
To do this, do the following:
Connect the TSOP38238 IR receiver to the microcontroller as shown in the above circuit diagram. Then connect the mcu node to your computer using a USB cable.
Open the Arduino IDE. Install the “IRremoteESP8266” library from the Arduino Library Manager, and then open and upload the “read_ir.ino” code attached in this step to the mcu node.
After the code is compiled and loaded, open the serial monitor.
Point each remote at the IR receiver and start pressing the buttons you want to add one by one, such as the power button, volume buttons, mute buttons, etc.
Each time you press the button, you will see a bunch of numbers appearing on the serial monitor.
Copy the raw data string from the serial monitor and paste it somewhere safe, such as Notepad. Each set of numbers must be signed, “decrease the volume”, “increase the volume”, etc.
While saving the data.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389947_1-64.jpg" rel = "prettyPhoto"> The wizard is attaching a file with data, but it is not clear from which consoles they are. Just in case, you can download them below.
read_ir.inoStep eleven: programming
Now we proceed to programming the device.
Connect the ESP-01 to the TTL programming module, as shown in the diagram, and connect it to the computer. < br> Open the Arduino IDE. Open the Arduino code file turtle_ir.ino attached to this step.
Enter your Wi-Fi SSID and password in the code (it is highlighted in yellow in the eighth image).
On line 14 of the Arduino code, you will see the raw IR data entered for the various remote control buttons. Replace this raw signal data with the one you collected from your own remotes in the previous step. Make sure you enter the correct information for the button names. You can give these buttons your own names or add new buttons, but remember to change the names, add buttons, and make the necessary changes throughout the code.
This code has 20 buttons set, which was enough to automate the wizard's living room, but more buttons can be added easily if needed.
If more than 20 buttons are needed, add new devices to the code, as you can see in the red circle on the 8th image, and then create new buttons and assign the collected raw signal data to them.
If you're happy with the code, upload it to the ESP-01.
Take the ESP-01 out of the TTL module and insert it into a socket inside our device. < br> < a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389939_1-72.jpg" rel = "prettyPhoto"> < a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389923_1-75.jpg" rel = "prettyPhoto"> Step twelve: assembling the case
Next you need to close the lid. There are 4 mounting holes on the cover. Use the tip of a soldering iron to burn through the vinyl and tighten the screws.
Once this is done, press the power button to turn on the device and wait 10 seconds for the device to connect to Wi-Fi.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389945_1-82.jpg" rel = "prettyPhoto"> Step thirteenth: setting up ALEXA
How only the device is connected to Wi-Fi, you can start setting up the device in the Alexa app. To do this, follow these steps: –
Open the Alexa app and click “Devices” in the lower right corner.
In the “Devices” window, click the “+” symbol.
Select the “Add Devices” option.
Then click “Lights” and “Others”. .
Click on “DISCOVER DEVICES”.
After a few seconds of searching, you can see the devices appear. These devices will have the names you assigned in the Arduino code in the previous step.
Click these devices in turn to complete the configuration.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389950_1-88.jpg" rel = "prettyPhoto"> < a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617390002_1-91.jpg" rel = "prettyPhoto"> Once the device is set up, you can start giving basic voice commands such as” Alexa, turn on the TV “,” Alexa, turn off the projector “or” Alexa, turn on the air conditioner every day at 20:00 “, etc. Or you can directly use the buttons in the Alexa app to control these devices.
To automate and control multiple devices with a single command, you need to create procedures in the Alexa app that can be triggered based on a voice command, time, or condition.
To better understand how to set up these procedures, the wizard provides an example of automating your home theater setup. Usually there are 3 control devices for home theater setup – projector, DVD player and 5.1 sound system.
So here when we say Alexa Movie Time, first we want Turtle IR to automatically turn on the projector, sound system and DVD player, then set up the correct HDMI port in the projector source menu, adjust the sound system volume, etc. e. To do this, follow these steps: –
Open the Alexa app and click Routines in the More window.
You will see 3 steps to create a routine:
(A) Common name: you can give any name your routine.
(B) When does it happen: what triggers the routine? For example, a specific voice command, time, signal from an external smart device or sensor, etc.
(C) Add action: procedures and actions to follow when the above trigger is detected.
Click on the “+” symbols and add the required details for each of the 3 steps.
First we give the title. It can be any name you like.
Second, choose the type of trigger you want. In this case, the master has chosen a voice trigger, which is activated when he says the phrase “Alexa, movie time”.
Finally, we set the actions in the correct order, as shown in the 4th picture:
Therefore, when the master says “Alexa, movie time”, first Alexa gives the command: “Set up the cinema.” Then the projector is set to “ ON “. This action instructs the Turtle IR to play an IR signal that turns on the projector.
Likewise, the power to the DVD Player and Sound System is set to ON.
The wizard then added a 15 second timeout period because the projector takes 15 seconds to turn on and boot up after receiving an IR signal.
Then the Source Mute device is set to OFF. This is because the Source Mute can do 2 separate actions: Muting the projector speakers (when set to ON) and Select Projector HDMI Source (when set to OFF). They are all configurable in code.
When the Turtle IR is commanded to change the projector source, it is programmed to automatically play the source, OK and projector IR remote control navigation buttons to select the desired source. Thus, it takes about 5 seconds for this process to complete. Therefore, a 5 second timeout period is set as the next action.
Then the sound system volume (SS Volume) is set to “ON”, which instructs the Turtle IR to generate IR signals to increase the volume. (When set to “OFF,” the volume decreases.)
It takes about 5 seconds to adjust the volume, so you need to add a 5 second wait as the next step.
If increasing the volume is not enough, you can repeat the previous 2 steps.
Finally, the wizard added a response from Alexa that says: “ Done, enjoy the show ”, which also serves as an indicator that the installation is complete.
After all the above steps are completed, you need to save the settings.
From now on, all you have to say is “Alexa Movie Time” and all home theater appliances will be set up automatically.
< a href = "https://usamodelkina.ru/uploads/posts/2021-04/1617389932_1-96.jpg" rel = "prettyPhoto"> One of the features of the device is that it can be controlled remotely. You can control it through a smartphone using a voice or a button.
The combination of Turtle IR and the Alexa app opens up a multitude of automation possibilities. You can easily modify the code and add additional functionality to your liking. In the future, various sensors may be built into the device to fully automate certain devices without voice commands.
Step fourteenth: test
For testing, the master uses a smartphone camera. The human eye cannot see the IR signal, but it can be seen through the camera. First, you need to send commands to check if all the LEDs are working. Then, you need to test the device on household appliances.
As you can see, everything works. Of course, Alex's system does not have Russification, but the idea itself and the implementation are interesting, and even modifying the code for Alice or Google is an assistant, a task for Russian-speaking craftsmen.