# Windows GPIO input?

**URL:** https://discourse.nodered.org/t/windows-gpio-input/80207
**Category:** Hardware
**Created:** [1 August 2023 08:35 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207 "2023-08-01T08:35:33Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![rxunique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rxunique/32/70140_2.png) [@rxunique](https://discourse.nodered.org/u/rxunique)
#### Post date: [1 August 2023 08:35 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/1 "2023-08-01T08:35:33Z")

</div>

Hi

I trying to use node red under Windows to monitor status of a limit switch, is it currently open, or is it currently closed.

On raspberry pi with GIPO node this is super easy. On windows it seems pretty challenging for me to find something off the shelf.

There are quite a few USB serial analogue input breakout boards, but my current understanding is they converts a varying voltage input to a digital output. The limit switch does not output any voltage, and I can't just run 3V or 5V power pin to the limit switch for signalling.

Has anyone done anything similar prior? Or perhaps knows what such "USB Dongle" is called?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [1 August 2023 08:44 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/2 "2023-08-01T08:44:47Z")

</div>

A lot of folk use Zigbee and off the shelf devices - then use MQTT for inputs and outputs.

Alternatively, there are many devices that can communicate over serial or Ethernet using varying protocols (custom protocol/modbus protocol/OPC/etc) but prices start rising at this point.  
example: [IoT Ethernet I/O Modules: ADAM-6000/6200 - Advantech](https://www.advantech.com/en/products/iot-ethernet-i-o-modules-adam-6000-6200/sub_gf-5197)

The other solution many do is to setup an ESP device (esp32 or esp8266) and use its GPIO then operate that via MQTT from Node-RED to the ESP.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [2 August 2023 17:14 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/3 "2023-08-02T17:14:52Z")

</div>

Undoubtedly, the best approach is to use a low-cost MPU to handle the GPIO. An Arduino or ESP device is easy to use and you can easily find off-the-shelf firmware that will handle most situations and sensors/switches without further programming.

This approach also protects your expensive laptop from being blown to smithereens by injudicious application of a 5v signal!

An ESP device is a few $ and has either WiFi or Bluetooth remote connections or serial/usb. Most Arduino's have only serial/usb.

---

<div class="post-metadata">

### Author: ![rxunique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rxunique/32/70140_2.png) [@rxunique](https://discourse.nodered.org/u/rxunique)
#### Post date: [3 August 2023 00:53 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/4 "2023-08-03T00:53:09Z")

</div>

Thanks everyone, I was really hoping not to DIY everything, but seems ESP or Pico is the best there currently is

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [3 August 2023 14:52 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/5 "2023-08-03T14:52:14Z")

</div>

I'm sure there are pre-built MPU's you could buy. Would be more expensive of course. And you shouldn't need to DIY the sensor and switch interface programming, there should be existing firmware for that.

---

<div class="post-metadata">

### Author: ![MDAR](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdar/32/10700_2.png) [@MDAR](https://discourse.nodered.org/u/MDAR)
#### Post date: [16 August 2023 06:42 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/6 "2023-08-16T06:42:54Z")

</div>

I agree that hooking up your expensive PC directly is a risk.

But as you're using NodeRed, a simple £20 ESP device seems like a good option.

I am a big fan of the M5stickC-Plus for all kinds of tasks.

$10 M5StickC

> **[M5StickC ESP32-PICO Mini IoT Development Kit](https://shop.m5stack.com/collections/m5-controllers/products/stick-c)**
>
> M5StickC is a mini M5Stack, powered by ESP32. It is a portable, easy-to-use, IoT development board. The open source code & engineering communities that will help you maximize your benefits in every step of the developing process Internet of...

$20 M5stickC-Plus

> **[M5StickC PLUS ESP32-PICO Mini IoT Development Kit](https://shop.m5stack.com/collections/m5-controllers/products/m5stickc-plus-esp32-pico-mini-iot-development-kit)**
>
> M5StickC PLUS supports WiFi and LCD display, built-in esp32-PICO-D4, 6-Axis IMU, infrared, RTC, Microphone, LED, IMU, Buttons, PMU, etc, compatible with UIFlow/MicroPython/Arduino. It's a portable, easy-to-use, open-source, AIoT Development Kit, and...

For example

> [@RGB565 Color Space (mainly for SPI TFT screens)](https://discourse.nodered.org/t/rgb565-color-space-mainly-for-spi-tft-screens/80574):
>
> #RGB565 #RGB888 #RGB #mqtt #M5Stick #ESP32 #gpio #colorpicker I've got a couple of [M5StickC-Plus](https://shop.m5stack.com/collections/m5-controllers/products/m5stickc-plus-esp32-pico-mini-iot-development-kit) devices [image] and have them working with the NodeRED [aedes MQTT broker](https://flows.nodered.org/node/node-red-contrib-aedes), using JSON payloads. example :- {"LED":true,"LEDrate":200,"beep":true,"beepPitch":2000,"bgColour":-1,"colour":-2,"screen":2,"message":"Hello World","SerialDebug":false,"encLED":0xff0000} From there I can read the status of both button, adapt the screen content, set the LED and Beep. I've even included the ability to use […

While the flow and script I've created are a terrible overkill for what you're looking for, it would work perfectly.

There is a Grove port on the bottom of the M5StickC devices, which I've used as 2 GPi pins, to detect 0v contact closures.

The Arduino Script is configured for MQTT **and** Serial (via USB) communication, using a JSON structure.

I'm happy to share the script and sample Flow.

My longer term plan is to adapt my script to work with the smaller M5 Atom S3

> **[ATOMS3 Dev Kit w/ 0.85-inch Screen](https://shop.m5stack.com/products/atoms3-dev-kit-w-0-85-inch-screen)**
>
> AtomS3 is a esp32 development kit based on esp32S3 chip, integrated WiFi function, and 8M FLASH; 0.85 inch IPS screen; Programmable button function,built-in 5V to 3.3V circuit, 6-axis gyro sensor MPU6886.This esp32 board can used as smart home...

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [16 August 2023 08:07 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/7 "2023-08-16T08:07:24Z")

</div>

Somewhat off the topic but ESPHome works with all types of ESP including the M5's even those with screens. It lets you have multiple include files so that you can reuse bits across devices. All my ESP devices run ESPHome now and it greatly simplifies things.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [15 October 2023 08:07 UTC](https://discourse.nodered.org/t/windows-gpio-input/80207/8 "2023-10-15T08:07:44Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
