Guides for GPIO in Xojo

Wiring of the HC-SR501 Infrared motion detection
(Updated 1. May 2016)

Shows 2 ways of coding: Using Interrupts or simple polling.
Sensors:  HC-SR501, 
ST-00082 Mini, Mini IR Pyroelectric Infrared PIR Motion Human Sensor Detector Module

Uses: Basic GPIO

Relay wiringRelay board

In this example we  wire up a relay board and let your Xojo code control it.

Uses: Basic GPIO

F85 vibration sensor

F85 vibration sensor

In this example we are going to connect to F85 vibration sensor. This example uses simple polling, and has very easy wiring. Polling can be replaced by using interrupts, see our interrupts examples bellow.

Uses: Basic GPIO

Flame sensor

Flame sensor

In this example we are going to connect to flame sensor. Simple polling, easy wiring

Uses: Basic GPIO

DHT22 sensor

DHT11 and DHT22 humidity & temperature sensors (3 pin version) 

Updated on 24. Oct 2015

Includes DHT11 device driver Xojo Module and DHT22 device driver module.

Uses: Basic GPIO

BMP180 sensor on GY68 brake-outboard

BMP180 Barometer sensor on GY68 brake-out board (4 pin version) – (Updated 29. May 2016)

Includes Xojo module that acts as device driver for the BMP180 sensor.

Uses: I2C bus

IRSensorIR Infrared Obstacle Reflection Photoelectric Sensor

Simple polling, easy wiring

Uses: Basic GPIO

HC-SR04 Ultra sonic sensor

HC-SR04 and US-015 – Ultrasonic sensors

In this example we are going to connect to HC-SR04 and or US-015 ultrasonic sensors

(Updated 18. Apr 2016)

Uses: Basic GPIO

ButtonConnecting button with GPIO and using interrupts.

(Simple wiring, a more involved code)

Uses: Basic GPIO

RGBLed ExplainedWorking with LED’s – And Wiring 4 pin RGB led to Raspberry PI
(Simple wiring, simple code but more detailed focus on the math and how things work)

Uses: Basic GPIO

2N3904Putting the GPIO pin behind transistor to get more current

And also dealing with undetermined state of the GPIO pin at boot time.

Uses: Basic GPIO

OptocouplerOptocouplers  – New 18. April 2016

Creating complete isolation between two separate circuits but sending signals between them.

Uses: Basic GPIO

AND GatesUsing logic gates  – New 8. Nov 2015

Basic introduction of logic gates and how you can use them in your Raspberry PI circuits with Xojo.

Uses: Basic GPIO

MFRC-522 RFID reader in Xojo (Bridged with Python) – New 29. Oct 2016

Connecting to MFRC-522 RFID reader board from Xojo, using Python drivers.

Uses: SPI bus, Python bridge

PCF8591PCF8591 Analog To Digital – Updated 29. May 2016

Raspberry PI has no Analog inputs or outputs, so to talk to analog devices we need to convert the signal.

Uses: I2C bus

PCF8591 Analog To Digital – Braking out of the box PCF8591Final

Building your own Analog to Digital board to over come limits of the bought brake-out board. This way you can connect up to 8 boards getting 32 channels in and 8 channels out.


Uses: I2C bus, and Lots of soldering ! (The final board here at bottom used hot air soldering)

Building I2C logic converter – New 29. May 2016.

In this guide we build our own I2C logic converter to let  3.3V and 5V I2C devices co-exist on same bus. This guide also covers how to wire up some common types of pre-made logic converters.

Uses: I2C bus

LCDImage5HD44780 based LCD display – New 18. May 2016

Guide about how to connect to and control HD44780 displays. 16×2 or 20 x 4 displays. The guide also covers how to send custom Glyphs to the display.

Uses: Basic GPIO


Connecting MAX7219_LED_MATRIX with SPI bus (A free

Einhugur Plugin comes with this guide that acts as device driver for the MAX7219_LED Matrix)

(Updated 8. Now 2015) 

If you want to help with making this archive of knowledge for Xojo Raspberry PI developers then you can submit articles to us, your name would be put on it as author. We would try to reformat if needed it to fit the other articles and add links to how to use breadboard if your article uses such and so on.

Einhugur technical blog that involves Xojo and Einhugur Xojo plugin related topics

%d bloggers like this: