Code Monkey home page Code Monkey logo

introductiontorobotics's Introduction

Introduction to Robotics (2023 - 2024)

This is a repository of my solutions to Robotics laboratory homeworks, taken in the 3rd year at the Faculty of Mathematics and Computer Science, University of Bucharest. Each homework includes requirements, implementation details, code and image files

Homework 1 - RGB LED

RGB LED with 3 potentiometers

Components:

  • 1 RGB LED
  • 3 potentiometers
  • 1 resistor and wires as needed

Technical Task:

  • Use a separate potentiometer for controlling each color of the RGB LED: Red, Green, and Blue. This control must leverage digital electronics. Specifically, you need to read the potentiometer’s value with Arduino and then write a mapped value to the LED pins.

Photo:

Video:

Watch the video

Homework2 - Elevator simulator

Elevator simulator

Components:

  • 4 LEDs (3 for each floor and 1 for the elevator's operational state)
  • 3 buttons for floor calls
  • 1 buzzer
  • resistors and wires as needed

Technical Task:

  • Design a control system that simulates a 3-floor elevator using the Arduino platform. Here are the specific requirements:
    • LED Indicators: Each of the 3 LEDs should represent one of the 3 floors. The LED corresponding to the current floor should light up. Additionally, another LED should represent the elevator’s operational state. It should blink when the elevator is moving and remain static when stationary.
    • Buttons: Implement 3 buttons that represent the call buttons from the 3 floors. When pressed, the elevator should simulate movement towards the floor after a short interval (2-3 seconds).
    • Buzzer: The buzzer should sound briefly during the following scenarios:
      • Elevator arriving at the desired floor (something resembling a ”cling”).
      • Elevator doors closing and movement (pro tip: split them into 2 different sounds)
    • State Change & Timers: If the elevator is already at the desired floor, pressing the button for that floor should have no effect. Otherwise, after a button press, the elevator should ”wait for the doors to close” and then ”move” to the corresponding floor. If the elevator is in movement, it should either do nothing or it should stack its decision (get to the first programmed floor, open the doors, wait, close them and then go to the next desired floor).
    • Debounce: Remember to implement debounce for the buttons to avoid unintentional repeated button presses.

Bonus - decision-stack":

  • Added a "decision-stack”. When using a normal elevator, you usually press multiple numbers and the elevator takes you there in order.
  • I incorporated a linked list to keep track of every button pressed, creating a "decision-stack" feature.

Photo:

Video:

Watch the video

Homework3 - 7 segment display drawing

Homework3 - 7 Segment Display Drawing

7 Segment Display Photo

General description:

You will use the joystick to control the position of the segment and ”draw” on the display. The movement between segments should be natural, meaning they should jump from the current position only to neighbors, but without passing through ”walls”.

Components

  • 1 x 7-segment display
  • 1 x joystick
  • Resistors and wires as needed

Technical Task

The 7-segment display should have the initial position on the DP (decimal point). The current position always blinks, regardless of whether the segment is on or off. The joystick is used to move from one position to its neighboring segments.

Button Functions

  • Short pressing the button toggles the segment state from ON to OFF or from OFF to ON.
  • Long pressing the button resets the entire display by turning all the segments OFF and moving the current position to the decimal point.

Video

Watch the video

Homework4 - Stopwatch Timer

Homework4 - Stopwatch Timer

Stopwatch photo

General description:

Using the 4 digit 7 segment display and 3 buttons, you should implement a stopwatch timer that counts in 10ths of a second and has a save lap functionality (similar to most basic stopwatch functions on most phones).

Components

  • 1 x 7-segment display
  • 1 x joystick
  • Resistors and wires as needed
  • 1 7-segment display
  • 3 buttons
  • Resistors and wires as needed

Technical Task

The starting value of the 4 digit 7 segment display should be ”000.0”. Your buttons should have the following functionalities:

  • Button 1: Start / pause.
  • Button 2: Reset (if in pause mode). Reset saved laps (if in lap viewing mode).
  • Button 3: Save lap (if in counting mode), cycle through last saved laps (up to 4 laps).

Workflow

  • Display shows ”000.0”. When pressing the Start button, the timer should start.
  • During timer counter, each time you press the lap button, you should save that timer’s value in memory (not persistent, it is OK to be deleted upon reset), up to 4 laps (or more if you want); pressing the 5th time should override the 1st saved one. If you press the reset button while timer works, nothing happens. If you press the pause button, the timer stops.
  • In Pause Mode, the lap flag button doesn’t work anymore. Pressing the reset button resets you to 000.0.
  • After reset, you can now press the flag buttons to cycle through the lap times. Each time you press the flag button, it takes you to the next saved lap. Pressing it continuously should cycle you through it continuously. Pressing the reset button while in this state resets all your flags and takes the timer back to ”000.0”.

Video

Watch the video

Homework5 - Pseudo-Smart Environment Monitor and Logger

Homework5 - Pseudo-Smart Environment Monitor and Logger

7 Segment Display Photo

General description

Develop a "Smart Environment Monitor and Logger" using Arduino. This system will utilize various sensors to gather environmental data, log this data into EEPROM, and provide both visual feedback via an RGB LED and user interaction through a Serial Menu. The project focuses on integrating sensor readings, memory management, Serial Communication, and the general objective of building a menu.

Components

  • Arduino Uno Board
  • Ultrasonic Sensor (HC-SR04)
  • LDR (Light-Dependent Resistor)
  • RGB LED
  • Resistors as needed
  • Breadboard and connecting wires

Menu structure

1. Sensor Settings

  • 1.1 Sensors Sampling Interval

    Prompt for a value between 1 and 10 seconds. Use this value as a sampling rate for the sensors. You can read a separate value for each or have the same for both.

  • 1.2 Ultrasonic Alert Threshold

    Prompt for a threshold value for the ultrasonic sensor. You can decide if that is the min or max value. When the sensor value exceeds the threshold value, an alert should be given. If the LED is set to Automatic Mode (see section 4.2), it should also turn red if any of the sensors are outside the value.

  • 1.3 LDR Alert Threshold

    Prompt for a threshold value for the LDR sensor. You can decide if that is the min or max value. When the sensor value exceeds the threshold value, an alert should be given. If the LED is set to Automatic Mode (see section 4.2), it should also turn red if any of the sensors are outside the value.

  • 1.4 Back

    Return to the main menu

2. Reset Logger Data

  • 2.1 Yes

  • 2.2 No

3. System Status

  • 3.1 Current Sensor Readings

    Continuously print sensor readings at the set sampling rate, from all sensors. Make sure you have a way to exit this (such as pressing a specific key) and inform the user of this method through a message.

  • 3.2 Current Sensor Settings

    Displays the sampling rate and threshold value for all sensors.

  • 3.3 Display Logged Data

    Displays the last 10 sensor readings for all sensors. (or be creative and do it another way).

  • 3.4 Back

    Return to the Main menu.

4. RGB LED Control

  • 4.1 Manual Color Control

    Set the RGB colors manually. You decide how to input them, either by making an option for each channel or by putting a string, etc. If you expect a specific format, make sure to inform the user.

  • 4.2 LED: Toggle Automatic ON/OFF

    If automatic mode is ON, then the LED color should be GREEN when all sensors value do not exceed threshold values (aka no alert) and RED when there is an alert (aka ANY sensor value exceeds the threshold). When automatic mode is OFF, then the LED should use the last saved RGB values.

  • 4.3 Back

    Return to the main menu

5. IR Control

  • 5.1 Keyboard input

  • 5.2 Remote IR input

Video

Watch the video

Watch the video

Video Menu

Watch the video

Watch the video
Homework6 - Mini 8x8 LED Matrix game

Homework6 - Mini 8x8 LED Matrix game

 Matrix Game Photo

General description:

I developed a small game on an 8x8 matrix. In the game, I included three types of elements: a player (blinking slowly), bullets (blinking fast), and walls (not blinking). The basic idea was to generate walls on the map (occupying 50% - 75% of the map), and then I could move around with the player to destroy them. I implemented it in a Terminator-tanks style. The game map can be dynamically adjusted to any size, but it is displayed on the 8x8 matrix in the form of a fog of war. This adds an extra layer of strategy, allowing players to explore the map as they progress.

Components

  • Arduino Uno Board
  • Joystick
  • 8x8 LED Matrix
  • MAX7219
  • Resistors and capacitors as needed
  • Breadboard and connecting wires

Joystick Functions

  • Move Up: Gently push the joystick upwards to navigate the player character upward on the matrix.
  • Move Down: Similarly, a subtle downward movement of the joystick guides the player character downward within the matrix.
  • Move Left: Tilt the joystick to the left to smoothly shift the player character horizontally to the left.
  • Move Right: Conversely, a tilt to the right accomplishes a seamless movement of the player character to the right.
  • Shoot: Press the joystick to initiate the shooting action, releasing bullets to destroy obstacles and progress in the game.

These responsive joystick controls enhance the gaming experience, providing dynamic and engaging maneuverability for the player.

Video

Watch the video

Homework7 - Mini 8x8 LED Matrix game - Update

Homework7 - Mini 8x8 LED Matrix game - Update

 Matrix Game Photo

New functionalities

  1. Intro Message

    When powering up the project, a greeting message should be shown until the joystick is pressed
  2. Menu

    1. Start game
    2. Settings
    3. About
  3. End message

  4. When the game ends, add a message. Wait for a button push from the user, before returning to main menu again.
  5. During gameplay

    1. I've implemented a dynamic health system in the game. The player's life decreases over time, and relevant details, such as the remaining lives, are displayed. To enhance longevity, players receive additional lives by successfully turning off LEDs.
    2. The game gracefully concludes when the player's life reaches zero. In the event of successfully "destroying" all LEDs, the game also ends. A concluding message is displayed, awaiting user input. Upon user interaction, the game seamlessly returns to the main menu.

Video

Watch the video

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.