spdm level 2 smart electronics unit, level 2€¦ · in this digital circuit the components used...

17
SPDM Level 2 Smart Electronics Unit, Level 2 Evidence Folder John Johns Form 3b RSA Tipton

Upload: others

Post on 10-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

SPDM Level 2Smart Electronics Unit, Level 2

Evidence Folder

John Johns

Form 3b

RSA Tipton

Page 2: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

1.1 describe the purpose of circuit components and symbols.

The candidate can describe the purpose of a range of common circuit components either from their names, circuit symbols or from photographs.

●After identifying the components used for Level 2 smart electronics, I wired a series of 2v LED lights to a 9v battery using aBreadboard and resistors. The wiring was represented by a “Fritzing Diagram”, a schematic drawing used to illustrate electroniccircuits.

●The Breadboard is composed of two halves and lettered and numbered 1/2 columns with holes for the insertion of small electricalcomponents. The halves are not connected but the holes in each ½ column are allowing for interconnectivity and the conduction ofelectricity.

●The LED's have two “legs” The short leg is negative or Cathode (-) the longer leg is positive or Anode (+) it is important that the wirescorresponding to the power source, in this case a battery and clip, are properly connected, ground to negative and 9 V to positive asLEDs are sensitive to the flow or direction of current.

●The LED's drew energy from the battery and lit up. It was important to use a resistor to regulate the flow of energy so that the 9V'sfrom the battery did not blow the lower 2V voltage LED's. A switch was also wired in that allowed the energy source to be blocked untilthe switch was pressed.

●I found that different colour LED's appeared brighter than others due to the different materials that they are composed of. Thisdetermines the colour of the LED, not the plastic case surrounding it. The brightness of the LED could also be controlled using apotentiometer that controlled the flow of current going to the light.

This diagram shows the symbols used for drawing a circuit diagramand an example of a circuit.

Page 3: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

Components

Page 4: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

1.2 build valid circuits.

The candidate will be able to build simple circuits that will function as intended.

Torch Arduino LED

I wired first one, then two LEDs to a 9V battery & clip and successfully created a circuit that lit the LEDs.

After wiring 1 LED, multiples were wired in Series (one after the other in separate ½ columns positive to negative legs connectedsharing 1 resistor) and Parallel (same half column but 2 resistors, see photo)

I found that there was a limit to how many LED's could be added before they didn't all light up.

Page 5: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

1.2 build valid circuits.The candidate will be able to build simple circuits that will function as intended.

After wiring Leds to a battery, I developed the simple circuit so that it can connect to an Arduino UNO Microcontroller Developmentboard (MCU)

The Arduino works by processing Microcontroller digital signals and using these to operate whatever electrical components are wiredto it.

We used Arduino software in order to do this, which is based on the C/ C++ language.

This information is passed from the PC to the Arduino board via a USB cable and this also provided power to the unit, replacing the 9Vbattery.

Several pre-loaded Arduino sample programs were used to activate the LEDs, the coding was written to make the LED's “blink” and Iwas able to modify the coding to alter the rate at which this occurred, giving rise to other effects such as fade and traffic lightcombinations.

Page 6: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

1.3 set up and debug a physical analogue circuit for a purpose.The candidate should be able to set up simple working circuits and test them.

I created another circuit using an LED and potentiometer to illustrate an analogue circuit.

The potentiometer works by controlling the flow of current coming from the Arduino to the LED . The light correspondinglyilluminates more or dims according to the energy flow.

The Arduino example program was modified to correctly eflect the new pins added on the Arduino and breadboard, At firstthe upload wasn't successful (upload error message was shown) but after checking the coding was correct, the wiringrevealed a pin was put in the wrong place. Once corrected the program worked and the LED worked with the potentiometer

As an Analoque input

Page 7: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

1.4 explain the difference between analogue and digital products.The candidate should know the meaning of the terms analogue and digital and they should be able to explain somesimple examples.Evidence: From portfolios, internal testing and/or assessor observations.

Analogue signals are those that have a physical, continuous quantity such as light, sound, pressure, temperatureetc.

Digital signals is a type of signal that is composed of fixed values (called discrete values) They can be acoustic,optical, electrical or others and are used in a variety of ways eg telecommunications, electrical circuit software andmusic and images such as CD's and DVD's.

The reproduction of an analogue signal into digital is achieved by sampling the analogue signal and breaking itdown into component parts that have been assigned a digital value (bits) When assembled they reproduce theoriginal analogue signal . The 'higher' the sampling rate the better quality reproduction, a lower rate of samplingcaptures a lesser value snapshot of the original signal and is therefore of a lower quality.

Pseudo analogue is when a digital signal produces a analogue effect for example we made a motor move in realtime in a pulse action by sending digital code through an Arduino microprocessor.

Page 8: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

2.1 describe the purpose of digital circuit components.The candidate can describe the purpose of switches, logic gates and micro-controllers as digital devices.

Digital circuit components are useful to be able to add controlled functions to analogue component. Switches are components that canpass current ("closed") or break the flow of current ("open")

In this example a switch was added to the circuit board to control the flow of electrical current to the LED causing it to light up whendepressed.

In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K anda button/switch. The Arduino board was attached to the computer and was receiving digital signals via the Arduino program that wascoded to allow the LED to light up when the button/switch was depressed.

The wires were carefully placed on the breadboard and the Arduino to provide a complete electrical circuit of 5V aided by the resistorsthat controlled the voltage and the ground pins. Pins 2 and 13 were named in the Arduino program and corresponding code enabledthe action of the LED and button to work correctly

Page 9: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

LED Motor

2.2 create program elements that control physical components.

This circuit was created by powering a small motor with a 9V battery and using the Arduino program andmicroprocessor to send digital signals to the breadboard that made the LED and Motor work in a 'fade' pattern.

This meant the LED lit brightly for a short time then faded as power was reduced and the motor reacted in a parallelaction by speeding up and slowing down. The working components were linked to the pins on the Arduino unit thatwere controlled by the named corresponding pins in the Arduino code written in C language and binary. The values inthe program could be altered by inputting different numbers that had an analogue effect of increasing the fadeeffect of the LED and motor. This is known as “psuedo” analogue because it mimics a n analogue action but iscreated by using a digital signal.

int ledPin = 9; // LED connected to digital pin 9

void setup() {// nothing happens in setup

}

void loop() {// fade in from min to max in increments of 5 points:for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {

// sets the value (range from 0 to 255):analogWrite(ledPin, fadeValue);// wait for 30 milliseconds to see the dimming effectdelay(30);

}

// fade out from max to min in increments of 5 points:for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {

// sets the value (range from 0 to 255):analogWrite(ledPin, fadeValue);// wait for 30 milliseconds to see the dimming effectdelay(30);

}}

Page 10: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

2.3 explain bugs in a control program and get it working.

In the previous button circuit , it did not originally work. After a process of elimination it was discovered that the resistors were both 10kinstead of 1K but also that the Arduino program had incorrectly named a wrong pin number from the example given in the classroom.Once the correct pin number had been added to the code the button worked

Page 11: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

2.4 use logic to control actions.

To be completed.

Page 12: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

3.1 describe the process of analogue to digital conversion.

Analogue signals are those that have a physical, continuous quantity such as light, sound, pressure, temperatureetc.

Digital signals is a type of signal that is composed of fixed values (called discrete values) They can be acoustic,optical, electrical or others and are used in a variety of ways eg telecommunications, electrical circuit software andmusic and images such as CD's and DVD's.

The reproduction of an analogue signal into digital is achieved by sampling the analogue signal with an ADC(analogue to digital converter) and converting it into a digital value (number or 'bits') By breaking the analoguesignal into component parts that have been assigned a digital value (bits) the reproduction quality is determined.The 'higher' the sampling rate the better quality reproduction, a lower rate of sampling captures a lesser valuesnapshot of the original signal and is therefore of a lower quality.

Pseudo analogue is when a digital signal produces a analogue effect for example we made a motor move in realtime in a pulse action by sending digital code through an Arduino microprocessor.

Some examples of sampling rates:

Telephone: 8,000 Hz

Audio CD: 44,100 Hz (44.1 kHz)

DVD Audio: 192,000Hz (192 kHz)

Page 13: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

3.2 build a Smart system.The candidate should be able to build a working Smart system that incorporates electronic control largely self-sufficiently.

The Smart system I have decided to build is a childrens nightlight, LEDs activated with a lightsensor (photoresistor).There will be an overide switch to enable the light to be activated regardless of external lighting conditions if required.A light-dependent resistor, or photoresistor, is a sensor whose resistance decreases as the amount of light falling on it increases. Whenit is dark, the resistance of a photoresistor may be as high as a few MΩ. When it is light, however, the resistance of a photoresistormay be as low as a few hundred ohms.

In this project,Iwill connect a photoresistor to an Arduino analog input and read the value with the analogRead() function. Depending onthe value the Arduino reads, the program will then set pin 3 HIGH or LOW to turn on or turn off the LED night lights. The thresholdvalue is 150. When the analog value read is less than 150, the Arduino will turn the LEDs on. When the analog value it reads is below150, the Arduino will turn the LEDs off.

Hardware Required1 x photoresistor2 x LED2 x 470 ohm resistors1 x 1 kohm resistors1 x Arduino Mega25601 x breadboardjumper wires

Page 14: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

CodeThis is an example of the code I wrote for a circuit consisting of an LED and light sensor. Initially the code did not work and aftercareful examination I noticed that there was a missing line of code at the beginning where the sensor values had not been declared.After this had been added the circuit worked.

int led=3; // variable which stores pin number

void setup(){

pinMode(led, OUTPUT); //configures pin 3 as OUTPUT}

void loop(){

int sensor_value = analogRead(A0);if (sensor_value < 150)// the point at which the state of LEDs change

{digitalWrite(led, HIGH); //sets LEDs ON

}else

{digitalWrite(led,LOW); //Sets LEDs OFF

}

}

Page 15: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

CodeNew codedigitalWrite(led, HIGH); //sets LEDs ON

}

else---

int led=3; // variable which stores pin number

int sensor_value=0;

void setup()

{

pinMode(led, OUTPUT); //configures pin 3 as OUTPUT

}

void loop()

{

int sensor_value = analogRead(A0);

if (sensor_value < 150)// the point at which the state of LEDs change

{

{

digitalWrite(led,LOW); //Sets LEDs OFF

}

}

--

Page 16: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

SPDMAfter learning about electronics and how to write coding for a simple circuit board, I have combined last terms work on 3D CADand created a SMART lighting product that reacts to the environment.

The Rocket night light was created to allow a series of LEDs to react to the surrounding environment by illuminating when thelight drops below a certain level (sensor value) This is detected by the photosensor and does away with the need for manuallyoperated switches, ideal for a children's night light. The project could have been further extended by adding a switch to thecircuit and coding which would have allowed for a manual overdrive if the Rocket were to be used in play.

LED

LED

Photosensor

Page 17: SPDM Level 2 Smart Electronics Unit, Level 2€¦ · In this digital circuit the components used were an LED 2V lamp, wires, an Arduino board, a breadboard, two resistors 1K and 10K

Circuit Diagram for LED with Sensor, to go inside my Smart Night Light