LAB PRACTICAL REPORT: SENSORS AND ARDUINO UNO BOARD Submitted by: AKHIB PASHA 16035944 SECTION A CONTENTS ARDUINO UNO BOARD 2-3 1.
2. 3. 4.
5. ATMEGA328P MICROCONTROLLER · FUNCTION · VOLTAGE/CURRENT RANGE · OUTPUT VALUE(S) · APPLICATIONS IN-CIRCUIT SERIAL PROGRAMMER (ATMEGA328P MICROCONTROLLER) · FUNCTION · VOLTAGE/CURRENT RANGE · OUTPUT VALUE(S) · APPLICATIONS 5V VOLTAGE-REGULATOR · FUNCTION · VOLTAGE/CURRENT RANGE · OUTPUT VALUE(S) · APPLICATIONS 16MHz RESONATOR · FUNCTION · VOLTAGE/CURRENT RANGE · OUTPUT VALUE(S) · APPLICATIONS P-CHANNEL MOSFET · FUNCTION · VOLTAGE/CURRENT RANGE · OUTPUT VALUE(S) · APPLICATIONS 2 2 3 3 3 SECTION B WIRING DIAGRAM 3-4 SECTION C Informal wiring diagram of a Servo-Actuator-Potentiometer setup with Arduino Uno board SENSORS 4-5 1. 2. SECTION D ULTRASONIC SENSOR (HC-SR04) · OPERATINGRANGE (VOLTAGE/CURRENT) · AUTOMOTIVE APPLICATIONS · POSSIBLE INACCURACIES POTENTIOMETER · OPERATINGRANGE(VOLTAGE/CURRENT) · AUTOMOTIVE APPLICATIONS · POSSIBLE INACCURACIES CODING FOR SERVO-SENSOR SETUP WITH POTENTIOMETER.
4-5 5-6 6 SECTION A: ARDUINO BOARD Fig 1.Arduino Uno board1. ATMEGA328PMICROCONTROLLERFUNCTION: ATMEGA328Pis a microcontroller from the AVR family; it is an 8-bit device, which meansthat its data-bus architecture and internal registers are designed to handle 8parallel data signals.It has 3 types of memory:· FLASHMEMORY: It is used for storing application, which explainswhy you don’t need to upload your application every time you unplug Arduinofrom its power source.
· SRAMMEMORY: Storing variables used by the application while it’srunning.· EEPROMMEMORY: It is used to store data that must be available evenafter the board is powered down and then powered up again.VOLTAGE/CURRENT RANGE:· ATMEGA 328P microcontroller accepts supply voltagesfrom 1.8V to 5.5V.· Current range: +40mA· Operating frequency:16MHzOUTPUT VALUE(S): Current: -40mAAPPLICATIONS:This product helps the automotive OEM’s develop vehicles that are safer,cleaner, more fuel efficient and more reliable.· APS control system, · Camera vision system, · Controller area network (CAN), · Capacitive discharge ignition, · LED Lighting, · Remote keyless entry, · Smart actuators, · Wiper controller systems.2.
IN-CIRCUITSERIAL PROGRAMMER (ATMEGA328P MICROCONTROLLER)FUNCTION: In-SystemProgramming (ISP) is a technique where a programmable device is programmedafter the device is placed in a circuit board. ICSP is an enhanced ISPtechnique implemented in microchips one-time programmable (OTP) and FLASH RISCmicrocontroller unit. Use of only two I/O pins to serially input and outputdata makes ICSP easy to use and less intrusive on the normal operation of themicrocontroller unit.VOLTAGE/CURRENT RANGE:· Voltage range: 5V· Current: +40mA.APPLICATIONS: · Serial communication without PC or laptop. · It is also used to update Arduino software.
· It is a protocol used to programme Arduino.3. 5VVOLTAGE-REGULATORFUNCTION: Avoltage regulator generates a fixed output voltage of a pre-set magnitude thatremains constant irrespective of changes in its input voltage or loadconditions.VOLTAGE/CURRENT RANGE:Maxinput voltage ranges from 7V-35V andstandby current 5 mA.OUTPUT VALUES: This is the basic L7805 voltage regulator, a 3-terminal positiveregulator with a 5Vfixed output voltage. This fixed regulator provides a localregulation, internal current limiting, thermal shut-down control, and safe areaprotection. Each one of these voltage regulators can output a max current of1.5A.
APPLICATIONS:· Internal combustion engine,· Current regulator,· Regulated dual supply,· Building circuits for phone charger,· Ups power supply circuits,· Portable CD player etc.4. 16MHzRESONATORFUNCTION: Itis use to generate clock signals.
It is an electronic component consisting of a piece of piezoelectricceramic material with two or more metal electrodes attached. When connected inan electronic oscillator circuit, resonant mechanical vibrations in the devicegenerates an oscillating signal of a specific frequency.VOLTAGE/CURRENT RANGE:· Voltage: 5V· Current: 40mA APPLICATIONS:· It can used as a source of the clock signals fordigital circuits.· It is used in circuitry in TV’S, automotive electronicdevices, telephones etc.
· It can be used as a signal generator in an electroniccircuitry.5. P-CHANNELMOSFETFUNCTION: Howto drive P-channel MOSFET with ATMEGA328P MICROCONTROLLER?P-channel MOSFETs are useful for switching positive supply of a targetcircuit ON and OFF. Particular attention must be placed to the target circuitensuring that the supply voltage is greater than the microcontroller’s logicvoltages.VOLTAGE/CURRENT RANGE:Voltage:-5VCurrent:-4amps.
APPLICATIONS:· MOSFET can be used as a switch to operate a DC motor.· Controlling the intensity of an array of LEDS· Switching lamp.· Switch mode power supplies, variables frequencydrives.· Radio systems use MOSFETs as oscillators or mixers toconvert frequencies.SECTIONB: WIRING DIAGRAMInformal wiring diagram of aServo-Actuator-Potentiometer setup with Arduino Uno board: Fig2. WiringdiagramThe potentiometer terminals are wired so that its middle pin(green) is connected to analog input 0 onthe Arduino Uno board, and its two outer pins( orange and blue) are connected to power +5V and ground.Theservo motors have 3-wires: yellow (SIGNAL), blue (POWER) and red (GROUND).
The signal pin wire (yellow) is connected to a digital pin 9 on the digitaloutput, the power wire (blue) is connected to the 5V pin on Arduino board andthe ground wire (red) is connected a ground pin on the Arduino Uno board.WHYHAVE YOU CONNECTED IT TO A DIGITAL/ANALOGUE PIN?1. The 10 k? potentiometer’s middle pin is connectedto the analog input pin.When the shaft of the potentiometer is turned, the amount of resistancecan be change on either side of the wiper which is connected to the centre pinof the potentiometer. This changes gives the different analog input, relative”closeness” of the pin to 5volts and ground. When the shaft of thepotentiometer is turned all the way in one direction, there are 0volts going tothe pin, and we read 0. When the shaft is turned all the way in the otherdirection, there are 5volts going to the pin and we read1023.
In between,analogRead() returns a number between 0 and 1023 that is proportional to theamount of voltage being applied to the pin.2. The signalpin wire (yellow) is connected to a digital pin 9 on the digital output.Theamount of time the servo will be ON and OFF depends on the value obtained byanalogRead().Digitalpins configured as OUTPUT with Pinmode() are said to be in a low-impedancestate. Output digital pins can provide a substantial amount of current toservo. ATMEGA pins can source +40mA or sink -40mA of current to servo.
Thiscurrent is enough to run servo motor.IS ITNECESSARY FOR A RESISTOR TO BE INCLUDED AND WHY?RESISTOR: “Aresistor is a passive electrical component with the primary function to limitthe flow of electric current”.The potentiometer is an electric instrument that is used for measuringvoltage by comparison of an unknown voltage with a known reference voltage.
Afraction of a known voltage from a resistive slide wire is compared with anunknown voltage by means of a galvanometer.SECTIONC: SENSORS1.ULTRASONICSENSOR (HC-SR04)An ultrasonic sensor transmits ultrasonic waves into the air and detectsreflected waves from an object. The sensor head emits an ultrasonic wave andreceives the wave reflected back from the target. This sensor provides 2 cm to400 cm of non-contact measurement functionality with a ranging accuracy thatcan reach up to 3 mm.Ultrasonic sensors are driven by intermittent waves called burst waves.
It includes an ultrasonic transmitter, a receiver and a control unit. Fig3. Working of ultrasonic sensorThe transmitter transmits the ultrasonic waves towards the object to bedetected. The receiver receives the echo from the target and determines itsdistance. Fig4.
4-pin ultrasonic sensor OPERATING RANGE (VOLTAGE/CURRENT):· Voltage: DC 5V· Current: 15mA· Frequency: 40Hz· Measuring angle: 15º· Ranging distance: 2 – 4 cm.AUTOMOTIVE APPLICATIONS:· Ultrasonic sensors for parking cars- parking sensorsuse a type of SONAR· Car detection sensor· Near-distance obstacle detection· Fuel levelPOSSIBLE INACCURACIES:· It is very sensitive to variation in the temperature.· It has more difficulties in reading reflections fromsoft, curved, thin and small objects.2.
POTENTIOMETERA potentiometer is a 3 terminal resistor with a sliding or rotatingcontact that forms an adjustable voltage divider. The potentiometer is anelectric instrument that is used for measuring voltage by comparison of anunknown voltage with a known reference voltage. A fraction of a known voltagefrom a resistive slide wire is compared with an unknown voltage by means ofa galvanometer. The sliding contact or wiper of the potentiometer isadjusted and the galvanometer is briefly connected between the sliding contactand the unknown voltage. The deflection of the galvanometer is observed and thesliding tap is adjusted until the galvanometer no longer deflects from zero.
Atthat point the galvanometer draws no current from the unknown source, and themagnitude of voltage can be calculated from the position of the slidingcontact.Thepotentiometer terminals are wired so that its middle pin is connected to analoginput 0 on the Arduino Uno board, and its two outer pins are connected to power+5V and ground. Fig5. 3pin PotentiometerOPERATING RANGE (VOLTAGE/CURRENT):· Length of stroke: <1" to 29" or more· Voltage : 0 to VCC· Resistive value:10 k?· Current: 50V AC· Sensor value ranging: 0 to 4095.AUTOMOTIVE APPLICATIONS:· Car stereos, dimmers, equalizers.· Crankshaft and camshaft rotational control of sparkand fuel injection timing.· In electronically controlled gear shifting to detecttransmission input and output shaft speeds.· Applied to detect wheel speed, playing a major role inElectronic braking system, Traction control and stability systems.· Potentiometer constitute a key element in "Brake-by-wire"technology, "Drive-by-wire technology", Active suspension, Automatic headlightlevelling, as well as in wiper, mirror and seat positioning.POSSIBLE INACCURACIES:Total resistance on the resistive track because the temperaturefluctuations only have effect on the resistance.SECTIOND: CODING FOR SERVO-SENSOR SETUP WITH POTENTIOMETER.#include