<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Electronics | Tomokatsu Yukishita | yre.jp</title><link>https://yre.jp/en/tag/electronics/</link><atom:link href="https://yre.jp/en/tag/electronics/index.xml" rel="self" type="application/rss+xml"/><description>Electronics</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-US</language><lastBuildDate>Tue, 19 Jul 2022 00:00:00 +0000</lastBuildDate><image><url>https://yre.jp/media/icon_hufbc159bd6ce6a866189b19a79c0d0f51_12846_512x512_fill_lanczos_center_3.png</url><title>Electronics</title><link>https://yre.jp/en/tag/electronics/</link></image><item><title>Raspberry Pi 3 + Official 7-inch Touchscreen Photo Frame with Ambient Light Sensor Auto-Brightness (BH1750FVI + I2C + Python)</title><link>https://yre.jp/en/post/raspi-photoframe-with-sensor/</link><pubDate>Tue, 19 Jul 2022 00:00:00 +0000</pubDate><guid>https://yre.jp/en/post/raspi-photoframe-with-sensor/</guid><description>&lt;p>After building a cloud-connected photo frame with Raspberry Pi 4, I had a spare Raspberry Pi 3 and official 7-inch touchscreen sitting around. I turned them into another photo frame — and added a GY-30 BH1750FVI ambient light sensor to automatically adjust display brightness based on the room&amp;rsquo;s lighting.&lt;/p>
&lt;h2 id="hardware">Hardware&lt;/h2>
&lt;h3 id="raspberry-pi-3">Raspberry Pi 3&lt;/h3>
&lt;a href="https://www.amazon.co.jp/dp/B082QN6L1N?tag=snowunderco07-22" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/71wjyr2fsJL._AC_SL1200_.jpg" alt="Raspberry Pi 3 Model B Single-board Computer">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">Raspberry Pi 3 Model B Single-board Computer&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;h3 id="official-7-inch-touchscreen">Official 7-inch Touchscreen&lt;/h3>
&lt;p>800×480px, 24-bit RGB color, 60 fps, up to 10-point multitouch.&lt;/p>
&lt;a href="https://www.amazon.co.jp/dp/B01LC7U4XW?tag=snowunderco07-22" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/6188oB1j-OL._AC_SL1024_.jpg" alt="Raspberry Pi Official 7-inch Touchscreen LCD">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">Raspberry Pi Official 7-inch Touchscreen LCD&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;h3 id="case-for-the-official-touchscreen">Case for the Official Touchscreen&lt;/h3>
&lt;p>Designed to house both the Raspberry Pi 3 Model B and the 7-inch display.&lt;/p>
&lt;a href="https://www.amazon.co.jp/dp/B01N6786IE?tag=snowunderco07-22" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/41PUW&amp;#43;GgD0L._AC_.jpg" alt="Raspberry Pi &amp;amp; 7-inch LCD Touchscreen Case ABS (RS Components, Black)">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">Raspberry Pi &amp;amp; 7-inch LCD Touchscreen Case ABS (RS Components, Black)&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;h2 id="connecting-the-display">Connecting the Display&lt;/h2>
&lt;p>Follow the &lt;a href="https://www.raspberrypi.com/documentation/accessories/display.html" target="_blank" rel="noopener">Raspberry Pi Touch Display official documentation&lt;/a> to assemble the display.&lt;/p>
&lt;div class="alert alert-note">
&lt;div>
When connecting, pay attention to the ribbon cable orientation. For the power wires, connect red to the 5V pin and black to the GND pin.
&lt;/div>
&lt;/div>
&lt;h2 id="display-rotation-setting">Display Rotation Setting&lt;/h2>
&lt;p>By default the display is rotated 180°. The fix depends on your OS version.&lt;/p>
&lt;div class="alert alert-note">
&lt;div>
&lt;p>The &lt;code>lcd_rotate=2&lt;/code> option below is for &lt;strong>Raspberry Pi OS Bullseye and earlier (legacy/FKMS mode)&lt;/strong>. On Bookworm (2023 and later), &lt;code>lcd_rotate&lt;/code> is not officially recommended — use the &lt;strong>Screen Configuration&lt;/strong> GUI tool instead.&lt;/p>
&lt;p>The config file path also differs by OS version:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Bullseye and earlier&lt;/strong>: &lt;code>/boot/config.txt&lt;/code>&lt;/li>
&lt;li>&lt;strong>Bookworm and later&lt;/strong>: &lt;code>/boot/firmware/config.txt&lt;/code>&lt;/li>
&lt;/ul>
&lt;/div>
&lt;/div>
&lt;p>&lt;strong>For Bullseye and earlier (legacy/FKMS mode):&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">sudo vi /boot/config.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Add the following line:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">lcd_rotate=2
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="slideshow-program">Slideshow Program&lt;/h2>
&lt;p>The slideshow uses the Python script from the &lt;a href="https://github.com/yukishita/photoView4" target="_blank" rel="noopener">cloud-connected photo frame project (photoView4)&lt;/a>.&lt;/p>
&lt;h2 id="display-brightness-control">Display Brightness Control&lt;/h2>
&lt;p>Running the display at full brightness all the time is uncomfortable in a dark room. The official 7-inch display allows brightness control by writing a value (0–255) to a sysfs file:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">echo&lt;/span> &lt;span class="s2">&amp;#34;100&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> sudo tee /sys/class/backlight/rpi_backlight/brightness
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="adding-an-ambient-light-sensor-bh1750fvi">Adding an Ambient Light Sensor (BH1750FVI)&lt;/h2>
&lt;p>Rather than setting brightness manually, I wanted it to adjust automatically based on ambient light.&lt;/p>
&lt;h3 id="parts">Parts&lt;/h3>
&lt;a href="https://www.amazon.co.jp/gp/product/B06XHKTL58?tag=snowunderco07-22" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/61bi5cGPpFL._SL1100_.jpg" alt="WINGONEER GY-30 BH1750FVI Digital Light Intensity Sensor Module I2C for Raspberry Pi">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">WINGONEER GY-30 BH1750FVI Digital Light Intensity Sensor Module I2C for Raspberry Pi&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;a href="https://www.amazon.co.jp/gp/product/B06Y48V9DL?tag=snowunderco07-22" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/81yjq1pkiGL._SL1500_.jpg" alt="ELEGOO 120pcs Dupont Jumper Wires Male-Female / Male-Male / Female-Female Set">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">ELEGOO 120pcs Dupont Jumper Wires Male-Female / Male-Male / Female-Female Set&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;h2 id="connecting-to-raspberry-pi-via-i2c">Connecting to Raspberry Pi via I2C&lt;/h2>
&lt;p>The BH1750FVI communicates over I2C. Refer to the &lt;a href="https://www.raspberrypi.com/documentation/computers/os.html#gpio-and-the-40-pin-header" target="_blank" rel="noopener">Raspberry Pi GPIO pin layout&lt;/a> for wiring.&lt;/p>
&lt;p>
&lt;figure id="figure-raspberry-pi-gpio-pinout-source-raspberry-pi-official-documentation">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Raspberry Pi 40-pin GPIO header pinout diagram showing the I2C pins: SDA on GPIO2 (Pin 3) and SCL on GPIO3 (Pin 5)" srcset="
/media/raspi-photoframe-with-sensor/GPIO-Pinout-Diagram-2_hua49859c3abb8d59effc7f48992911ff2_206936_43d9d80c817fbd45d29cc36e3b5ca73e.webp 400w,
/media/raspi-photoframe-with-sensor/GPIO-Pinout-Diagram-2_hua49859c3abb8d59effc7f48992911ff2_206936_d6d457c064379b94134319d1e0002c6f.webp 760w,
/media/raspi-photoframe-with-sensor/GPIO-Pinout-Diagram-2_hua49859c3abb8d59effc7f48992911ff2_206936_1200x1200_fit_q75_h2_lanczos_3.webp 1200w"
src="https://yre.jp/media/raspi-photoframe-with-sensor/GPIO-Pinout-Diagram-2_hua49859c3abb8d59effc7f48992911ff2_206936_43d9d80c817fbd45d29cc36e3b5ca73e.webp"
width="760"
height="436"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Raspberry Pi GPIO pinout (source: Raspberry Pi official documentation)
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h3 id="wiring-table">Wiring Table&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Raspberry Pi&lt;/th>
&lt;th>GPIO Pin&lt;/th>
&lt;th>BH1750FVI&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>GPIO2 (SDA)&lt;/td>
&lt;td>3&lt;/td>
&lt;td>SDA&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>GPIO3 (SCL)&lt;/td>
&lt;td>5&lt;/td>
&lt;td>SCL&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5V Power&lt;/td>
&lt;td>2&lt;/td>
&lt;td>VCC&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ground&lt;/td>
&lt;td>14&lt;/td>
&lt;td>ADO&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ground&lt;/td>
&lt;td>20&lt;/td>
&lt;td>GND&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>
&lt;figure id="figure-bh1750fvi-wired-to-raspberry-pi-3-via-i2c">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="GY-30 BH1750FVI light sensor connected to Raspberry Pi 3 via jumper wires using I2C pins" srcset="
/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1410_hu98206837892c374cd2028613e5b10c88_691631_c96c52f9123cb52726bbc85d7347db81.webp 400w,
/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1410_hu98206837892c374cd2028613e5b10c88_691631_7b5ac30237dcef389547e52e6e3b9297.webp 760w,
/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1410_hu98206837892c374cd2028613e5b10c88_691631_1200x1200_fit_q75_h2_lanczos.webp 1200w"
src="https://yre.jp/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1410_hu98206837892c374cd2028613e5b10c88_691631_c96c52f9123cb52726bbc85d7347db81.webp"
width="760"
height="507"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
BH1750FVI wired to Raspberry Pi 3 via I2C
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="verifying-the-sensor-python">Verifying the Sensor (Python)&lt;/h2>
&lt;p>After wiring, confirm data is coming through. Based on a &lt;a href="https://github.com/kujiraitakahiro/RaspberryPi/blob/master/bh1750fvi.py" target="_blank" rel="noopener">reference implementation on GitHub&lt;/a>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="ch">#!/usr/bin/python3&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">smbus&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">Bus&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">smbus&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">SMBus&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">Addr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mh">0x23&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">LxRead&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">Bus&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">read_i2c_block_data&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Addr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x11&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Illuminance: &amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nb">str&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">LxRead&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="mi">10&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34; lx&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">LxRead2&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">Bus&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">read_i2c_block_data&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Addr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x10&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Brightness: &amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nb">str&lt;/span>&lt;span class="p">((&lt;/span>&lt;span class="n">LxRead2&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="mi">256&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">LxRead2&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">])&lt;/span> &lt;span class="o">/&lt;/span> &lt;span class="mf">1.2&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Running it confirms the sensor is working:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">root@raspi3-photo:~# python br.py
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Illuminance: 1650 lx
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Brightness: 990.8333333333334
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="auto-brightness-control-program">Auto-brightness Control Program&lt;/h2>
&lt;p>The final program adjusts backlight brightness smoothly based on ambient light readings:&lt;/p>
&lt;ul>
&lt;li>Target brightness levels are defined per illuminance range&lt;/li>
&lt;li>The display brightness is incremented or decremented one step at a time toward the target&lt;/li>
&lt;li>The I2C sensor is polled every 300ms — polling faster than this results in incorrect readings with SMBus&lt;/li>
&lt;/ul>
&lt;h2 id="sensor-placement">Sensor Placement&lt;/h2>
&lt;p>The sensor is mounted on the protruding back section of the case, where it receives ambient light from the room.&lt;/p>
&lt;p>
&lt;figure id="figure-sensor-mounted-on-the-case-back-where-it-can-see-ambient-light">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="GY-30 BH1750FVI ambient light sensor mounted on the back protrusion of the Raspberry Pi 7-inch touchscreen case" srcset="
/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1407_hu98206837892c374cd2028613e5b10c88_594389_c8e1166602273b79f64bef721cf2db83.webp 400w,
/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1407_hu98206837892c374cd2028613e5b10c88_594389_62c0ff78d1802062e2b677dae092cc5d.webp 760w,
/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1407_hu98206837892c374cd2028613e5b10c88_594389_1200x1200_fit_q75_h2_lanczos.webp 1200w"
src="https://yre.jp/media/raspi-photoframe-with-sensor/ILCE-7M4-_DSC1407_hu98206837892c374cd2028613e5b10c88_594389_c8e1166602273b79f64bef721cf2db83.webp"
width="760"
height="507"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Sensor mounted on the case back where it can see ambient light
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="source-code">Source Code&lt;/h2>
&lt;p>The complete program (object-oriented version) is on GitHub:&lt;/p>
&lt;p>&lt;a href="https://github.com/yukishita/lcdBrightness2" target="_blank" rel="noopener">GitHub - yukishita/lcdBrightness2: Auto-brightness control for Raspberry Pi official display using BH1750FVI light sensor&lt;/a>&lt;/p>
&lt;h2 id="demonstration">Demonstration&lt;/h2>
&lt;p>The brightness adjusts smoothly as ambient light changes:&lt;/p>
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/R6XGl3KGRYA?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"
>&lt;/iframe>
&lt;/div>
&lt;h2 id="summary">Summary&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Component&lt;/th>
&lt;th>Role&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Raspberry Pi 3&lt;/td>
&lt;td>Main computer&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Official 7-inch Touchscreen&lt;/td>
&lt;td>Photo frame display (800×480px)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>GY-30 BH1750FVI&lt;/td>
&lt;td>I2C ambient light sensor&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Python (smbus)&lt;/td>
&lt;td>I2C communication and brightness control logic&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Adding the light sensor makes the photo frame genuinely pleasant to use — bright during the day, dimmed at night, automatically.&lt;/p></description></item><item><title>DIY JJY Simulator with ATOM Lite: Sync a Radio-Controlled Clock Without a Signal</title><link>https://yre.jp/en/post/jjy/</link><pubDate>Thu, 12 May 2022 00:00:00 +0000</pubDate><guid>https://yre.jp/en/post/jjy/</guid><description>&lt;p>After moving to a new home where my radio-controlled clock could no longer receive the JJY time signal, I built a low-cost JJY simulator using an M5Stack ATOM Lite and a JJY antenna board. This is a record of how I solved the problem for well under JPY 5,000.&lt;/p>
&lt;h2 id="the-problem-radio-controlled-clock-stopped-syncing-after-moving">The Problem: Radio-Controlled Clock Stopped Syncing After Moving&lt;/h2>
&lt;p>Radio-controlled clocks are convenient precisely because they set themselves automatically. After moving, however, my clock stopped receiving the JJY signal indoors, and the displayed time slowly drifted out of sync.&lt;/p>
&lt;p>The clock could still pick up the signal near a window, but carrying it there and back every time it needed syncing was not a practical long-term solution.&lt;/p>
&lt;h2 id="what-is-jjy">What Is JJY?&lt;/h2>
&lt;p>JJY is the call sign for Japan&amp;rsquo;s standard time radio signal, broadcast by the National Institute of Information and Communications Technology (NICT). Two transmitters cover the country: 40 kHz from Fukushima (Ōtakadoya-yama) and 60 kHz from Saga (Haganeyama). Radio-controlled clocks receive this signal to maintain accurate time automatically.&lt;/p>
&lt;p>The device described in this article &lt;strong>simulates the JJY signal and rebroadcasts it locally&lt;/strong>, allowing a clock to sync even when it cannot receive the real transmission.&lt;/p>
&lt;h2 id="commercial-retransmitters-are-expensive">Commercial Retransmitters Are Expensive&lt;/h2>
&lt;p>There are commercial products designed to solve exactly this problem — they receive accurate time from NTP servers or GPS and retransmit a JJY-compatible signal indoors.&lt;/p>
&lt;a href="https://amzn.to/47Vvjoi" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/51dhtr4Mv6L._AC_SL1000_.jpg" alt="Kyohritsu Denshi AC-Synchronized Time Transmitter P18-NTPAC">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">Kyohritsu Denshi AC-Synchronized Time Transmitter P18-NTPAC&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;a href="https://amzn.to/4sWxxvU" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/515VVAwTGWL._AC_SL1000_.jpg" alt="KEISEEDS GPS Radio Clock Repeater P18-NTPGR">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">KEISEEDS GPS Radio Clock Repeater P18-NTPGR&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;a href="https://amzn.to/4rJrwld" target="_blank" rel="noopener nofollow sponsored" class="amazon-card">
&lt;div class="amazon-card-image">
&lt;img src="https://m.media-amazon.com/images/I/71BT1PnUJIL._AC_SL1500_.jpg" alt="Radio Clock Signal Transmitter with Built-in Clock P18-NTPLR">
&lt;/div>
&lt;div class="amazon-card-info">
&lt;div class="amazon-card-title">Radio Clock Signal Transmitter with Built-in Clock P18-NTPLR&lt;/div>
&lt;div class="amazon-card-meta">
&lt;span class="amazon-btn">Amazonで見る&lt;/span>
&lt;/div>
&lt;/div>
&lt;/a>
&lt;p>These products work well, but they typically cost JPY 10,000–30,000. Hard to justify for a single clock at home.&lt;/p>
&lt;h2 id="the-diy-solution-atom-lite--jjy-antenna-board">The DIY Solution: ATOM Lite + JJY Antenna Board&lt;/h2>
&lt;p>Searching &lt;a href="https://www.switch-science.com/" target="_blank" rel="noopener">Switch Science&lt;/a> (a Japanese electronics parts retailer), I found a JJY antenna board designed to work with M5Stack devices — exactly what I needed.&lt;/p>
&lt;h3 id="required-parts">Required Parts&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Product&lt;/th>
&lt;th>Link&lt;/th>
&lt;th>Notes&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>JJY antenna board for M5StickC&lt;/td>
&lt;td>&lt;a href="https://www.switch-science.com/products/6527" target="_blank" rel="noopener">Switch Science&lt;/a>&lt;/td>
&lt;td>M5StickC specific&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>JJY antenna board for M5Atom&lt;/td>
&lt;td>&lt;a href="https://www.switch-science.com/products/6746" target="_blank" rel="noopener">Switch Science&lt;/a>&lt;/td>
&lt;td>For ATOM Lite/Matrix&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>M5StickC&lt;/td>
&lt;td>&lt;a href="https://www.switch-science.com/products/5517" target="_blank" rel="noopener">Switch Science&lt;/a>&lt;/td>
&lt;td>&lt;strong>Discontinued&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ATOM Lite&lt;/td>
&lt;td>&lt;a href="https://www.switch-science.com/products/6262" target="_blank" rel="noopener">Switch Science&lt;/a>&lt;/td>
&lt;td>Available now — recommended&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ATOM Matrix&lt;/td>
&lt;td>&lt;a href="https://www.switch-science.com/products/6260" target="_blank" rel="noopener">Switch Science&lt;/a>&lt;/td>
&lt;td>Available now&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> M5StickC has been discontinued. For new builds, the recommended combination is &lt;strong>ATOM Lite&lt;/strong> with the &lt;strong>JJY antenna board for M5Atom&lt;/strong>. The original article used M5StickC, which is what appears in the photos below.&lt;/p>
&lt;/blockquote>
&lt;p>At the time of purchase, the antenna board and M5 device together came to under JPY 5,000 (prices may vary — check current listings before ordering). That is roughly one-third to one-sixth the cost of a commercial retransmitter.&lt;/p>
&lt;h2 id="setup">Setup&lt;/h2>
&lt;p>Setup follows the instructions in the GitHub repository linked from the Switch Science product page:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/botanicfields/BF-018A" target="_blank" rel="noopener">Project page — GitHub: BF-018A&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/botanicfields/BF-018A/blob/main/BF-018A/BF-018A.ino" target="_blank" rel="noopener">JJY simulator sketch (.ino)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://qiita.com/BotanicFields/items/a78c80f947388caf0d36" target="_blank" rel="noopener">Qiita article: Generating a JJY-like signal with M5StickC / M5Atom using Ticker&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Flash the firmware following the instructions and there are no unusual steps. It worked on the first attempt without any issues.&lt;/p>
&lt;h2 id="testing">Testing&lt;/h2>
&lt;p>With the firmware flashed, connect the M5 device to the JJY antenna board and place it next to the radio-controlled clock.&lt;/p>
&lt;p>
&lt;figure id="figure-place-the-device-right-next-to-the-clock-to-receive-the-simulated-signal">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="M5StickC with JJY antenna board placed directly beside a radio-controlled clock, which is attempting to receive the simulated signal" srcset="
/media/jjy/ILCE-7M4-_DSC9136_hu98206837892c374cd2028613e5b10c88_58536_43bc2ce870154c5227402d96206f8f51.webp 400w,
/media/jjy/ILCE-7M4-_DSC9136_hu98206837892c374cd2028613e5b10c88_58536_abb0fd5f0bb8778fd9f895a7e7278219.webp 760w,
/media/jjy/ILCE-7M4-_DSC9136_hu98206837892c374cd2028613e5b10c88_58536_1200x1200_fit_q75_h2_lanczos.webp 1200w"
src="https://yre.jp/media/jjy/ILCE-7M4-_DSC9136_hu98206837892c374cd2028613e5b10c88_58536_43bc2ce870154c5227402d96206f8f51.webp"
width="760"
height="506"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Place the device right next to the clock to receive the simulated signal
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;p>The transmitted signal is weak and short-range. The device needs to be within a few centimeters to a few tens of centimeters of the clock to sync reliably. In practice this is not a problem — once the clock has synced, it holds accurate time on its own until the next sync cycle.&lt;/p>
&lt;h2 id="known-limitation">Known Limitation&lt;/h2>
&lt;p>One issue worth noting: &lt;strong>if the device is used near a microwave oven, the Wi-Fi connection drops and does not automatically reconnect&lt;/strong>. A manual restart is required. Either keep the device away from the microwave, or add a periodic auto-reset to the firmware.&lt;/p>
&lt;h2 id="summary">Summary&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Item&lt;/th>
&lt;th>Detail&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Total parts cost&lt;/td>
&lt;td>Under JPY 5,000 (roughly 1/3–1/6 of commercial alternatives)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Soldering required&lt;/td>
&lt;td>None&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Setup difficulty&lt;/td>
&lt;td>Low — flash firmware from GitHub and place next to clock&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Signal range&lt;/td>
&lt;td>Short (a few cm to a few tens of cm)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Known issue&lt;/td>
&lt;td>Wi-Fi drops near microwave, requires manual restart&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>A practical and affordable way to keep a radio-controlled clock synced in a room with poor JJY reception. If you are in a similar situation, this combination is well worth trying.&lt;/p></description></item></channel></rss>