We have a zest for robots. We also have a zest for crabs, so we want to create a small robot that is crustacean-like. The tasks implemented can be generalized to be practical uses in different fields such as construction or self-driving/automated vehicles. Our intended purpose is to create a robot that can successfully follow a wall or a predetermined simple path, avoiding obstacles and correcting its path as needed, and eliminating smaller obstacles entirely by picking them up and moving them out of the way. Since we were inspired by the humble one-armed crab, we will give our robot a little bit of fear. Crabs don’t really like to be observed, and aren’t huge fans of people. Keeping this in mind, we’ll model this behavior with a healthy fear of light. If we shine a bright light on the robot, it will stop in its tracks.

What it does

In this final project, we will make a small robot. Its primary feature will be its ability to pick up objects and place them elsewhere. It should also be able to navigate basic terrain so that it does not run into walls. Additional features involve an LCD screen that reacts to obstacles and bright lights. In the case of a bright light, the robot should make a face, stop moving entirely, then resume its path when the light is gone. In the case of an obstacle in its path, the robot should determine whether or not it is small enough to be moved with its arm, going around if the obstacle is too large.

This means that it will need to be able to produce appropriate PWM signals to control the motors involved in movement (arm and wheels), communicate with the LCD screen, interface with the ADC light-sensor, and use interrupts both to produce PWM signals and control movement if the environment changes. Moreover, since it is a self-contained robot, we will also need to manage the power sources to each peripheral.

How we built it

Rather than the ATmega328p microcontroller used throughout the class, this project was implemented using the ATmega32U4, which is the board that comes mounted on the Romi robot. We chose to split our design into smaller, manageable components, first getting basic movement functioning properly (writing code to control the motorised wheels to drive him forwards/back/left/right), and thoroughly testing each new peripheral added before adding additional functionality. We approached each feature by implementing its basic functionality first, ensuring that it worked smoothly, and then configuring it to fulfil our standards, or interfacing it with the other components.

After that, we attached the IR sensors and tested that they can accurately detect objects. From there, we will want to interface the turning/stopping with the detected objects, so that the robot does not try to drive into objects detected by the IR sensors. At this point, the robot could move around, stopping under light sources, and pausing to remove obstacles in its path. With these peripherals complete, the robot had its core functionality.

We allotted the most time to putting together and programming the robot arm, as this was the most daunting task, and since the arm is such a crucial component to being a crab. We began by exploring the way the three motors in the arm were driven first, attempted to grab objects, and then implemented automatic object detection through interfacing with the IR sensors.

Challenges we ran into

There were some overarching obstacles that made testing and optimisation difficult. For example, throughout the duration of the project and even with the aid of the teaching team, the board’s port couldn’t be detected by a laptop or other device unless it was in bootloader mode. Bootloader mode is only a temporary state for flashing code — so this meant that we were unable to connect to a serial monitor, as the laptop would stop registering that there was a device connected after the board left bootloading mode. This meant that no print statements could be used throughout testing. Min and max ranges had to be determined through trial and error of our input ADC devices.

Accomplishments that we're proud of

Seeing our crab frolic around and grabbing things filled us with joy. This was a fun project to work on and we're proud of our final results! We did not have the full functionality in time for the demo day, but linked below are some more cool videos showing it working completely for anyone who wants to go on this journey with us. :^)))

What we learned

Throughout this project we learned a new microcontroller — applying our comprehension to interpreting another datasheet — and gained confidence with C programming. We also reinforced class and lab contents taught over the course of this semest

What's next for crab

Implementation of LCD 'face', stricter navigation control for centering himself on obstacles to pick up

Built With

  • atmega32u4
  • c
Share this project: