Control GPIO using the new Linux user space GPIO API

From the version 4.8, the Linux kernel introduces a new user space API based on character devices for managing and controlling GPIOs ( General-Purpose Input/Output). This post presents the basic of the new interface as well as a simple tutorial/example to demonstrate how to use the new API to control GPIOs.

The hardware used in the tutorial is the Raspberry Pi 3B but the code is generic and can be used on any embedded hardware.

Meet Dolly the robot

Ladies and gentlemen, please meet "Dolly the robot", the first version of my DIY mobile robot. My goal in this DIY project is to make a low-cost yet feature-rich ROS (Robot Operating System) based mobile robot that allow me to experiment my work on autonomous robot at home. To that end, Dolly is designed with all the basic features needed. To keep the bill of material as low as possible, i tried to recycle all of my spare hardware parts.

Specification

  • Robot's chassis is 3D printed, the chassis's plate design is borrowed from the design of Turtlebot 3 which is a smart design, IMO. The other hardware parts, however, are completely different from the Turtlebot 3.
  • IMU sensor with 9 DOF (accelerometer, magnetometer and gyroscope) for robot orientation measurement
  • Two DC motors with magnetic encoders using as wheels and odometer
  • Arduino Mega 2560 for low level control of the robot
  • Raspberry PI 3B+ with embedded Linux for high level algorithm and network communication. The ROS middle-ware on top of the Linux system offers a powerful robotic software environment
  • A 360 degree Neato LiDAR (laser scanner) up to 6 m range
  • A 8 Mega pixel camera (Raspberry PI camera)
  • Adafruit Motor shield V2 for motor controlling
  • 10000 Mah battery
  • ADS1115 analog sensor to measure and monitor battery usage
  • 0.95" (128x64) mini OLED display
  • The robot can be tele-operated using a bluetooth controller such as a PS4 controller

Applications

  • Localization and mapping (SLAM)
  • Obstacle avoidance
  • Autonomous navigation
  • Robot perception algorithms with LIDAR sensor and camera
  • Much more...
Powered by antd server, (c) 2017 - 2024 Dany LE.This site does not use cookie, but some third-party contents (e.g. Youtube, Twitter) may do.