Gismo is a feature-packed robot built on a Raspberry Pi. It combines a variety of sensors, motors, and interactive components to create a responsive and engaging robotic experience.
Building G.I.S.M.O has been an incredible experience, one that reflects my approach to problem-solving: dive in, experiment, adapt, and refine. It’s messy, exciting, and immensely rewarding—a true labor of love.
Key Features & Capabilities
Motor Control: Gismo can move forward, backward, and turn using two DC motors.
Neck Servo: A servo motor allows Gismo to turn its "head" and scan its surroundings.
Obstacle Avoidance: Gismo uses an ultrasonic sensor to detect objects in its path and avoid collisions.
Edge Detection: Edge sensors prevent Gismo from falling off surfaces.
Buzzer Feedback: A buzzer plays melodies to indicate different events, such as object detection or edge detection.
RGB LED Feedback: An RGB LED provides visual cues, changing color based on Gismo's actions.
Touch Sensor Interaction: Gismo reacts to touch with a shaking motion.
IR Distance Sensor: An infrared distance sensor helps Gismo avoid obstacles while reversing. (Note: This might be the HCSR04 or another specific IR sensor, clarify if needed)
Button Control: A button triggers debugging actions and sensor tests.
Camera Functionality: Gismo can take pictures when it detects an object using its Pi Camera.
IR Remote Control: Control Gismo's movements with an infrared remote.
Sound Sensor: Gismo can react to sounds in its environment.
OLED Display: A small OLED screen (SSD1306) displays a "face" that changes expression based on Gismo's status (happy or sad).
IMU (Inertial Measurement Unit): An MPU9250 IMU provides acceleration, gyroscope, and magnetometer data for advanced navigation and orientation sensing.
Technical Architecture
The robot’s design integrates key hardware components like the Raspberry Pi, sensors, motor controllers, and a power management unit. The software uses a layered architecture for easier debugging and future enhancements.
Gismo Wiring Diagram (Placeholder - Replace with actual image)
Hardware Components & GPIO Assignments
Component
Wire/Signal
Colour
Connection/Pin
Power Source
Raspberry Pi Zero 2W
power
red/black
PCA9685 0
PCA2
SSD1306 Display
SDA
White
PCA9685 SDA
PCA out
SCL
Blue
PCA9685 SCL
PCA out
PCA9685 PWM Driver
SDA
Yellow
Pi GPIO 2
battery
SCL
Blue
Pi GPIO 3
battery
MPU9250 IMU
SDA
White
PCA9685 SDA
PCA15
SCL
Blue
PCA9685 SCL
-
Pi Camera Rev 1.3
-
-
CSI port
-
9G Servo (left)
-
-
PCA9685 Channel 0
PCA0
9G Servo (right)
-
-
PCA9685 Channel 1
PCA1
9G Servo (head)
-
-
PCA9685 Channel 14
PCA14
KY-016 RGB LED (Red)
Red
Red
PCA9685 Channel 13
PCA13
KY-016 RGB LED (Green)
Green
Green
PCA9685 Channel 12
-
KY-016 RGB LED (Blue)
Blue
Blue
PCA9685 Channel 11
PCA10
L298N Motor Driver (power)
-
-
-
PCA11
L298N Motor Driver Int1
Int1
Blue
PCA9685 Channel 7
PCA11
L298N Motor Driver Int2
Int2
Green
PCA9685 Channel 8
PCA9
L298N Motor Driver Int3
Int3
White
PCA9685 Channel 10
PCA8
L298N Motor Driver Int4
Int4
Yellow
PCA9685 Channel 9
PCA7
KY-033 Edge Sensor (right)
Signal
Green
Pi GPIO 12
PCA5
KY-033 Edge Sensor (left)
Signal
Green
Pi GPIO 13
PCA4
CHQ1838 IR Receiver
Signal
Green
Pi GPIO 16
PCA12
TTP223B Touch Sensor
Signal
Green
Pi GPIO 17
PCA8
KY-006 Passive Buzzer
Signal
White
Pi GPIO 18
PCA6
TS-YM-115 Sound Sensor
Signal
White
Pi GPIO 21
PCA9
HCSR04 Ultrasonic Echo
Echo
Green
Pi GPIO 22
PCA7
HCSR04 Ultrasonic Trigger
Trigger
Blue
Pi GPIO 23
-
TP-4056 USB Charger
-
-
LiPo 3.7V
PCA3
Switch 999330
-
-
LiPo 3.7V
-
LiPo 3.7V 1100mAh 903042
-
-
TP-4056 USB Charger
-
This table summarizes the main components, their wiring, GPIO assignments, and power sources for Gismo.
Software & Programming
Primary Language: Python
Key Libraries:
RPi.GPIO
PIL (Pillow)
adafruit_ssd1306
adafruit_pca9685
evdev
mpu9250_jmdev
libcamera-still (for camera functionality via subprocess)
[Any custom libraries/modules you wrote]
Functionality: Motor control, sensor data acquisition, basic navigation algorithms (e.g., obstacle avoidance, dead reckoning for path estimation).
[Add more details about your software architecture, specific algorithms (like how dead reckoning is implemented or used), or interesting coding challenges]
Build Process & Challenges
The construction of Gismo was an iterative journey, starting with a custom 3D-printed chassis designed to house all components compactly and allow for easy access. This was followed by gradually integrating each sensor and actuator. Wiring was a significant challenge, meticulously routing connections for the numerous components to the Raspberry Pi and PCA9685 servo driver while keeping the build clean and manageable.
Key challenges encountered included:
Component Integration: Ensuring all sensors (ultrasonic, IR, IMU, edge sensors, touch, sound) communicated reliably with the Pi, often requiring careful library selection and debugging of I2C and GPIO interactions.
Power Management: Balancing the power requirements of the motors, servos, Pi, and various sensors from a single LiPo battery, and mitigating potential electrical noise from the motors affecting sensor readings.
Sensor Calibration & Interference: Fine-tuning the sensitivity of sensors like the ultrasonic and sound sensor, and addressing potential interference between them. Calibrating the MPU9250 IMU was also a detailed process.
Movement Mechanics: Achieving smooth and predictable movement with the DC motors and L298N driver, including refining PWM values for speed control and turning.
Software Debugging: Iteratively developing and debugging the Python code for sensor polling, motor control logic, obstacle avoidance algorithms, and the state machine for Gismo's "face" expressions.
This project was a profound learning experience, reinforcing the importance of modular design for easier debugging, systematic troubleshooting, and the practical application of electronics and programming skills in a complex, integrated system. The "dive in and figure it out" approach was essential, leading to many "aha!" moments and a much deeper understanding of robotics.
Future Enhancements
Integration of advanced sensors (e.g., LIDAR or Time-of-Flight).
Machine learning for object recognition and more sophisticated decision-making.
Enhanced navigation algorithms for complex environments, potentially incorporating SLAM (Simultaneous Localization and Mapping) capabilities.
Implementation of voice command recognition for more natural interaction.
Development of a web interface for remote monitoring and control.
Improved power efficiency and battery management for longer operational times.
Setup & Usage
Clone the repository:git clone https://github.com/JamesTheGiblet/Project-G.I.S.M.O.git (Replace with your actual username if different)
Install the required libraries:pip install -r requirements.txt (Ensure `requirements.txt` is in the repo)
Connect the hardware components according to the wiring diagram/table.
Configure the IR receiver: Find the correct eventX path for your IR receiver using ls /dev/input/ and update the `device_path` variable in the code.
Run the code:python gismo_v1.13.py (Or your main script name)
Usage Instructions:
Use the IR remote to control Gismo's movements.
Press the button to run sensor tests.
Gismo will automatically avoid obstacles and edges.
Observe the RGB LED and OLED display for visual feedback.