{"id":4966,"date":"2026-08-30T00:50:34","date_gmt":"2026-08-29T15:50:34","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/ws2812-rp2040-zero-2\/"},"modified":"2026-08-30T00:50:36","modified_gmt":"2026-08-29T15:50:36","slug":"ws2812-rp2040-zero","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/diy-repair\/electronics-microcontroller\/ws2812-rp2040-zero\/","title":{"rendered":"Let&#8217;s Play with the RP2040-zero and WS2812 LEDs"},"content":{"rendered":"<p>In recent years, the RP2040 series has been attracting attention as an easy-to-use microcontroller. In this post, we will introduce how to light up the onboard RGB LED (WS2812) using the <strong>RP2040-zero<\/strong>, a compatible board. The RP2040-zero can be obtained on AliExpress for just a few hundred yen, making it a low-cost option that can be utilized for a wide variety of projects.<\/p>\n<h2>Features of the RP2040-zero<\/h2>\n<ul>\n<li><strong>Inexpensive Compatible Board<\/strong>: It is equipped with the same RP2040 chip as the Raspberry Pi Pico, but costs only a few hundred yen. I bought a compatible board on AliExpress, but it is also available on <a href=\"https:\/\/amzn.to\/4oxfmvV\">Amazon<\/a>.<\/li>\n<li><strong>Difference in Onboard LEDs<\/strong>: It does not have the GP25 LED found on the Raspberry Pi Pico. Instead, an RGB LED called WS2812 is mounted on the board.<\/li>\n<\/ul>\n<h2>Pin Assignment<\/h2>\n<p>The RP2040-zero has the following pin configuration, allowing for flexible wiring depending on your application.<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>\n<figure id=\"attachment_866\" aria-describedby=\"caption-attachment-866\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/1-1.png\"><img decoding=\"async\" class=\"wp-image-866 size-full\" src=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/1-1.png\" alt=\"Pin assignment of the RP2040-zero clone\" width=\"1024\" height=\"768\" srcset=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/1-1.png 1024w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/1-1-300x225.png 300w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/1-1-768x576.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-866\" class=\"wp-caption-text\">Pin assignment of the RP2040-zero clone<\/figcaption><\/figure>\n<p><strong>Access from the Top Side<\/strong>:<\/p>\n<ul>\n<li><strong>Power Supply<\/strong>: 5V, GND, 3.3V<\/li>\n<li><strong>GPIO<\/strong>: A total of 20 GPIO pins are accessible. Each GPIO pin supports digital input\/output as well as diverse functions such as PWM, SPI, and I2C.<\/li>\n<li>WS2812: The LED assigned to GPIO 16.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Features of the Bottom Side<\/strong>:<br \/>\n<a href=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/2-1.png\"><img decoding=\"async\" class=\"aligncenter wp-image-867 size-full\" src=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/2-1.png\" alt=\"Pin assignment of the back of the RP2040-zero clone\" width=\"1024\" height=\"768\" srcset=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/2-1.png 1024w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/2-1-300x225.png 300w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/03\/2-1-768x576.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<ul>\n<li>\n<p><span>Additional pad terminals are provided on the bottom side.<\/span><\/p>\n<\/li>\n<li>\n<p><strong>GPIO<\/strong><span>: A total of 9 GPIO pins are accessible. Since these are pad terminals, using them effectively might be a bit tricky.<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>This pin assignment is what makes the RP2040-zero so appealing, allowing it to handle multifunctional projects despite its limited board size.<\/p>\n<h2>How to Control WS2812 LEDs<\/h2>\n<p>WS2812s are popular as individually controllable RGB LEDs. Upon investigation, I found that there are many libraries available for WS2812, such as <a href=\"https:\/\/github.com\/benevpi\/pico_python_ws2812b\" target=\"_new\" rel=\"noopener\">benevpi&#8217;s pico_python_ws2812b<\/a>. However, you can actually control WS2812 LEDs sufficiently just by using the <a href=\"https:\/\/micropython-docs-ja.readthedocs.io\/ja\/v1.17ja\/library\/neopixel.html\"><strong>neopixel<\/strong> library<\/a> built into MicroPython.<\/p>\n<h2>Setting Up the Environment<\/h2>\n<p>I plan to explain how to install Thonny and the initial setup of the RP2040-zero in detail in another post. For this time, we will proceed under the assumption that your environment is already set up.<\/p>\n<h2>Code Example: Blinking the LED<\/h2>\n<p>The following code is a sample for blinking the WS2812 LED. The code uses the LED connected to GPIO 16 and repeats turning the LED on and off every 500 milliseconds.<\/p>\n<pre>from machine import Pin\nimport neopixel\nimport time\n\nn = neopixel.NeoPixel(Pin(16), 1)\n\nwhile True:\n    n[0] = (0,8,8)\n    n.write()\n    time.sleep_ms(500)\n    n[0] = (0,0,0)\n    n.write()\n    time.sleep_ms(500)\n<\/pre>\n<h3>Key Points of the Code<\/h3>\n<ul>\n<li><strong>Pin Designation<\/strong>: Since the Raspberry Pi Pico&#8217;s GP25 is not present, the RP2040-zero uses GPIO 16.<\/li>\n<li><strong>Utilizing the neopixel Library<\/strong>: By using the library built into MicroPython, you can control the WS2812 LED without introducing additional libraries.<\/li>\n<li><strong>Loop Processing<\/strong>: Blinking is achieved by repeatedly turning the LED on and off within an infinite loop.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>The RP2040-zero is inexpensive, easy to obtain, and makes an ideal board as an entry point for projects. By utilizing the built-in WS2812 LED and MicroPython&#8217;s <strong>neopixel<\/strong> library, you can easily control LEDs. Moving forward, I plan to introduce Thonny settings and other application examples in detail.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In recent years, the RP2040 series has been attracting attention as an easy-to-use microcontroller. In this po [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":829,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=828","footnotes":""},"categories":[1163],"tags":[271,267,265,266,47,277,262,272,275,274,270],"class_list":["post-4966","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics-microcontroller","tag-iot","tag-led","tag-micropython","tag-neopixel","tag-python","tag-raspberry-pi-pico","tag-rp2040-zero","tag-thonny","tag-275","tag-274","tag-270","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=4966"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4966\/revisions"}],"predecessor-version":[{"id":4969,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4966\/revisions\/4969"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/829"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=4966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=4966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=4966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}