Easy Operation of TV, AppleTV and Radio (Part II)

The Situation

In the first post Easy Operation of TV, AppleTV and Radio (Part I) I have shown how to operate three different Audio/Video devices with one button of an ESP32 system. You have to use single clicks, double clicks and even triple clicks and a long press and an even longer press to do everything with one button.

In this first part I proposed to put the needed parts in a box with several buttons, because “Having different buttons for TV, AppleTV, Radio and Off will simplify the operation and make the system even useable for the grandparents.”.

So – here we go!

The Challenge

Create a package to contain the components:

  • at least 5 buttons,
  • IR transmitter,
  • ESP32C3 SoC,
  • battery,
  • charging unit

Because we need at least 5 buttons to switch between the different scenarios, it is not a good idea to use GPIO buttons like in part I, because you would need 5 GPIO pins.

A better solution is to use an analog digital converter (ADC) connected to one GPIO pin and connect all 5 buttons to this ADC.

The ADC Approach

Until now I used the GenericButton class to process the button events. This class was only able to use GPIO buttons, ADC buttons have not been implemented so far. Therefore I had to implement ADC buttons first. Now Version 1.1.0+ supports GPIO and ADC buttons.

Then I had to connect the six buttons of my new package with the GPIO pin 0 of the ESP32C3 Supermini board, which I have chosen to use. Each button has to set the input voltage to a specific value for this button when pressed. This is done with a resistor ladder.

And this is how it looks like in “real life”:

I had to tweak the resistor values, because the maximum voltage that can be detected is 2.892 V on my ESP32C3 SoC. Because this is the “idle” voltage, when no button is clicked, all six buttons have to set a lower voltage when they are clicked.

So, this is the new prototype of my solution for the challenge:

An IR remote controller built around an ESP32C3 SoC using ADC buttons and an IR transmitter.

Now we have the following situation:

  • To watch TV we have to do a single click on the red button of the remote controller. To switch the TV channels we still have to use the IR remote controller of the TV.
  • To watch Apple TV we have to do a single click on the yellow button of the remote controller. To switch the AppleTV input we still have to use the Siri Remote.
  • To watch a DVD we have to do a single click on the green button of the remote controller. To control the DVD we still have to use the IR remote controller of the DVD player.
  • To listen to the radio we have to do a single click on the (left) blue button of the remote controller. To select the radio station we still have to use the IR remote controller of the receiver.
  • To switch everything off we have to do a single click on the black button of the remote controller.

Known Problems

Wakeup from DeepSleep

To save battery power I want to use the DeepSleep functionality of ESP32. To wake up from DeepSleep I would like to use the ADC buttons. This only works, when the button voltage is “low”, which means less than about 1.65 V (1/2 of Vcc). With my current resistor ladder settings this is true for buttons 0 to 4. Button 5 does not trigger the wakeup. So if you want to use ADC buttons as wakeup source the maximum voltage from an ADC button must be below 1/2 of Vcc.

ToDo: Recalculate the resistor values of the resistor ladder.

Using a battery

To include a battery into the package a charging module is neede. Currently there is a problem charging the battery when the ESP SoC is connected to the battery. I want to solve this by adding a Schottky diode and a P channel MOSFET to the system.

The next Steps

  • Add + and – buttons to adjust the volume level of the receiver.
  • Add Up and Down buttons to switch between the predefined TV channels and radio stations.

Under the Hood

You can find the sources on GitHub at https://github.com/elrebo-de/esp_av_rmt.

Contact me, if you want to discuss or need more info.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *