{"id":565,"date":"2026-05-24T16:39:09","date_gmt":"2026-05-24T14:39:09","guid":{"rendered":"https:\/\/elrebo.de\/?p=565"},"modified":"2026-06-23T12:07:57","modified_gmt":"2026-06-23T10:07:57","slug":"easy-operation-of-tv-appletv-and-radio-part-ii","status":"publish","type":"post","link":"https:\/\/www.elrebo.de\/index.php\/2026\/05\/24\/easy-operation-of-tv-appletv-and-radio-part-ii\/","title":{"rendered":"Easy Operation of TV, AppleTV and Radio (Part II)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"block-e8f4cfb2-8447-47dd-bc80-46e993acdf56\">The Situation<\/h2>\n\n\n\n<p id=\"block-67a56a01-e9f3-4be7-b189-53c0f3e0c71b\">In the first post <a href=\"https:\/\/elrebo.de\/index.php\/2026\/05\/12\/easy-operation-of-tv-appletv-and-radio-part-i\/\" data-type=\"post\" data-id=\"548\">Easy Operation of TV, AppleTV and Radio (Part I)<\/a> 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. <\/p>\n\n\n\n<p id=\"block-67a56a01-e9f3-4be7-b189-53c0f3e0c71b\">In this first part I proposed to put the needed parts in a box with several buttons, because &#8220;Having different buttons for TV, AppleTV, Radio and Off will simplify the operation and make the system even useable for the grandparents.&#8221;.<\/p>\n\n\n\n<p>So &#8211; here we go!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-fe318504-6f6f-45cb-981d-ba47f86f16a6\">The Challenge<\/h2>\n\n\n\n<p>Create a package to contain the components: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>at least 5 buttons, <\/li>\n\n\n\n<li>IR transmitter, <\/li>\n\n\n\n<li>ESP32C3 SoC, <\/li>\n\n\n\n<li>battery, <\/li>\n\n\n\n<li>charging unit<\/li>\n<\/ul>\n\n\n\n<p id=\"block-c54bf439-1e7d-4b44-8849-9fe192e99527\">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.<\/p>\n\n\n\n<p>A better solution is to use an analog digital converter (ADC) connected to one GPIO pin and connect all 5 buttons to this ADC.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-190e5431-ff50-45a0-a4a0-159396c804e7\">The ADC Approach<\/h2>\n\n\n\n<p>Until now I used the <a href=\"https:\/\/elrebo.de\/index.php\/2026\/02\/25\/generic_button\/\" data-type=\"post\" data-id=\"73\">GenericButton class<\/a> 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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"400\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/05\/circuit-2.png\" alt=\"\" class=\"wp-image-566\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/circuit-2.png 740w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/circuit-2-300x162.png 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/figure>\n\n\n\n<p>And this is how it looks like in &#8220;real life&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/05\/IMG_5573-768x1024.jpeg\" alt=\"\" class=\"wp-image-569\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/IMG_5573-768x1024.jpeg 768w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/IMG_5573-225x300.jpeg 225w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/IMG_5573-1152x1536.jpeg 1152w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/IMG_5573-1536x2048.jpeg 1536w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/IMG_5573-scaled.jpeg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>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 &#8220;idle&#8221; voltage, when no button is clicked, all six buttons have to set a lower voltage when they are clicked. <\/p>\n\n\n\n<p>So, this is the new prototype of my solution for the challenge:<\/p>\n\n\n\n<p id=\"block-df36dbbb-411f-435c-97b9-b88ae1af65fc\">An IR remote controller built around an ESP32C3 SoC using ADC buttons and an IR transmitter.<\/p>\n\n\n\n<p id=\"block-ae62e341-c0c5-4d57-aeb0-b3db1955c85e\">Now we have the following situation:<\/p>\n\n\n\n<ul id=\"block-2d09b275-bfa9-4a18-ac5f-bbd6af3be405\" class=\"wp-block-list\">\n<li>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.<\/li>\n\n\n\n<li>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.<\/li>\n\n\n\n<li>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.<\/li>\n\n\n\n<li>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.<\/li>\n\n\n\n<li>To switch everything off we have to do a single click on the black button of the remote controller.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Known Problems<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Wakeup from DeepSleep<\/h3>\n\n\n\n<p>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 &#8220;low&#8221;, 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.<\/p>\n\n\n\n<p>ToDo: Recalculate the resistor values of the resistor ladder.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Using a battery<\/h3>\n\n\n\n<p>To include a battery into the package a charging module is needed. 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-ee2e3c33-5222-4d52-a726-1475cb009164\">The next Steps<\/h2>\n\n\n\n<ul id=\"block-d88b89b3-540e-4424-a7fb-b131d8613fdf\" class=\"wp-block-list\">\n<li>Add + and &#8211; buttons to adjust the volume level of the receiver.<\/li>\n\n\n\n<li>Add Up and Down buttons to switch between the predefined TV channels and radio stations.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-e3b01ba0-2d01-473e-b8f9-62ca1e1d049e\">Under the Hood<\/h2>\n\n\n\n<p id=\"block-c91e0c64-3841-4bdb-b4f2-41d4bcff1aba\">You can find the sources on GitHub at <a href=\"https:\/\/github.com\/elrebo-de\/esp_av_rmt\">https:\/\/github.com\/elrebo-de\/esp_av_rmt<\/a>.<\/p>\n\n\n\n<p id=\"block-d5a8dd01-50fc-497c-8495-dffbc83ff0ac\">Contact me, if you want to discuss or need more info.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":567,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,1,16],"tags":[71,72,73],"class_list":["post-565","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32_socs","category-oss","category-physical_computing","tag-adc-buttons","tag-ir-transmitter","tag-rmt"],"_links":{"self":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/comments?post=565"}],"version-history":[{"count":5,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/565\/revisions"}],"predecessor-version":[{"id":582,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/565\/revisions\/582"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media\/567"}],"wp:attachment":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media?parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/categories?post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/tags?post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}