{"id":28717175,"url":"https://github.com/mark-mdo47/ringthebell","last_synced_at":"2026-04-13T01:06:13.233Z","repository":{"id":297983401,"uuid":"998481130","full_name":"Mark-MDO47/RingTheBell","owner":"Mark-MDO47","description":"YX5200 sounds for the strongman carnival ring the bell game","archived":false,"fork":false,"pushed_at":"2025-06-08T18:03:34.000Z","size":735,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-08T19:18:20.760Z","etag":null,"topics":["arduino","arduino-nano","c","cpp","esp32","yx5200"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mark-MDO47.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-08T17:43:18.000Z","updated_at":"2025-06-08T18:03:38.000Z","dependencies_parsed_at":"2025-06-08T19:28:23.703Z","dependency_job_id":null,"html_url":"https://github.com/Mark-MDO47/RingTheBell","commit_stats":null,"previous_names":["mark-mdo47/ringthebell"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mark-MDO47/RingTheBell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark-MDO47%2FRingTheBell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark-MDO47%2FRingTheBell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark-MDO47%2FRingTheBell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark-MDO47%2FRingTheBell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mark-MDO47","download_url":"https://codeload.github.com/Mark-MDO47/RingTheBell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark-MDO47%2FRingTheBell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259914931,"owners_count":22931334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-nano","c","cpp","esp32","yx5200"],"created_at":"2025-06-15T03:13:31.841Z","updated_at":"2026-04-13T01:06:13.219Z","avatar_url":"https://github.com/Mark-MDO47.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# RingTheBell\nDemo - use YX5200 to create sounds for the strongman carnival ring the bell game.\n\n**Table Of Contents**\n* [Top](#ringthebell \"Top\")\n* [The Idea](#the-idea \"The Idea\")\n  * [ESP32 Over-The-Air Update - OTA](#esp32-over\\-the\\-air-update-\\--ota \"ESP32 Over-The-Air Update - OTA\")\n* [Schematic](#schematic \"Schematic\")\n  * [Nano/Uno - YX5200 PWR at 5V UART at 5V - Works Reliably](#nanouno-\\--yx5200-pwr-at-5v-uart-at-5v-\\--works-reliably \"Nano/Uno - YX5200 PWR at 5V UART at 5V - Works Reliably\")\n  * [ESP32 - YX5200 PWR at 5V UART at 5V - Works Reliably](#esp32-\\--yx5200-pwr-at-5v-uart-at-5v-\\--works-reliably \"ESP32 - YX5200 PWR at 5V UART at 5V - Works Reliably\")\n  * [ESP32 - YX5200 PWR at 5V UART at 3.3V - Not Reliable](#esp32-\\--yx5200-pwr-at-5v-uart-at-33v-\\--not-reliable \"ESP32 - YX5200 PWR at 5V UART at 3.3V - Not Reliable\")\n  * [ESP32 - YX5200 PWR at 3.3V UART at 3.3V - Not Reliable](#esp32-\\--yx5200-pwr-at-33v-uart-at-33v-\\--not-reliable \"ESP32 - YX5200 PWR at 3.3V UART at 3.3V - Not Reliable\")\n* [Code](#code \"Code\")\n* [Sounds](#sounds \"Sounds\")\n* [Parts List](#parts-list \"Parts List\")\n  * [ESP32 version](#esp32-version \"ESP32 version\")\n  * [Arduino NANO/UNO version](#arduino-nanouno-version \"Arduino NANO/UNO version\")\n\n## The Idea\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nThis will create sounds for the strongman carnival ring the bell game.\n\nThere will be two LOW-active inputs (either from buttons or another processor):\n- when the mallet hits to start the weight climbing\n- when the weight rings the bell at the top\n\nIt is silent until it sees the mallet hit.\u003cbr\u003e\nThen it starts a rising sound of finite duration.\n- If the \"ring the bell\" input happens while the rising sound is active, the sound is interrupted and the ring the bell sound starts. That sound continues until it finishes.\n- If the rising sound finishes before the \"ring the bell\" sound, then silence until another input happens.\n\nThere are two ways to compile, which use different I/O pins:\n- as an ESP32 (but not ESP32-S3 which uses different pins; only exception I know)\n- as an Arduino Nano or Uno\n\n### ESP32 Software Serial or UART\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nWondering if the ESP32 UART problems were from not using the ESP-specific software serial library\n- https://github.com/plerup/espsoftwareserial\n\n### ESP32 Over-The-Air Update - OTA\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nIf compiled for an ESP32, the code will include the Over-The-Air Update (OTA) capability. By default, this is implemented so it is always-on, not requiring the ESP-NOW commands from the following descriptions (which are from other projects) nor the optional button push.\n- https://github.com/Mark-MDO47/DuelWithBanjos/blob/master/code/DuelWithBanjos/OTA_story.md\n- https://github.com/Mark-MDO47/UniRemote/blob/master/code/mdo_use_ota_webupdater/README.md\n\nNOTE: The **Arduino Nano** and **Arduino Uno** do not natively support this OTA capability.\n\n## Schematic\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nThis \"schematic wiring diagram\" shows connections for both the Arduino Nano and an ESP32 development board.\n- I sometimes call my schematics \"schematic wiring diagrams\" because I don't follow the rules of the standards organizations, although I reserve the right to just call them schematics.\n  - I show all the connections as wires and show the pins of chips/modules all together and arranged the same as physical top view instead of separated/organized by function since I use my \"schematic\" to do the actual wiring of my project.\n  - I tend to forget to hook up some of the power and ground connections if I use the standard schematic methods instead of showing the wire.\n\nNotes\n- I did not show a switch/button for the ESP32 OTA control signal since the code is configured to automatically prepare that without input\n- The 1K resistor in the path to the YX5200 RX line prevents coupling of digital noise into the sound output\n- I did not include external power for these prototype designs; I assume they will be powered from the USB\n- I have a reliable version for Nano/Uno and for ESP32, plus two ESP32 variations that do not work reliably\n  - The reliable ESP32 variation uses a SN74HCT125N to do voltage level translation for the UART interface\n  - I am using resistors to drop the voltage from YX5200 5V to ESP32 3.3V (to avoid damage to ESP32)\n\n### Nano/Uno - YX5200 PWR at 5V UART at 5V - Works Reliably\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nHere with a Nano/Uno and with the YX5200 using 5V for power and 5V on the UART interface - works reliably.\u003cbr\u003e\n```\n// NANO (and UNO) pin definitions:\n//\n// Control inputs for Sound Processing - these two are GPIO pins with internal pull-up capability\n//   NANO (or UNO) pin D-04   DPIN_MALLET_HIT  when it goes LOW\n//   NANO (or UNO) pin D-06   DPIN_RING_BELL   when it goes LOW\n//\n// YX5200/DFPlayer Sound Player\n//   NANO (or UNO) pin D-10   DPIN_SRL_RX   Arduino RX; YX5200 TX - 9600 Baud\n//   NANO (or UNO) pin D-11   DPIN_SRL_TX   Arduino TX; YX5200 RX - 9600 Baud\n//   NANO (or UNO) pin D-12   DPIN_AUDIO_BUSY YX5200 BUSY; HIGH when audio finishes\n```\n\u003cimg src=\"https://github.com/Mark-MDO47/RingTheBell/blob/master/resources/images/RingTheBellSchematic_Nano.png\" width=\"500\" alt=\"Ring the Bell Schematic with Nano - works reliably\"\u003e\n\n### ESP32 - YX5200 PWR at 5V UART at 5V - Works Reliably\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nHere with an ESP32 and with the YX5200 using 5V for power and 5V on the UART interface - works reliably.\u003cbr\u003e\n```\n// ESP32 pin definitions:\n//    NOTE: these are good pins for most ESP32 - see https://randomnerdtutorials.com/esp32-pinout-reference-gpios/\n//    If using an ESP32-S3, see https://randomnerdtutorials.com/esp32-s3-devkitc-pinout-guide/ and make any\n//       needed adjustments.\n//\n// Control inputs for Sound Processing - these two are GPIO pins with internal pull-up capability\n//   ESP32 Dev Module pin D-13   DPIN_MALLET_HIT  when it goes LOW\n//   ESP32 Dev Module pin D-27   DPIN_RING_BELL   when it goes LOW\n// \n// YX5200/DFPlayer Sound Player\n//   ESP32 Dev Module pin D-16   DPIN_SRL_RX   Arduino RX; YX5200 TX - 9600 Baud\n//   ESP32 Dev Module pin D-17   DPIN_SRL_TX   Arduino TX; YX5200 RX - 9600 Baud\n//   ESP32 Dev Module pin D-23   DPIN_AUDIO_BUSY YX5200 BUSY; HIGH when audio finishes\n```\n\u003cimg src=\"https://github.com/Mark-MDO47/RingTheBell/blob/master/resources/images/RingTheBellSchematic_ESP32.png\" width=\"700\" alt=\"Ring the Bell Schematic with ESP32; YX5200 5V Power 5V UART - Works Reliably\"\u003e\n\n### ESP32 - YX5200 PWR at 5V UART at 3.3V - Not Reliable\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nHere with an ESP32 and with the YX5200 using 5V for power and 3.3V on the UART interface - not reliable. The YX5200 often ignores commands from the ESP32.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Mark-MDO47/RingTheBell/blob/master/resources/images/RingTheBellSchematic_ESP32_pwr5_uart3.3.png\" width=\"500\" alt=\"Ring the Bell Schematic with ESP32; YX5200 5V Power 3.3V UART - Not Reliable\"\u003e\n\n### ESP32 - YX5200 PWR at 3.3V UART at 3.3V - Not Reliable\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nHere with an ESP32 and with the YX5200 using 3.3V for power and 3.3V on the UART interface - not reliable. The YX5200 often ignores commands from the ESP32.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Mark-MDO47/RingTheBell/blob/master/resources/images/RingTheBellSchematic_ESP32_pwr3.3_uart3.3.png\" width=\"500\" alt=\"Ring the Bell Schematic with ESP32; YX5200 3.3V Power 3.3V UART - Not Reliable\"\u003e\n\n## Code\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nThe code is in the ./code/ area split into several directories. The *.ino file is in ./code/RingTheBell/RingTheBell.ino.\u003cbr\u003e\nA directory of the code can be found here:\n- https://github.com/Mark-MDO47/RingTheBell/tree/master/code\n\n## Sounds\n[Top](#ringthebell \"Top\")\u003cbr\u003e\nThe sounds and a description of how to create/adjust sounds and how to copy them to the MicroSD card for the YX5200 can be found here:\u003cbr\u003e\n- https://github.com/Mark-MDO47/RingTheBell/blob/master/resources/sounds/README.md\n\n## Parts List\n[Top](#ringthebell \"Top\")\u003cbr\u003e\n\n### ESP32 version\n[Top](#ringthebell \"Top\")\u003cbr\u003e\n\n| Title | Descrip | URL | each |\n| --- | --- | --- | --- |\n| ESP32 | 1 @ ESP32 Devkit V1 ESP-WROOM-32 (or just about any ESP32 WiFi capable module **except an ESP-32-S3**) | https://www.amazon.com/Hosyond-ESP-WROOM-32-Development-Microcontroller-Compatible/dp/B0C7C2HQ7P/ref=sr_1_4 | $3.50 |\n| YX5200 | 1 @ Sound Module with MicroSD (TF) card socket | https://www.amazon.com/Organizer-YX5200-DFPlayer-Supporting-Arduino/dp/B07XXYQBNS/ref=sr_1_1 | $2.00 |\n| MicroSD card | 1 @ 32GByte or smaller MicroSD card formatted as FAT32; shown is 16GB example | https://www.amazon.com/dp/B08KSSX9PH | $3.75 |\n| speaker |  Metal Shell Round Internal Magnet Speaker 2W 8 Ohm approx 1 inch | https://www.amazon.com/dp/B0177ABRQ6 | $2.80 |\n| resistors | 1 @ 1.0-KOhm 1/4 watt through-hole resistors | https://www.digikey.com/en/products/detail/stackpole-electronics-inc/CF14JT1K00/1741314 | $0.10 |\n| resistors | 2 @ 3.3-KOhm 1/4 watt through-hole resistors | https://www.digikey.com/en/products/detail/stackpole-electronics-inc/CF14JT3K30/1741376 | $0.10 |\n| resistors | 2 @ 6.65-KOhm 1/4 watt through-hole resistors | https://www.digikey.com/en/products/detail/stackpole-electronics-inc/RNF14FTD6K65/1682364 | $0.10 |\n| SN74HCT125N | 1 @ Non-inverting 5.5V buffer 14-pin DIP | https://www.digikey.com/en/products/detail/texas-instruments/SN74HCT125N/376860 | $0.63 |\n\n### Arduino NANO/UNO version\n[Top](#ringthebell \"Top\")\u003cbr\u003e\n\n| Title | Descrip | URL | each |\n| --- | --- | --- | --- |\n| NANO | Arduino NANO (or UNO) or clone | https://www.aliexpress.us/item/3256805941736729.html | $1.40 |\n| YX5200 | 1 @ Sound Module with MicroSD (TF) card socket | https://www.amazon.com/Organizer-YX5200-DFPlayer-Supporting-Arduino/dp/B07XXYQBNS/ref=sr_1_1 | $2.00 |\n| MicroSD card | 1 @ 32GByte or smaller MicroSD card formatted as FAT32; shown is 16GB example | https://www.amazon.com/dp/B08KSSX9PH | $3.75 |\n| speaker |  Metal Shell Round Internal Magnet Speaker 2W 8 Ohm approx 1 inch | https://www.amazon.com/dp/B0177ABRQ6 | $2.80 |\n| resistors | 1 @ 1.0-KOhm 1/4 watt through-hole resistors | https://www.digikey.com/en/products/detail/stackpole-electronics-inc/CF14JT1K00/1741314 | $0.10 |\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-mdo47%2Fringthebell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark-mdo47%2Fringthebell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-mdo47%2Fringthebell/lists"}