Week 10 – Intro to Arduino and Flashing LEDs

This week is all about researching the basics of an Arduino. To begin, we have been set a task list of three different questions about what they are, what they are used for and which different types there are.

Question 1: What is Arduino?

Arduino is the name of an electronics platform that has been made to be easy to use and as an open source for everyone.and refers to both the hardware and software. Arduino comes in two main parts, the board and the programming.

Arduino boards are a circuit device that can be used to convey instructions, created by the user, from the program’s language and then uploaded to the Arduino. The Arduino will then use these instructions to turn an a variety of inputs, which can be anything like light on a sensor, a button being pressed or as the website for Arduino states, a Twitter message. The built in micro-controller will then turn these inputs into an output of the user’s choice, which can be something like a buzzer, a set of LED’s or a motor.

Arduino also has it’s own programming language and software, which is used by many people around the world to create their own code that allows their Arduino board to do many different things and solve plenty of real-life issues using the a Arduino system.

Key features about Arduino are:

  • Cheap
  • Cross-Platform
  • Simple and clear programming environment
  • Open source extensive hardware and software

Question 2: How many different types of Arduino are there?

After looking into this subject, I have found there to be four different types of Arduino. These are the (Arduino) Uno, Due. Mega, Leonardo. The statistics of these are below:

 

Arduino Board Processor Memory Digital I/O Analogue I/O
Arduino Uno 16Mhz ATmega328 2KB SRAM, 32KB flash 14 6 input, 0 output
Arduino Due 84MHz AT91SAM3X8E 96KB SRAM, 512KB flash 54 12 input, 2 output
Arduino Mega 16MHz ATmega2560 8KB SRAM, 256KB flash 54 16 input, 0 output
Arduino Leonardo 16MHz ATmega32u4 2.5KB SRAM, 32KB flash 20 12 input, 0 output

Question 3: What can an Arduino be used for?

Arduino can be used for an almost infinite number of different projects and ideas, some of these can be nice and simple, others much more elaborate. Some examples of the things you can create using an Arduino are:

  • Controlling an LCD display to use as an interface
  • Controlling LED lights
  • Using sensors such as light, temperature, buttons and motion sensors
  • Range finders
  • Sound sensors
  • Motors
  • Servos

The next item on the list of things to do is to create a sketch and upload it to the Arduino which allows an LED to blink.

You need the Arduino software to be able to do this and the equipment itself. However, due to not having the equipment I will work with what I have and will use Fritzing to supplement this issue.

Below is a very simple circuit set up of what you need in order to make the LED blink using an Arduino:

Once I set up the circuit, I then look into how to make the LED blink on a loop. I found in the examples in the Arduino software an example of how to make an LED blink with an interval of one second. Here is the code that needs to be uploaded to the Arduino:

==========================================================

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

===========================================================

Once this has been uploaded into the Arduino, once you turn it on, the LED will blink with intervals of one second between blinks. However, something we were asked to do, is the idea of changing the intervals of the blinks. This can be easily done by changing the delay in the high and low voltages sections in the code. For example:

digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(10,000); // wait for a 10 seconds

digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

This one will leave the LED on for ten seconds before having a one second interval where the LED is not on. This can be changed to make it the other way round by simply editing the LOW voltage number to be higher and lower to increase or decrease the length of the interval. This can be easily done and can be used to create different effects, with each delay(1000) being the equivalent to one second.

The higher the delay, the longer the interval. Depending on which interval you choose determines whether or not you affect the light being on or off.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *