Assignment 3

Microcontroller Programming

To learn about and work on microcontrollers, we were required to complete a task that involed using Aurduino Microcontroller to light up the LEDs in a given manner.

The task for us was:

In groups of two, write your first name by switching 9 LEDs on/off and push buttons such that:

  1.  With press of one push button, the letters of the name blink every 1000 ms
  2.  With press of another push button, all LEDs blink ON and then OFF with a delay of 1000 ms five times.
  3.  Extra credit: Also, print the letter typed on the Serial Monitor


I teamed up with Vaibhav for this assignment as well. I will be sharing the pictures, videos, codes and also how we proceeded with the task, the challenges faced, the testings done.

Components required

 

 

Component

No.s

Use

Breadboard 2

Base for connections

Jumper Wires ~25 Connectors for varions components
Light Emmitting Diodes 9 For output 
Resistors (470 ohm) 9 To control the amount of current flowing through LEDs
Push Buttons 2

To trigger the patterns

Arduino Uno kit 1

To run the code as per desired output

Computer 1

To compile the code

 

21

 

Since I am new to Arduino and its coding, I took some time understanding how the thigs work there. Thanfully I had prior experience with C++ coding, I was comforatble working with the microcontroller within 2 days. To get the desired output using an Arduino, you need to feed the code through the Arduino compiler from the computer.

As per the given task the LEDs are supposed to be arranged in a grid of 3x3. It is important to note that the LEDs need to be connected to the circuit via a resistor or else they might burn out.

Assembling the components

The basic idea is to arrange each LED with a resistor and a separate input terminal in the Arduino. The switching ON and OFF of each terminal based on the position of LED in the grid will give a particular pattern of the grid. 




22

Playing with Patterns

While setting up the circuit, I tested out and explored various patterns. One that I particularly liked was where the LEDs blinked sequentially to appear like a train.

Here's the video for that pattern:

 

Here's the code for the above pattern:

  • LED Train


  • Performing the Task

    Once the testing was complete, I was ready for the given task. I tried performimg the task given to us where my name has to appear on the LED on button press and later on another button press, all LEDs must blink 5 times.





    Here is the final code for the task:

  • "HI TEJAS" and 5 times Blink


  • Similarly, Vaibhav had his name displayed on his bread board. And this is how we completed this task.
    Thank You