Arduino Seeeduino XIAO Compass QMC5883-GY-271 & OLED Display

by RonFrtek in Circuits > Arduino

218 Views, 0 Favorites, 0 Comments

Arduino Seeeduino XIAO Compass QMC5883-GY-271 & OLED Display

Seeeduino XIAO Compass QMC5883-GY-271 & OLED Display

In this tutorial we will learn how to use the seeduino Xiao with the compass I2C sensor QMC5883 and the OLED Display. We will Display all the axis and the temperature on the OLED Display.

Watch the video!

What You Will Need

oled.png
QMC5883-GY-271.jpg
seeeduino-xiao-all-front_1_SAhS8Yn6jy.jpg
FC8DZC8KK5FQW8Z.jpg
FEGPLRJKK5FQW91.jpg
F19QEZ5KK5FQW90.jpg
  • Seeeduino XIAOLED
  • Compass QMC5883/GY-271 Sensor
  • OLED Display
  • Breadboard
  • Jumper Wires
  • Visuino program: Download Visuino

About Seeeduino XIAO

Grove - TDS Sensor Demo with Seeeduino XIAO
Seeeduino XIAO demo | Smallest Arduino Compatible Board

  • Powerful CPU: ARM® Cortex®-M0+ 32bit 48MHz microcontroller(SAMD21G18) with 256KB Flash,32KB SRAM
  • Flexible compatibility: Compatible with Visuino & Arduino IDE
  • Easy project operation: Breadboard-friendly
  • Small size: As small as a thumb(20x17.5mm) for wearable devices and small projects.
  • Multiple development interfaces: 11 digital/analog pins, 10 PWM Pins, 1 DAC output, 1 SWD Bonding pad interface, 1 I2C interface, 1 UART interface, 1 SPI

interface.Typical Application

  • Wearable devices
  • Rapid prototyping (directly attached to the expanded PCB as a minimal system)Perfect for all the projects need mini Arduino
  • DIY keyboard
  • USB development (USB to multi-channel TTL/USB host mode, etc.)
  • A scenario where you need to read multiple mock values The DAC output

The Circuit

2021-11-10_17-24-19.jpg
Seeeduino-XIAO-I2C-pins.jpg

  • Connect XIAO pin [5V] to Compass sensor pin [VCC]
  • Connect XIAO pin [GND] to Compass sensor pin [GND]
  • Connect XIAO SCL pin [5] to Compass sensor pin [SCL]
  • Connect XIAO SDA pin [4] to Compass sensor pin [SDA]
  • Connect XIAO pin [5V] to OLED Display pin [VCC]
  • Connect XIAO pin [GND] to OLED Display pin [GND]
  • Connect XIAO SCL pin [5] to OLED Display pin [SCL]
  • Connect XIAO SDA pin [4] to OLED Display pin [SDA]

Start Visuino, and Select the Seeeduino XIAO Board Type

FMW5CHBKFV47BP9.jpg
2021-09-27_19-34-08.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Seeeduino XIAO" as shown on Picture 2

In Visuino Add & Set Components

2021-11-10_14-43-36.jpg
2021-11-10_14-44-16.jpg
2021-11-10_14-44-36.jpg
2021-11-10_14-44-55.jpg
2021-11-10_14-45-10.jpg
2021-11-10_14-45-25.jpg
2021-11-10_14-45-39.jpg
2021-11-10_14-45-55.jpg
2021-11-10_14-46-06.jpg
2021-11-10_14-46-22.jpg
2021-11-10_14-46-35.jpg

  • Add "Compass QMC5883/GY-271" component
  • Add "OLED I2C Display" component
  • Double click on the "DisplayOLED1" and in the "Elements" window drag 4X "Draw Text" to the left side and 4X "Text Field" to the left side.
  • In the "Elements" window select "Draw Text1" and in the properties window set "Text" to X
  • In the "Elements" window select "Draw Text2" and in the properties window set "Text" to Y, and "Y" to 20
  • In the "Elements" window select "Draw Text3" and in the properties window set "Text" to Z, and "Y" to 40
  • In the "Elements" window select "Draw Text4" and in the properties window set "Text" to TEMP and "Y" to 55
  • In the "Elements" window select "Text Field1" and in the properties window set "X" to 20
  • In the "Elements" window select "Text Field2" and in the properties window set "X" to 20 and "Y" to 20
  • In the "Elements" window select "Text Field3" and in the properties window set "X" to 20 and "Y" to 40
  • In the "Elements" window select "Text Field4" and in the properties window set "X" to 50 and "Y" to 55

Close the "Elements" window.

In Visuino Connect Components

2021-11-10_14-37-21.jpg
2021-11-10_14-37-54.jpg

  • Connect "Compass1" pin [X] to "DisplayOLED1" pin [Text Field1 In]
  • Connect "Compass1" pin [Y] to "DisplayOLED1" pin [Text Field2 In]
  • Connect "Compass1" pin [Z] to "DisplayOLED1" pin [Text Field3 In]
  • Connect "Compass1" pin [Thermometer] to "DisplayOLED1" pin [Text Field4 In]
  • Connect "Compass1" pin [I2C Out] to XIAO board pin [I2C In]
  • Connect "DisplayOLED1" pin [I2C Out] to XIAO board pin [I2C In]

Generate, Compile, and Upload the Arduino Code

2021-09-27_19-44-59.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Seeeduino XIAO module, the OLED Display will start to show the sensor Values.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Tutorial, you can download it and open it in Visuino: https://www.visuino.eu

Troubleshooting

XIAO-reset.gif

If Port is not detected in Visuino when you try to upload the code do a reset

  • Connect the Seeeduino XIAO to your computer.
  • Use tweezers or short lines to short the RST pins in the diagram twice.
  • The orange LED lights flicker on and light up.

Find out more on this links:

https://forum.seeedstudio.com/t/seeeduino-xiao-com...

https://wiki.seeedstudio.com/Seeeduino-XIAO-by-Nan...