Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Build a Self‑Balancing Segway with Raspberry Pi

Step 1: Gather Materials

Step 2: Assemble the Frame

Follow the provided frame instructions to mount the motors, wheels, and electronics onto the chassis. Use the acrylic sheets to create a clean, low‑profile look.

Step 3: Wire the Circuit

Connect the MPU6050 and L293D to the Raspberry Pi and the power supply as shown below. This configuration allows the Pi to read motion data and drive the motors.

Motor driver connections:

Power the L293D with the 12 V adapter, and supply the Pi with its own 5 V adapter.

Step 4: Secure Everything

Use cable ties to clamp all wiring and components firmly in place, ensuring a tidy build that won’t shift during operation.

Step 5: Install Software

Assuming Raspbian is installed and you can SSH into the Pi, set up the I²C kernel module and the WiringPi library. These allow the Pi to communicate with the MPU6050 and control the GPIO pins.

$ sudo apt-get install libi2c-dev

Enable I²C by editing /etc/modules:

i2c-bcm2708
i2c-dev

Ensure the blacklist file /etc/modprobe.d/raspi-blacklist.conf has the following lines commented:

#blacklist spi-bcm2708
#blacklist i2c-bcm2708

Activate I²C via sudo raspi-config (Advanced Options → I²C). Reboot the Pi:

$ sudo bash; sync; sync; reboot

Verify the module loads:

$ lsmod | grep i2c

Install WiringPi:

$ sudo apt-get install git-core
$ git clone https://github.com/WiringPi/WiringPi
$ cd WiringPi
$ sudo ./build

With the hardware and software ready, you can now program the Pi to balance the segway using the MPU6050 data.

Manufacturing process

  1. How to Read Temperature with a DS18B20 on Raspberry Pi 2
  2. Measuring Temperature on Raspberry Pi with Maxim 1‑Wire Sensors and DS2482 I2C Bridge
  3. Accurate Temperature Monitoring in a Server Closet with Raspberry Pi
  4. Lightning Detection with Raspberry Pi and AS3935: A Practical Guide
  5. Build a Headless Raspberry Pi 2 Water Alarm with Adafruit T‑Cobbler Plus
  6. Build a ThingSpeak Temperature Monitor with Raspberry Pi & BrickPi
  7. Build an Automated Aeroponics System with Raspberry Pi and Humidity Sensor
  8. Capturing IR Remote Commands on Raspberry Pi without LIRC: A Python UART Approach
  9. Installing a Raspberry Pi Camera in a Birdhouse – Step‑by‑Step Guide
  10. Build a Robot with Raspberry Pi and Python: A Complete Guide