• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
Maker Hacks

Maker Hacks

Ideas, news & tutorials for makers and hackers – Arduino/Raspberry Pi, 3D printing, robotics, laser cutting, and more

  • Home
  • About
  • 3D Printing
  • Laser Cutting
  • YouTube
  • Free Arduino Course
  • Recommendations
  • Contact

Ultrasonic Rangefinding with the Wio Terminal and Grove Ultrasonic Sensor

You are here: Home / Hardware / Ultrasonic Rangefinding with the Wio Terminal and Grove Ultrasonic Sensor
FacebookTweetPin
Author: Chris Garrett

Seeed sent me a Wio Terminal to play with, and I have to say I am impressed.

Rather than do a straight review, I thought I would show how easy it is to make a quick project with it.

As you can tell, I like it! For under $30 this little guy delivers:

  • ARM Cortex 120-200MHz ATSAMD51 with BLE / BLE 5.0 bluetooth and 2.4Ghz / 5Ghz Wi-Fi
  • 4 MB External Flash, 192 KB RAM
  • 2.4” LCD Screen + buttons and joystick
  • Accelerometer, microphone, buzzer, light sensor
  • microSD, SPI, I2C, I2S, ADC, DAC, PWM, UART
  • Infrared emitter,
  • 2x Grove ports
  • USB Host/Client OTG
  • 40-pin Raspberry Pi compatible GPIO (Can be mounted to a Pi or use Pi HAT!)
Wio Terminal

Check out the intro video here for a better idea what is packed into the tiny box.

It can be coded with Arduino or Micro/CircuitPython.

Just take a look at what the community has built with it already.

Some pretty impressive stuff, I am sure you will agree.

Display, IoT + the Grove Ecosystem

What really makes this stand out is it isn’t just powerful for the price, it’s not just wireless, it hasn’t just got a pretty display … it’s all that AND it enables use of the plug-and-play Grove system of sensors and inputs!

I am a big fan of the Grove Ecosystem (and have been for a while), especially when working with kids and folks like me who don’t want to touch a soldering iron unless 100% necessary.

Here is my ultrasonic range finding example in action.

Setting up CircuitPython is as simple as downloading the firmware file from the link above, double clicking the reset button, and dragging the firmware to the CircuitPython drive that pops up. Saving your code is a simple case of writing code.py to the same drive.

Wio Terminal Pinouts Pin Diagram

The sensor plugs into the right-hand port in the case as you look at the screen, which is the Analog A0 input.

Add the code below to try it out:

import board
import pulseio
import time
import board
import terminalio
from adafruit_display_text import label
sig = pulseio.PulseIn(board.A0)
text = "000.0000 [cm]"
text_area = label.Label(terminalio.FONT, text=text)
text_area.x = 10
text_area.y = 10
while True:
    sig.pause()
    sig.clear()
    sig.resume(10)
    time.sleep(0.1) # should poll len(sig) here with a timeout
    sig.pause()
    sig_value = sig[0]*0.017
    if len(sig) != 0 and sig_value < 500:
        text= "{:6.2f} [cm]".format(sig_value)
    text_area.text = text
    board.DISPLAY.show(text_area)
    

If you really want to get fancy, you can change the text color or the font face.

The fonts are bitmap fonts in the BDF format. You can drag and drop a font file onto the CircuitPython drive and change the following:

from adafruit_bitmap_font import bitmap_font
text = "000.0000 [cm]"
FONT = bitmap_font.load_font("/IBMPlexMono-Medium-24_jep.bdf")
text_area = label.Label(FONT, text=text)
text_area.x = 20
text_area.y = 20

Related

Category: HardwareTag: Hacks
FacebookTweetPin

About Chris Garrett

Marketing nerd by day, maker, retro gaming, tabletop war/roleplaying nerd by night. Co-author of the Problogger Book with Darren Rowse. Husband, Dad, 🇨🇦 Canadian.

Check out Retro Game Coders for retro gaming/computing.

☕️ Support Maker Hacks on Ko-Fi and get exclusive content and rewards!

Previous Post:Programming the Amiga with AMOS BASIC: A Playable “Shoot ’em up” Game
Next Post:Easiest. Hackintosh. Ever. – How to Install MacOS Virtual Machine on Your PC Using Sosumi & Ubuntu

Sidebar

  • Facebook
  • Twitter
  • Instagram
  • YouTube

Recently Popular

  • Gweike Cloud Review
  • How to choose the right 3D printer for you
  • Glowforge Review – Glowforge Laser Engraver Impressions, Plus Glowforge Versus Leading Laser Cutters
  • Prusa i3 Mk3S Review
  • Best 3D Printing Facebook Groups
  • xTool D1 Pro Laser Cutter Review
  • Elegoo Mars Review – Review of the Elegoo Mars MSLA Resin 3D Printer
  • Glowforge ‘Pass-Through’ Hack: Tricking the Front Flap of the Glowforge with Magnets to Increase Capacity
  • How to Make a DIY “Internet of Things” Thermometer with ESP8266/Arduino
  • Wanhao Duplicator i3 Review
  • IKEA 3D Printer Enclosure Hack for Wanhao Di3
  • Creality CR-10 3d printer review – Large format, quality output, at a low price!
  • 3D Printed Tardis with Arduino Lights and Sounds
  • Anet A8 Review – Budget ($200 or less!) 3D Printer Kit Review
  • Make your own PEI 3D printer bed and get every print to stick!
  • Upgrading the Wanhao Di3 from Good to Amazing
  • How to Install and Set Up Octopi / Octoprint
  • Creality CR-10 S5 Review
  • Glowforge Air Filter Review
  • Thunder Laser Review
  • 3D Printing
  • CNC
  • Hardware
  • Laser Cutting
  • News
  • Retro Computing
  • Software

amiga amos arduino basic programming budget buying cad cnc commodore corexy c programming creality crypto doctor who emulation esp32 esp8266 filament fpga glowforge Hacks Ideas kids lighting linux Makes making Monoprice Parts pc props prusa python raspberry pi ratrig resin Reviews robots software sounds technology tips upgrades wanhao xtool

.

Maker Hacks Blog Copyright © 2023 · All Rights Reserved · Powered by Mai Theme