SlideShare a Scribd company logo
1 of 13
ArduinoReal
projects
With Tinker CAD
03
Pulse-Width Modulation withanalogWrite()
So, you have mastered digital control of your pins. This is great for blinking LEDs,
controlling relays, and spinning motors at a constant speed.
But what if you want to output a voltage other than 0V or 5V?
● Well, you can’t—unless you are using the digital-to-analog converter (DAC) pins
on the Due or are using an external DAC chip.
● However, you can get pretty close to generating analog output values by using
a trick called pulse-width modulation (PWM).
● you can decrease the voltage being dropped across the resistor, the LED should
glow more dimly because less current will flow.
● These pins are marked with a ~ on the board.
● The PWM output is an 8-bit value. In other words, you can write values
from 0 to 255. Try using a similar for loop structure to the one you used previously
to cycle through varying brightness values.
pullupor pulldown resistor
all digital inputs use a pullup or pulldown resistor to set the “default state” of the
input pin. Imagine the circuit without the 10kΩ resistor. In this scenario, the pin
would obviously read a high value when the button is pressed. But, what happens
when the button is not being pressed? In that scenario, the input pin you would be
reading is essentially connected to nothing—the input pin is said to be “floating.”
And because the pin is not physically connected to 0V or 5V, reading it could cause
unexpected results as electrical noise on nearby pins causes its value to fluctuate
between high and low.
Understanding AnalogandDigitalSignals
● If you want your devices to interface with the world, they will inevitably be
interfacing with analog data.
● Consider the projects you completed in the preceding video. You used a switch
to control an LED. A switch is a digital input—it has only two possible states: on
or off, high or low, 1 or 0.
● The world around you, however, rarely expresses information in only two ways, a
Sunlight is not on or off; its brightness varies over the course of a day.
Similarly, wind does not just have two states; it gusts at different speeds all the
time.
3.Arduino projects.pptx
3.Arduino projects.pptx
3.Arduino projects.pptx
3.Arduino projects.pptx
3.Arduino projects.pptx
3.Arduino projects.pptx

More Related Content

What's hot

What's hot (20)

Clap Switch
Clap SwitchClap Switch
Clap Switch
 
Clap switch
Clap switchClap switch
Clap switch
 
Clap On Clap Off Switch
Clap On Clap Off SwitchClap On Clap Off Switch
Clap On Clap Off Switch
 
Liteline & The Magic of Dimming LEDs
Liteline & The Magic of Dimming LEDsLiteline & The Magic of Dimming LEDs
Liteline & The Magic of Dimming LEDs
 
Clap switch mini project using 555 timer IC
Clap switch mini project using 555 timer ICClap switch mini project using 555 timer IC
Clap switch mini project using 555 timer IC
 
clap switch project
clap switch projectclap switch project
clap switch project
 
CLAP SWITCH
CLAP SWITCHCLAP SWITCH
CLAP SWITCH
 
Clap switch
Clap switchClap switch
Clap switch
 
Clap switch
Clap switchClap switch
Clap switch
 
A Measurements Project on Light Detection sensor
A Measurements Project on Light Detection sensorA Measurements Project on Light Detection sensor
A Measurements Project on Light Detection sensor
 
LittleBitsChallange
LittleBitsChallangeLittleBitsChallange
LittleBitsChallange
 
Clap switch
Clap switchClap switch
Clap switch
 
Clap
ClapClap
Clap
 
Clap switch
Clap switchClap switch
Clap switch
 
Indus university
Indus universityIndus university
Indus university
 
Digitalvoltmeterppt 120914
Digitalvoltmeterppt 120914Digitalvoltmeterppt 120914
Digitalvoltmeterppt 120914
 
Automatic night lamp
Automatic night lampAutomatic night lamp
Automatic night lamp
 
Clap switch
Clap switchClap switch
Clap switch
 
How Does Spooky Remote Light
How Does Spooky Remote LightHow Does Spooky Remote Light
How Does Spooky Remote Light
 
Clap switch
Clap switchClap switch
Clap switch
 

Similar to 3.Arduino projects.pptx

Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
 
Electronics_Tutorial_2022_Slide543404210s.pdf
Electronics_Tutorial_2022_Slide543404210s.pdfElectronics_Tutorial_2022_Slide543404210s.pdf
Electronics_Tutorial_2022_Slide543404210s.pdf
vikknaguem
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
Afzal Ahmad
 

Similar to 3.Arduino projects.pptx (20)

Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Electronics_Tutorial_2022_Slide543404210s.pdf
Electronics_Tutorial_2022_Slide543404210s.pdfElectronics_Tutorial_2022_Slide543404210s.pdf
Electronics_Tutorial_2022_Slide543404210s.pdf
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch example
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptx
 
Electronz_Chapter_4.pptx
Electronz_Chapter_4.pptxElectronz_Chapter_4.pptx
Electronz_Chapter_4.pptx
 
Arduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of MoratuwaArduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of Moratuwa
 
Arduino Thermometer
Arduino ThermometerArduino Thermometer
Arduino Thermometer
 
Notes arduino workshop_15
Notes arduino workshop_15Notes arduino workshop_15
Notes arduino workshop_15
 
Fading leds via pwm
Fading leds via pwmFading leds via pwm
Fading leds via pwm
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
13e912a4.pptx
13e912a4.pptx13e912a4.pptx
13e912a4.pptx
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Lec 8,9,10 (interfacing)
Lec 8,9,10 (interfacing)Lec 8,9,10 (interfacing)
Lec 8,9,10 (interfacing)
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Embedded systems presentation
Embedded systems presentationEmbedded systems presentation
Embedded systems presentation
 
Lec 3
Lec 3Lec 3
Lec 3
 

More from Mohamed Essam

2.Data_Strucures_and_modules.pptx
2.Data_Strucures_and_modules.pptx2.Data_Strucures_and_modules.pptx
2.Data_Strucures_and_modules.pptx
Mohamed Essam
 

More from Mohamed Essam (20)

Data Science Crash course
Data Science Crash courseData Science Crash course
Data Science Crash course
 
2.Feature Extraction
2.Feature Extraction2.Feature Extraction
2.Feature Extraction
 
Data Science
Data ScienceData Science
Data Science
 
Introduction to Robotics.pptx
Introduction to Robotics.pptxIntroduction to Robotics.pptx
Introduction to Robotics.pptx
 
Introduction_to_Gui_with_tkinter.pptx
Introduction_to_Gui_with_tkinter.pptxIntroduction_to_Gui_with_tkinter.pptx
Introduction_to_Gui_with_tkinter.pptx
 
Getting_Started_with_DL_in_Keras.pptx
Getting_Started_with_DL_in_Keras.pptxGetting_Started_with_DL_in_Keras.pptx
Getting_Started_with_DL_in_Keras.pptx
 
Linear_algebra.pptx
Linear_algebra.pptxLinear_algebra.pptx
Linear_algebra.pptx
 
Let_s_Dive_to_Deep_Learning.pptx
Let_s_Dive_to_Deep_Learning.pptxLet_s_Dive_to_Deep_Learning.pptx
Let_s_Dive_to_Deep_Learning.pptx
 
OOP-Advanced_Programming.pptx
OOP-Advanced_Programming.pptxOOP-Advanced_Programming.pptx
OOP-Advanced_Programming.pptx
 
1.Basic_Syntax
1.Basic_Syntax1.Basic_Syntax
1.Basic_Syntax
 
KNN.pptx
KNN.pptxKNN.pptx
KNN.pptx
 
Regularization_BY_MOHAMED_ESSAM.pptx
Regularization_BY_MOHAMED_ESSAM.pptxRegularization_BY_MOHAMED_ESSAM.pptx
Regularization_BY_MOHAMED_ESSAM.pptx
 
1.What_if_Adham_Nour_tried_to_make_a_Machine_Learning_Model_at_Home.pptx
1.What_if_Adham_Nour_tried_to_make_a_Machine_Learning_Model_at_Home.pptx1.What_if_Adham_Nour_tried_to_make_a_Machine_Learning_Model_at_Home.pptx
1.What_if_Adham_Nour_tried_to_make_a_Machine_Learning_Model_at_Home.pptx
 
Clean_Code
Clean_CodeClean_Code
Clean_Code
 
Linear_Regression
Linear_RegressionLinear_Regression
Linear_Regression
 
2.Data_Strucures_and_modules.pptx
2.Data_Strucures_and_modules.pptx2.Data_Strucures_and_modules.pptx
2.Data_Strucures_and_modules.pptx
 
Naieve_Bayee.pptx
Naieve_Bayee.pptxNaieve_Bayee.pptx
Naieve_Bayee.pptx
 
Activation_function.pptx
Activation_function.pptxActivation_function.pptx
Activation_function.pptx
 
Deep_Learning_Frameworks
Deep_Learning_FrameworksDeep_Learning_Frameworks
Deep_Learning_Frameworks
 
Neural_Network
Neural_NetworkNeural_Network
Neural_Network
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

3.Arduino projects.pptx

  • 2.
  • 3. Pulse-Width Modulation withanalogWrite() So, you have mastered digital control of your pins. This is great for blinking LEDs, controlling relays, and spinning motors at a constant speed. But what if you want to output a voltage other than 0V or 5V? ● Well, you can’t—unless you are using the digital-to-analog converter (DAC) pins on the Due or are using an external DAC chip. ● However, you can get pretty close to generating analog output values by using a trick called pulse-width modulation (PWM). ● you can decrease the voltage being dropped across the resistor, the LED should glow more dimly because less current will flow. ● These pins are marked with a ~ on the board. ● The PWM output is an 8-bit value. In other words, you can write values from 0 to 255. Try using a similar for loop structure to the one you used previously to cycle through varying brightness values.
  • 4.
  • 5.
  • 6. pullupor pulldown resistor all digital inputs use a pullup or pulldown resistor to set the “default state” of the input pin. Imagine the circuit without the 10kΩ resistor. In this scenario, the pin would obviously read a high value when the button is pressed. But, what happens when the button is not being pressed? In that scenario, the input pin you would be reading is essentially connected to nothing—the input pin is said to be “floating.” And because the pin is not physically connected to 0V or 5V, reading it could cause unexpected results as electrical noise on nearby pins causes its value to fluctuate between high and low.
  • 7. Understanding AnalogandDigitalSignals ● If you want your devices to interface with the world, they will inevitably be interfacing with analog data. ● Consider the projects you completed in the preceding video. You used a switch to control an LED. A switch is a digital input—it has only two possible states: on or off, high or low, 1 or 0. ● The world around you, however, rarely expresses information in only two ways, a Sunlight is not on or off; its brightness varies over the course of a day. Similarly, wind does not just have two states; it gusts at different speeds all the time.

Editor's Notes

  1. Start camstisia from here
  2. Start camstisia from here