Everything related to the course.
- Development of POC (Proof of Concept) and Final Product Development Skills
- Encouragement of Critical Thinking and Problem Solving
- Programming Skills Development
- Understanding Basic Robotics Concepts
- Understanding and Using Microcontrollers
This repo will contain all materials related to the laboratory. The code for each project is available in it's specific folder.
- 1x RGB Led
- 3x Potentiometers
- 1x Arduino Uno
- 1x Half breadboard
- 1x 220Ω rezistor
- 2x 100Ω rezistors
- many colorful wires
This assignment focuses on controlling each channel (Red, Green, and Blue) of an RGB LED using individual potentiometers. By the end of this task, you will gain experience in interfacing potentiometers with the Arduino and controlling RGB LEDs based on the analog readings.
Development process
1x 220Ω rezistor
This initial version used only ore resistor for the entire circuit. It did work, however, the red LED was significantly brighter than the others. According to this article, the voltage drop of the LED tends to rise as the frequency of the light wave increases. Therefore, it is suitable to use different resistors for each color of the RGB LED.
With the available choices, I've selected 2x 100Ω resistors for the blue and green LEDs.
Filtering signal
This second version brings modifications to the code. The main flaw of version 1 was the flickering of the green LED when adjusting the other knobs. I`ve manually implemented a high pass filter such that values below a certain threshold would not register.
LED values are now updated every 10 mills, attempting to reduce flickering and provide a smoother output.
- 5x LEDs
- 4x Buttons
- 1x Active Buzzer
- 1x Arduino Uno
- 1x Full breadboard
- 1x Mini breadboard
- 4x 220Ω rezistor
- 2x 100Ω rezistors
- many colorful wires
This assignment involves simulating a 3-floor elevator control system using LEDs, buttons, and a buzzer with Arduino. By the end of this task, you will gain experience in using button state change, implementing debouncing techniques, and coordinating multiple components to represent real-world scenarios.
How it works:
The first part of the main loop is dedicated to deboucing the 4 buttons. Each iteration of loop() checks whether button _#indexButton_ has been pressed and starts the debouncing proccess.
The elevator is controlled in a 5 stage system:
Stage | Meaning |
---|---|
-2 | descending |
-1 | has descended, is now stopped |
0 | completedly stopped |
1 | has descended, is now stopped |
2 | ascending |
Stages -1 and 1 are used to keep a smoother operation of the elevator. A real evelator tends to keep the direction of movement unless there are no floors to visit in that direction. For example:
Elevator is at floor 2;
Buttons on floors 3, 1 and 4 are pressed in this order;
The common order we would want the elevator to travel is: 3 -> 4 -> 1, despite the actual pressing order.
This is implemented by keeping track of the last direction of travel and prioritizing the visit of floors in that direction.
Similarly, a stage system is used to keep track of the functionality of the doors:
Stage | Meaning |
---|---|
-2 | opening |
-1 | closing |
0 | closed |
1 | open |
Every time a new floor is reached, the elevator checks whether the button for that floor has been pressed and only opens the doors if that is the case. During closing and opening of the doors, a 2-note sound is played.
- 1x 7-Segment Display
- 1x Joystick
- 1x Arduino Uno
- 1x Half breadboard
- 1x Mini breadboard
- 8x 330Ω rezistors
- many colorful wires
Wokwi Implementation - using interrupts.
The task involves using the joystick to control the position of the segment and "draw" on the display. The objective is to ensure that the movement between segments is natural, allowing jumps only to neighboring positions without passing through "walls." The initial position should be on the DP. The current position always blinks (irrespective of the fact that the segment is on or off). Use the joystick to move from one position to neighbors (see table for corresponding movement). 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.
How it works:
In the first part of the program we declare the movement matrix that keeps track of the possible moves from each position on the 7-segment display.
Current | UP | DOWN | LEFT | RIGHT |
---|---|---|---|---|
a | N/A | g | f | b |
b | a | g | f | N/A |
c | g | d | e | dp |
d | g | N/A | e | c |
e | g | d | N/A | c |
f | a | g | N/A | b |
g | a | d | N/A | N/A |
dp | N/A | N/A | c | N/A |
- 1x 4 digit 7 Segment Display
- 3x Buttons
- 1x Arduino Uno
- 2x Half breadboards
- 1x 74HC595shift register
- many 330Ω rezistors
- many colorful wires
Using the 4-digit 7-segment display and three buttons, the task is implementing a stopwatch timer capable of counting in tenths of a second. Additionally, the design should incorporate a save lap functionality, akin to the basic stopwatch features commonly found on most phones.
How it works:
- 1x RGB Led
- 1x Ultrasonic Sensor (HC-SR04)
- 1x Light-Dependent Resistor
- 1x Arduino Uno
- 1x Half breadboard
- 1x Mini breadboard
- 1x 220Ω rezistor
- 1x 10KΩ rezistor
- 2x 100Ω rezistors
- many colorful wires
Wokwi Implementation - code only.
Demo link - TBA
The task involves developing a "Smart Environment Monitor and Logger" using Arduino. This system aims to utilize various sensors for gathering environmental data, logging this information into EEPROM, and offering visual feedback through an RGB LED. Additionally, it should provide user interaction via a Serial Menu. The project emphasizes the integration of sensor readings, memory management, Serial Communication, and the overall goal of constructing a menu.
In order to prevent wear on the EEPROM, the system should avoid excessive writing. It is recommended to refrain from using EEPROM.write and instead utilize EEPROM.update() or EEPROM.put() for more efficient write cycles.
Calibration of sensors is crucial for obtaining accurate readings. It is imperative to ensure that sensors are correctly calibrated, and their interval values are well-known and accounted for in the system.
To enhance the robustness of Serial Communication, the system should implement error handling mechanisms. This includes the ability to manage and respond to incorrect inputs, ensuring a more reliable and resilient communication interface.
How it works:
The main loop constantly reads data form the sensors and triggers the alert if necessary. It is also responsible for reading input from serial, which it than passes to:
void advanceMenu(int option);
This function takes over the main functionality of the program. It takes the input from the user and uses it to perform the required action, according to the number of the current menu. This function implements a giant switch.
void printMenu();
Works identical to advanceMenu(), but is only responsible for printing the options available in the current menu.
short movementMatrix[MENUS][MAX_MENU_OPTIONS]={
{-1,1,2,3,4},
{-1,11,12,13,0},
{-1,21,22,23,0},
{-1,31,32,33,0},
{-1,41,42,0,-1},
};
In order to traverse faster between menus, I've implemented this movement matrix that keeps track of what menu (or submenu) the program should switch to next.
- 📐 Wokwi - Project diagram application.
♣️ Arduino Style Guide - Style guided started by Andrei Dumitriu.- 📘 Arduino Language Reference - Arduino Documentation.
- All courses, laboratories and homework assignments were provided by Ph. D candidate Andrei Dumitriu.
- Lab tutor, friendly face and always there to answer questions: Vlad Toader