Click here to see the weeks post
Intro to Arduino and Flashing LEDs
This is a new section of fabrication where well be using Arduino’s. A Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are a piece of hardware that are able to read inputs and turn them into a output.
Arduino Overview
As always the start is learning what it is and how to do basic stuff with it. my initial knowledge on Arduino’s where what i found answering the questions mentioned in this weeks post. now the Arduino i have is a Arduino uno and when it came to coding i was using the Arduino software that you could write sketches which were the code for the Arduino.
The first task with Arduino was turning one of the Arduino LEDs on and off.
Coding Basics
Arduino programming seems pretty simple, all programs have a minimum of 2 blocks that ether act as a Preparation or Execution. A block is a set of statements enclosed in brackets. The simplest programs being “Setup” and “Loop”.
Setup – setup is executed first when the program is initialised. It is uses initialise pin modes and start serial communications and has to be included even if there are no statements to execute. After the function runs the program moves onto the execution block that run other functions like reading inputs, triggering outputs, etc..
Loop – loop is another function thats part of the execution block. it executes the set of statements continuously.
Basic Code: Example
Now how i got the Arduino LED light to work was was downloading the sketch from help examples which can be found as such, File\Examples\Basics\Blink. this is on the Arduino IDE.
Arduino LED in question
Arduino Libraries Arduino Displays
Click here to see the weeks post
This project we used the Arduino uno and paired it with a LCD display. A LCD (Liquid-Crystal Display) is a flat-panel display or other electronically modulated optical device that uses the light-modulating properties of liquid crystals combined with polarisers. Liquid crystals do not emit light directly, instead using a backlight or reflector to produce images in colour or monochrome.
Display to Arduino
Fist step is connecting the LCD display to the Arduino using wires connected as so…
Gnd Red Wire 1: -> Gnd
Vcc Black Wire 1: -> +5V
SDA Red Wire 2: -> A4
SCL Black Wire 2: -> A5
Connected LCD to Arduino
On top of wiring the backlight of the LCD had to be adjusted in order to make contents on screen visible. this was done by twisting the two pins on the back of the LCD that control the backlight.
Blue = Backlight Pins
Arduino code
Next step is loading the example sketch shared to us onto the Arduino software and then onto the Arduino itself. [Example Sketch]
To make sure the code worked i had to Install the LiquidCrystal_I2C.h library. and add it to in order for the software to recognise some of the lines of code.
Outcome
Range finder & Display
Click here to see the weeks post
This project we used the Arduino uno and paired it with a Ultrasonic proximity sensor and later paired with the LCD display from last week to display the distances of whats ahead of the sensor.
Ultrasonic proximity sensor
The Ultrasonic proximity sensors works by omitting and receiving high frequency sound waves that are inaudible, so they cant perceived by the human ears. to detect the presence of a object at distance the emitted waves bouncing back and are detected at different strength that represent there distance.
Sensor to Arduino
like last week the fist step is connecting the Ultrasonic proximity sensors to the Arduino using wires connected as so…
- Gnd to Gnd
- +5V to Vcc
- Trigger to D8
- Echo to D7
Wiring
Next was adding the code shared to the Arduino and checking if it would work. It didn’t but a quick fix lead to getting the proper feedback from the sensor. [Example Sketch]
Serial monitor
The serial monitor is the tether between the computer and Arduino. It lets you send and receive text messages which is handy for debugging and controlling the Arduino from a keyboard. In the serial monitor there is baud which is currently set to 9600 which is the delay between each message.