The document describes designing a circuit to control the brightness of LEDs using a rotary encoder and Arduino. It involves connecting a rotary encoder and 4 LEDs to an Arduino board. An Arduino program is written to read the rotary encoder position and adjust the PWM output to the LEDs, varying their brightness as the encoder is turned. The circuit allows increasing or decreasing the brightness of multiple LEDs simultaneously using a single rotary encoder.
Arduino coupled with low cost sensors is an incredible opportunity to mix electronic with Physics and to implement field data collection, IBSE and Home Labs (the other face of fliped classrooms)
School workshop done by Abarajithan G. and students of Electronics Department, University of Moratuwa.
This covers:
* Arduino Boards, Pin types
* Arduino software installation
* If, else, for, while, functions
* LED Blinking
* Library Download & installation
* Serial Communication
* Sonars, QTR Modules, Servos
* Motor Controllers
* PID Algorithm Basics
* Tips to Buying Hardware in Sri Lanka
Arduino coupled with low cost sensors is an incredible opportunity to mix electronic with Physics and to implement field data collection, IBSE and Home Labs (the other face of fliped classrooms)
School workshop done by Abarajithan G. and students of Electronics Department, University of Moratuwa.
This covers:
* Arduino Boards, Pin types
* Arduino software installation
* If, else, for, while, functions
* LED Blinking
* Library Download & installation
* Serial Communication
* Sonars, QTR Modules, Servos
* Motor Controllers
* PID Algorithm Basics
* Tips to Buying Hardware in Sri Lanka
Arduino Workshop Day 2 - Advance Arduino & DIYVishnu
Arduino Workshop Day 2 - IR, Ultrasonic & Temperature - Humidity Sensor Interfacing & Do It Yourself - Line Follower, Light Follower & Obstacle Avoider.
Inbuilt Digital Weighing System Inside Travel BagMOHAMMAD TANVEER
This is the ppt that we made to present our idea of "Inbuilt Weighing System Inside Travel Bag" in techFest'21 at Sant Longowal Institute Of Engineering And Technology (Deemed University), Punjab, India.
Arduino Workshop Day 2 - Advance Arduino & DIYVishnu
Arduino Workshop Day 2 - IR, Ultrasonic & Temperature - Humidity Sensor Interfacing & Do It Yourself - Line Follower, Light Follower & Obstacle Avoider.
Inbuilt Digital Weighing System Inside Travel BagMOHAMMAD TANVEER
This is the ppt that we made to present our idea of "Inbuilt Weighing System Inside Travel Bag" in techFest'21 at Sant Longowal Institute Of Engineering And Technology (Deemed University), Punjab, India.
A Digital RPM Meter is a measuring instrument which can measure the rotational speed of a rotary machine digitally. In industries we can use this type of digital tachometers which will reduce human effect. The industrial name of this instrument is “Tachometerâ€. It is an important measuring device in the field of electrical engineering and widely used in industries and laboratorial work. Here we are going to design an Aurdino based digital tachometer using IR sensor module to detect object for count rotation of any rotating body and the programming is given by the FTDI programmer. As IR transmits IR rays which reflect back to IR receiver and then IR Module generates an output or pulse which is detected by the aurdino controller when we press start button. It counts continuously for 5 seconds. After 5 seconds aurdino calculate RPM for a minute using given formula. Here we demonstrate this project using ceiling fan. A. Sriharsha Kumar | Ch. Venkatesh | K. V. Durga Prasad | S. Balaji ""Digital Tachometer using Aurdino"" Published in International Journal of Trend in Scientific Research and Development (ijtsrd), ISSN: 2456-6470, Volume-3 | Issue-3 , April 2019, URL: https://www.ijtsrd.com/papers/ijtsrd23223.pdf
Paper URL: https://www.ijtsrd.com/engineering/electrical-engineering/23223/digital-tachometer-using-aurdino/a-sriharsha-kumar
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
Fleet management these days is next to impossible without connected vehicle solutions. Why? Well, fleet trackers and accompanying connected vehicle management solutions tend to offer quite a few hard-to-ignore benefits to fleet managers and businesses alike. Let’s check them out!
Your VW's camshaft position sensor is crucial for engine performance. Signs of failure include engine misfires, difficulty starting, stalling at low speeds, reduced fuel efficiency, and the check engine light. Prompt inspection and replacement can prevent further damage and keep your VW running smoothly.
Ever been troubled by the blinking sign and didn’t know what to do?
Here’s a handy guide to dashboard symbols so that you’ll never be confused again!
Save them for later and save the trouble!
Why Is Your BMW X3 Hood Not Responding To Release CommandsDart Auto
Experiencing difficulty opening your BMW X3's hood? This guide explores potential issues like mechanical obstruction, hood release mechanism failure, electrical problems, and emergency release malfunctions. Troubleshooting tips include basic checks, clearing obstructions, applying pressure, and using the emergency release.
Things to remember while upgrading the brakes of your carjennifermiller8137
Upgrading the brakes of your car? Keep these things in mind before doing so. Additionally, start using an OBD 2 GPS tracker so that you never miss a vehicle maintenance appointment. On top of this, a car GPS tracker will also let you master good driving habits that will let you increase the operational life of your car’s brakes.
𝘼𝙣𝙩𝙞𝙦𝙪𝙚 𝙋𝙡𝙖𝙨𝙩𝙞𝙘 𝙏𝙧𝙖𝙙𝙚𝙧𝙨 𝙞𝙨 𝙫𝙚𝙧𝙮 𝙛𝙖𝙢𝙤𝙪𝙨 𝙛𝙤𝙧 𝙢𝙖𝙣𝙪𝙛𝙖𝙘𝙩𝙪𝙧𝙞𝙣𝙜 𝙩𝙝𝙚𝙞𝙧 𝙥𝙧𝙤𝙙𝙪𝙘𝙩𝙨. 𝙒𝙚 𝙝𝙖𝙫𝙚 𝙖𝙡𝙡 𝙩𝙝𝙚 𝙥𝙡𝙖𝙨𝙩𝙞𝙘 𝙜𝙧𝙖𝙣𝙪𝙡𝙚𝙨 𝙪𝙨𝙚𝙙 𝙞𝙣 𝙖𝙪𝙩𝙤𝙢𝙤𝙩𝙞𝙫𝙚 𝙖𝙣𝙙 𝙖𝙪𝙩𝙤 𝙥𝙖𝙧𝙩𝙨 𝙖𝙣𝙙 𝙖𝙡𝙡 𝙩𝙝𝙚 𝙛𝙖𝙢𝙤𝙪𝙨 𝙘𝙤𝙢𝙥𝙖𝙣𝙞𝙚𝙨 𝙗𝙪𝙮 𝙩𝙝𝙚 𝙜𝙧𝙖𝙣𝙪𝙡𝙚𝙨 𝙛𝙧𝙤𝙢 𝙪𝙨.
Over the 10 years, we have gained a strong foothold in the market due to our range's high quality, competitive prices, and time-lined delivery schedules.
Learn why monitoring your Mercedes' Exhaust Back Pressure (EBP) sensor is crucial. Understand its role in engine performance and emission reduction. Discover five warning signs of EBP sensor failure, from loss of power to increased emissions. Take action promptly to avoid costly repairs and maintain your Mercedes' reliability and efficiency.
5 Warning Signs Your BMW's Intelligent Battery Sensor Needs AttentionBertini's German Motors
IBS monitors and manages your BMW’s battery performance. If it malfunctions, you will have to deal with an array of electrical issues in your vehicle. Recognize warning signs like dimming headlights, frequent battery replacements, and electrical malfunctions to address potential IBS issues promptly.
What Does the PARKTRONIC Inoperative, See Owner's Manual Message Mean for You...Autohaus Service and Sales
Learn what "PARKTRONIC Inoperative, See Owner's Manual" means for your Mercedes-Benz. This message indicates a malfunction in the parking assistance system, potentially due to sensor issues or electrical faults. Prompt attention is crucial to ensure safety and functionality. Follow steps outlined for diagnosis and repair in the owner's manual.
Comprehensive program for Agricultural Finance, the Automotive Sector, and Empowerment . We will define the full scope and provide a detailed two-week plan for identifying strategic partners in each area within Limpopo, including target areas.:
1. Agricultural : Supporting Primary and Secondary Agriculture
• Scope: Provide support solutions to enhance agricultural productivity and sustainability.
• Target Areas: Polokwane, Tzaneen, Thohoyandou, Makhado, and Giyani.
2. Automotive Sector: Partnerships with Mechanics and Panel Beater Shops
• Scope: Develop collaborations with automotive service providers to improve service quality and business operations.
• Target Areas: Polokwane, Lephalale, Mokopane, Phalaborwa, and Bela-Bela.
3. Empowerment : Focusing on Women Empowerment
• Scope: Provide business support support and training to women-owned businesses, promoting economic inclusion.
• Target Areas: Polokwane, Thohoyandou, Musina, Burgersfort, and Louis Trichardt.
We will also prioritize Industrial Economic Zone areas and their priorities.
Sign up on https://profilesmes.online/welcome/
To be eligible:
1. You must have a registered business and operate in Limpopo
2. Generate revenue
3. Sectors : Agriculture ( primary and secondary) and Automative
Women and Youth are encouraged to apply even if you don't fall in those sectors.
In this presentation, we have discussed a very important feature of BMW X5 cars… the Comfort Access. Things that can significantly limit its functionality. And things that you can try to restore the functionality of such a convenient feature of your vehicle.
The Octavia range embodies the design trend of the Škoda brand: a fusion of
aesthetics, safety and practicality. Whether you see the car as a whole or step
closer and explore its unique features, the Octavia range radiates with the
harmony of functionality and emotion
Symptoms like intermittent starting and key recognition errors signal potential problems with your Mercedes’ EIS. Use diagnostic steps like error code checks and spare key tests. Professional diagnosis and solutions like EIS replacement ensure safe driving. Consult a qualified technician for accurate diagnosis and repair.
What Are The Immediate Steps To Take When The VW Temperature Light Starts Fla...Import Motorworks
Learn how to respond when the red temperature light flashes in your VW with this presentation. From checking coolant levels to seeking professional help, follow these steps promptly to prevent engine damage and ensure safety on the road.
What Are The Immediate Steps To Take When The VW Temperature Light Starts Fla...
4. exp.2 rotary encoder
1. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 1
Exp. No.: 2 Date:
Aim:
Design a series of 4 LED brightness controllers using Rotary Encoder.
Objective:
Designing a circuit for controlling the brightness of LED’s by using Rotary encoder.
Hardware Requirements:
S.No. Title of Component Component Image Quantity
1. Arduino Uno 01
2. Rotary encoder KY-040 01
3. 10KΩ resistor/ POT 02
4. 220Ω Resistor 04
5.
Connecting Wires & USB
Cable
As per
Requirement
2. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 2
Pre Lab Session:
1. Study of Rotary encoder module and Its Description.
2. Study of various Rotary encoder modules.
3. Perform the experiment to light the LED.
4. Study how to vary the brightness of LED
3. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 3
Description:
The objective of this experiment is to construct a module that varies the brightness of
LED by using Rotary encoder and an Arduino.
Rotary encoder:
With a rotary encoder we have two square wave outputs (A and B) which are 90 degrees
out of phase with each other. The number of pulses or steps generated per complete turn varies.
The Sparkfun Rotary Encoder has 12 steps but others may have more or less. The diagram below
shows how the phases A and B relate to each other when the encoder is turned clockwise or
counter clockwise.
Every time the A signal pulse goes from positive to zero, we read the value of the B pulse. We
see that when the encoder is turned clockwise the B pulse is always positive. When the encoder
is turned counter-clockwise the B pulse is negative. By testing both outputs with a
microcontroller we can determine the direction of turn and by counting the number of A pulses
how far it has turned. Indeed, we could go one stage further and count the frequency of the
pulses to determine how fast it is being turned. We can see that the rotary encoder has a lot of
advantages over a potentiometer.
We will now use the rotary encoder in the simplest of applications, we will use it to control the
brightness of an led by altering a pwm signal. We will use the easiest method to read the
encoder, that is the use of a timer interrupt to check on the values.
We will use the sparkfun encoder as discussed above. The first thing is to determine how fast we
need our timer to operate. If you imagine that at best we could turn the encoder through 180
degrees in 1/10th of a second, that would give us 6 pulses in 1/10th second or 60 pulse per
second. In reality its never likely to be this fast. As we need to detect both high and low values
this gives us a minimum frequency of 120Hz. Lets go for 200Hz just to be sure. (Note: as these
units are mechanical switches, there is the possibility of switch bounce. Using a fairly low
frequency allows us to effectively filter out any switch bounce)
Each time our timer code triggers, we compare the value of our A pulse with its previous value.
If it has gone from positive to zero, we then check the value of the B pulse to see if it is positive
4. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 4
or zero. Depending on the outcome we can increment of decrement a counter. We then use this
to control the PWM value to increase or decrease the brightness of the LED
Fig:1.1 Rotary encoder
Circuit
Pin SW on the Rotary Encoder to pin 0 of Arduino.
Pin clk on the Rotary Encoder to pin 12 of Arduino.
Pin DT on the Rotary Encoder to pin 11 of Arduino.
Pin GND on the Rotary Encoder to pin GND of Arduino.
Connect pin 12 of Rotary encoder to pin GND of Arduino via 10kΩ resistor/pot.
Connect pin 11 of Rotary encoder to pin GND of Arduino via 10kΩ resistor/pot Connect.
Connect Pin 3 of Arduino to positive terminal of LED & connect negative terminal of
LED to ground pin of Arduino through 220Ω resistor .
Connect Pin 5 of Arduino to positive terminal of LED & connect negative terminal of
LED to ground pin of Arduino through 220Ω resistor .
Connect Pin 6 of Arduino to positive terminal of LED & connect negative terminal of
LED to ground pin of Arduino through 220Ω resistor
Connect Pin 9 of Arduino to positive terminal of LED & connect negative terminal of
LED to ground pin of Arduino through 220Ω resistor
5. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 5
Fig 1.2 Circuit setup for interfacing single LED with Arduino UNO and rotary encoder
Procedure:
Step 1: Connect the circuit as shown in Fig 1.4.
Step 2: Complete the programme verification in Arduino Sketch and save the sketch.
Step 3: Connect the Arduino board to PC and upload the verified sketch.
Step 4: Check whether the connected LED’s are glowing or not.
Step 5: If glowing vary the brightness of the LED by rotating the knob of rotary encoder.
Programming Code:
int brightness = 120; // how bright the LED is, start at half brightness
int fadeAmount = 10; // how many points to fade the LED by
unsigned long currentTime;
unsigned long loopTime;
const int pin_A = 12; // pin 12
const int pin_B = 11; // pin 11
unsigned char encoder_A;
unsigned char encoder_B;
unsigned char encoder_A_prev=0 ;
void setup() {
// declare pin 3 to be an output:
// declare pin 5 to be an output:
// declare pin 6 to be an output:
// declare pin 9 to be an output:
pinMode(9, OUTPUT);
6. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 6
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(pin_A, INPUT);
pinMode(pin_B, INPUT);
currentTime = millis();
loopTime = currentTime;
}
void loop() {
// get the current elapsed time
currentTime = millis();
if(currentTime >= (loopTime + 5)){
// 5ms since last check of encoder = 200Hz
encoder_A = digitalRead(pin_A); // Read encoder pins
encoder_B = digitalRead(pin_B);
if((!encoder_A) && (encoder_A_prev)){
// A has gone from high to low
if(encoder_B) {
// B is high so clockwise
// increase the brightness, dont go over 255
if(brightness + fadeAmount <= 255) brightness += fadeAmount;
}
else {
// B is low so counter-clockwise
// decrease the brightness, dont go below 0
if(brightness - fadeAmount >= 0) brightness -= fadeAmount;
}
}
encoder_A_prev = encoder_A; // Store value of A for next time
// set the brightness of pin 9,3,5,6:
analogWrite(9, brightness);
analogWrite(3, brightness);
analogWrite(5, brightness);
analogWrite(6, brightness);
loopTime = currentTime; // Updates loopTime
}
}
7. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 7
Output:
Fig 1.3 Circuit with glowing LED’s
Interference Analysis:
The Rotary Encoder ships with LEDs so the end user may increase the brightness to a
level appropriate for the application. The current to each of the 4 LEDs is constant and is set per
the datasheet. A surface mount 220kΩ resistor is provided and a parallel thru-hole resistor may
be added to increase the brightness by lowering the resistance With the surface mount 220kΩ
resistor, the output current is set to about 1mA. Adding a 1kΩ resistor thru-hole will increase the
LED brightness to their highest setting.
Applications
With the help of rotary encoder , we can implement several project related not only
brightness adjustments of LED but can also implement stepper motor, counters, shafting angles
etc,.
8. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 8
Post Lab Session:
1. Construct a module to on and off a LED by using Rotary encoder
2. Construct a module to vary the brightness of 8 LED’s by using Rotary encoder.
3. Construct a counter module using Rotary encoder
9. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 9
Viva voice Questions:
Hardware Related Question.
1. What is incremental encoder ?
2. What is absolute encoder ?
3. How do you define the resolution of an encoder ?
4. AC LED - What is it?
5. Light Emitting Diode (LED) - what is it?
6. I have a "5 Volt LED" - what does it mean?
7. LED array - what is it?
8. What is PWM?
9. what is difference between 10k resistor and 10k pot?
10. why 220 resistor is connected along the LED?
10. Embedded Systems and Applications Laboratory Manual 2019
Koneru Lakshmaiah Education Foundation (Deemed to be University), NAAC - “A++”, Guntur, AP | ECE 10
Programming Related Questions
1. Does the pin SW in rotary encoder is input/output ?
2. Does the pin CLK in rotary encoder is input/output ?
3. What is the command for declaring a pin as input ?
4. What is the command for declaring a pin as output ?
5. Explain the command analogRead().
6. Explain the command digitalRead().
7. Differentiate analogRead() and digitalRead().
8. Explain the command analogWrite().
9. Differentiate analogWrite() and digitalWrite().
10. How do you modify the brightness of LED ?
Results
The design of a module that varies the brightness of LED by using Rotary encoder and an
Arduino is done. The Rotary encoder is used to vary the brightness of the LED dynamically. This
experiment can be extended to perform various projects.