# R-Pico 2 W無線アクセスポイント（SSRやリレーによるコーヒーメーカー、照明などの制御）

**URL:** <https://forum.digikey.com/t/r-pico-2-w-ssr/64905>\
**Category:** 技術的なヒント\
**Tags:** raspberry-pi\
**Created:** [February 2, 2026, 7:29am UTC](https://forum.digikey.com/t/r-pico-2-w-ssr/64905 "2026-02-02T07:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsuneharu\_Fuji](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@Tsuneharu\_Fuji](https://forum.digikey.com/u/Tsuneharu_Fuji)\
**Post date:** [February 2, 2026, 7:29am UTC](https://forum.digikey.com/t/r-pico-2-w-ssr/64905/1 "2026-02-02T07:29:51Z")

</div>

[以前の投稿](https://forum.digikey.com/t/r-pico-2-w-iot-led-5642/63865)では、パソコン、携帯電話、タブレット、ノートパソコンなどのデバイスを接続し、中間にLAN WiFiルータを介さずに、ウェブブラウザから Raspberry Pico 2 W のボード上のLEDの状態を制御できる、直接ポイントツーポイントのWiFiアクセスポイント（ホットスポットのようなもの）をセットアップする方法を紹介しました。以前のコードの数行を修正することで、直接WiFi経由でシンプルなリモートコントロールを実現し、HTTPクライアントからコーヒーメーカーや照明などのデバイスを制御することができます。[DigiKey](https://www.digikey.jp/)では、制御するデバイスに応じて、以下のような設計オプションを多数ご用意しています。

- [ソリッドステートリレー（SSR）](https://www.digikey.jp/ja/products/filter/solid-state-relays-ssr/183?s=N4IgTCBcDaIM4HsA2BLAJgAjgFwIbYFMMAnApXATxAF0BfIA)

[![image](https://global.discourse-cdn.com/digikey/original/3X/4/2/42312b77530ea1ee81f5d27b89d24cb0ec76a5a5.png)](https://www.digikey.jp/ja/products/filter/solid-state-relays-ssr/183?s=N4IgTCBcDaIM4HsA2BLAJgAjgFwIbYFMMAnApXATxAF0BfIA)

- [ロジック出力光アイソレータ](https://www.digikey.jp/ja/products/filter/optocouplers-optoisolators/logic-output-optoisolators/902)

[![image](https://global.discourse-cdn.com/digikey/original/3X/6/e/6eaab0a8a1e7a7904c0d813b0e1c45d04db1ff6f.png)](https://www.digikey.jp/ja/products/detail/onsemi/H11L1M/284866)

- [信号リレー、最大2A](https://www.digikey.jp/ja/products/filter/signal-relays-up-to-2-amps/189?s=N4IgTCBcDaIE4FMA2BDAngZxAXQL5A)

[![image](https://global.discourse-cdn.com/digikey/original/3X/f/7/f74cd4e823c5aab5b7e1adc775cb4b7035bdcd37.png)](https://www.digikey.jp/ja/products/filter/signal-relays-up-to-2-amps/189?s=N4IgTCBcDaIE4FMA2BDAngZxAXQL5A)

- [トライアック、SCR出力光アイソレータ](https://www.digikey.jp/ja/products/filter/optocouplers-optoisolators/triac-scr-output-optoisolators/904)

[![image](https://global.discourse-cdn.com/digikey/original/3X/a/4/a4d8425ea2cc4b90beabc89be1f2a8b263e135e4.png)](https://www.digikey.jp/ja/products/filter/optocouplers-optoisolators/triac-scr-output-optoisolators/904)

- [TRIAC](https://www.digikey.jp/ja/products/filter/triacs/300?s=N4IgTCBcDaIC4CcCWBDAxgZxAXQL5A)

[![image](https://global.discourse-cdn.com/digikey/original/3X/8/8/880b60a54dda65ca7ae3d29daf32587fa478d7d3.png)](https://www.digikey.jp/ja/products/filter/triacs/300?s=N4IgTCBcDaIC4CcCWBDAxgZxAXQL5A)

- [デジタルアイソレータ](https://www.digikey.jp/ja/products/filter/digital-isolators/901?s=N4IgTCBcDaILYEMDmA7ApgFwJYGMAEWAzgPYA2C2xKIAugL5A)

[![image](https://global.discourse-cdn.com/digikey/original/3X/0/7/073a4bfaea774d6a60d512aab635f004ffa84177.png)](https://www.digikey.jp/ja/products/filter/digital-isolators/901?s=N4IgTCBcDaILYEMDmA7ApgFwJCYGMAEWAzgPYA2C2xKIAugL5A)

- （[1EDI20N12AFXUMA1](https://www.digikey.jp/ja/products/detail/infineon-technologies/1EDI20N12AFXUMA1/5959829) などの）ゲートドライバ磁気性カップリング

[![image](https://global.discourse-cdn.com/digikey/original/3X/b/e/bed3e685374f3472066e3a24823bc5e30c59dede.png)](https://www.digikey.jp/ja/products/detail/infineon-technologies/1EDI20N12AFXUMA1/5959829)

- [SI8271BB](https://www.digikey.jp/ja/products/detail/skyworks-solutions-inc/SI8271BB-ISR/7201539) などのアイソレータゲートドライバRFカップリング（パワーシリコンMOSFET、IGBT、SiC FET、GaN FETの駆動に最適）

[![image](https://global.discourse-cdn.com/digikey/original/3X/b/1/b1e18939f32b8022cf848127e06c57c375418ad7.png)](https://www.digikey.jp/ja/products/detail/skyworks-solutions-inc/SI8271BB-ISR/7201539)

- [Si82Bx](https://www.digikey.jp/ja/products/detail/skyworks-solutions-inc/SI82B30ABC-IS/25703606)（[評価ボード](https://www.digikey.jp/ja/products/detail/skyworks-solutions-inc/SI82F39ABC-KIT/23330239)）などのアイソレータゲートドライバ静電容量カップリング（パワーシリコン MOSFET、IGBT、SiC FET、GaN FET の駆動に最適）

[![image](https://global.discourse-cdn.com/digikey/original/3X/b/1/b1e18939f32b8022cf848127e06c57c375418ad7.png)](https://www.digikey.jp/ja/products/detail/skyworks-solutions-inc/SI82B30ABC-IS/25703606)

ここで、この目的に使用できるコンポーネントをいくつか挙げます（もちろん、制御する電気機器に依存します）。これは、このCコードの応用例であり、適切な設計と安全ガイドラインに従ってください。これは、フェイルセーフの二値制御設計を作成しようとするものではありません（このプラットフォームは、完全なフェイルセーフ制御ソリューションとして使用するものでもありません）。[以前の投稿](https://forum.digikey.com/t/r-pico-2-w-iot-led-5642/63865)で使用したCコードのうち、必要に応じて変更できる関連行は以下のとおりです。

```auto
#define HTTP_RESPONSE_HEADERS "HTTP/1.1 %d OK\nContent-Length: %d\nContent-Type: text/html; charset=utf-8\nConnection: close\n\n"
#define LED_TEST_BODY "<html><body><h1>Hello from Pico.</h1><p>Led is %s</p><p><a href=\"?led=%d\">Turn led %s</a></body></html>"
#define LED_PARAM "led=%d"
#define LED_TEST "/ledtest"
#define LED_GPIO 0
#define HTTP_RESPONSE_REDIRECT "HTTP/1.1 302 Redirect\nLocation: http://%s" LED_TEST "\n\n"

```

必要に応じてカスタマイズし（これはhttpとhtmlフォーマットのメッセージで、カスタマイズしたコーヒーメーカー、照明、扇風機などに変更できます）、Cコード内のGPIO端子（GP）を使用して、必要なGPIO（General Purpose Input Output）端子を使用します。以下の図は、評価ボードで利用可能なGPIO端子を示しています。

 ![image](https://global.discourse-cdn.com/digikey/original/3X/e/b/eb8d408633cacc36b7449e0fd37412a250531442.png)

C SDKのGPIOライブラリをアプリケーションに追加し、上記に示された図を使用し、関数を使って必要なGPIOポートを初期化します。GPIO設定の状態を変更する関数を追加するために、[以前の投稿](https://forum.digikey.com/t/r-pico-2-w-iot-led-5642/63865)のコードの以下の部分を修正します（緑色のLED関数はインジケータとして残すことができます）。

```auto
// See if the user changed it
        if (params) {
            int led_param = sscanf(params, LED_PARAM, &led_state);
            if (led_param == 1) {
                if (led_state) {
                    // Turn led on
                    cyw43_gpio_set(&cyw43_state, LED_GPIO, true);

                   //Add function to control GPIO here (Turn on device)

                } else {
                    // Turn led off
                    cyw43_gpio_set(&cyw43_state, LED_GPIO, false);

                     //Add function to control GPIO here (Turn off device)

                }
            }
        }

```

アプリケーションをビルドして [Raspberry Pico 2 W](https://www.digikey.jp/ja/products/detail/raspberry-pi/SC1633/25862726) に書き込みます。GPIOを選択したら、外部回路を接続して、リレーやソリッドステートリレーなどを制御する個別のGPIO信号を調整します。出力回路によっては、制御対象のデバイスを変更する（状態を反転させる）可能性があるため、必要に応じてコードを変更する必要があることに留意してください。必要なソリューションによっては、他の個別の駆動方式が必要になることもあります。それぞれの電気機器を制御する無線アクセスポイントは、固有のWiFiホットスポットのID（CoffeMaker、Room1Lamp、FanonRoom1など）と対応するパスワードでカスタマイズできます。これらのデバイスはすべて同時に使用できます。 [Raspberry Pico 2 W](https://www.digikey.jp/ja/products/detail/raspberry-pi/SC1633/25862726) は[DigiKey](https://www.digikey.jp/)から購入できます。どうぞ良い一日を！

[![image](https://global.discourse-cdn.com/digikey/original/3X/e/4/e4d95a7f45bab49b58cbd24caf897894900b654c.png)](https://www.digikey.jp/ja/products/detail/raspberry-pi/SC1633/25862726)

[ソリッドステートリレー（SSR）](https://www.digikey.jp/ja/products/filter/solid-state-relays-ssr/183?s=N4IgTCBcDaIM4HsA2BLAJgAjgFwIbYFMMAnApXATzhAF0BfIA)

[電子部品および部品検索 | DigiKey Electronics](https://www.digikey.jp/ja/products/result?s=N4IgTCBcDaIE4FMA2BDAngZxAXQL5A)

この記事はスペイン語で[こちら](https://forum.digikey.com/t/r-pico-2-w-wireless-access-point-controlar-su-maquina-de-cafe-lampara-etc-con-ssr-relay/62888)からご覧いただけます。

Este artículo está disponible en español [aquí](https://forum.digikey.com/t/r-pico-2-w-wireless-access-point-controlar-su-maquina-de-cafe-lampara-etc-con-ssr-relay/62888).

[オリジナル・ソース（English）](https://forum.digikey.com/t/r-pico-2-w-wireless-access-point-controlling-your-coffee-maker-lamp-etc-via-ssr-or-relay/62833)
