SlideShare a Scribd company logo

Intro to Electronics in Python

Some into slides for PyconAU 2014 workshop

1 of 25
Download to read offline
Intro to Electronics in Python
Anna Gerber
Intro to Electronics in Python
Electricity
•  Electricity is a form of energy
•  We can connect components that convert
electrical energy into other forms of energy:
light, sound, movement, heat etc, into a circuit
•  In a Direct Current (DC) circuit,

electrical energy flows from 

the positive side of a 

power source to the

negative side, i.e. from 

+ (power) to – (ground) 
Anna Gerber
Intro to Electronics in Python
Electrical concepts
•  Current (Amps): measures the flow of electrical
energy through a circuit
•  Voltage (Volts): measures difference in potential
energy between the positive and negative sides
of a circuit
•  Resistance (Ohms): measures a material's
opposition to the flow of energy
•  Power (Watts): the rate at which energy is
converted from one form to another
Anna Gerber
Intro to Electronics in Python
Ohm's Law
Current = Voltage / Resistance
•  Increase the voltage, and the current will
increase (i.e. speed up)
•  Increase the resistance and the current will
decrease
Anna Gerber
Intro to Electronics in Python
Sensors
•  Environmental	
  condi/ons	
  	
  	
  
(e.g.	
  temperature,	
  humidity,	
  smoke)	
  
•  Magne/c	
  (e.g.	
  hall	
  effect	
  sensor)	
  
•  Light	
  (e.g.	
  photo	
  resistor)	
  
•  Sound	
  (e.g.	
  microphone)	
  
•  Mo/on	
  (e.g.	
  accelerometer,	
  /lt,	
  pressure)	
  
•  User	
  /	
  Physical	
  Input	
  (e.g.	
  buDon)	
  
Anna Gerber
Intro to Electronics in Python
Actuators
•  Light	
  &	
  Displays	
  (e.g.	
  LED,	
  LCD)	
  
•  Sound	
  (e.g.	
  Piezo	
  buzzer)	
  
•  Mo/on	
  (e.g.	
  Servo,	
  DC	
  Motor,	
  Solenoid)	
  
•  Power	
  (e.g.	
  Relay)	
  
Anna Gerber
Intro to Electronics in Python
Ad

Recommended

Arduino Interfacing LED
Arduino Interfacing LEDArduino Interfacing LED
Arduino Interfacing LEDMrunal Deshkar
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modellingVandanaPagar1
 
Vlsi design and fabrication ppt
Vlsi design and fabrication  pptVlsi design and fabrication  ppt
Vlsi design and fabrication pptManjushree Mashal
 
Bluetooth Controlled Robocar Using PIC 16f887
Bluetooth Controlled Robocar Using PIC 16f887Bluetooth Controlled Robocar Using PIC 16f887
Bluetooth Controlled Robocar Using PIC 16f887Ekram Bin Mamun
 
Arduino based Real Time Clock with Ringing of Bell and National Anthem
Arduino based Real Time Clock with Ringing of Bell and National AnthemArduino based Real Time Clock with Ringing of Bell and National Anthem
Arduino based Real Time Clock with Ringing of Bell and National Anthemrahulmonikasharma
 
Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pi동호 손
 

More Related Content

What's hot

Embedded systems in biomedical applications
Embedded systems in biomedical applicationsEmbedded systems in biomedical applications
Embedded systems in biomedical applicationsSeminar Links
 
Mp3 player working by digital signal processing
Mp3 player working by digital signal processingMp3 player working by digital signal processing
Mp3 player working by digital signal processingDipanjon Halder
 
Generation of AM-DSB-SC using Balanced FET Modulator.pptx
Generation of AM-DSB-SC using Balanced FET Modulator.pptxGeneration of AM-DSB-SC using Balanced FET Modulator.pptx
Generation of AM-DSB-SC using Balanced FET Modulator.pptxArunChokkalingam
 
A report on ultrasonic distance measurement
A report on ultrasonic distance measurementA report on ultrasonic distance measurement
A report on ultrasonic distance measurementitfakash
 
Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Aref35
 
Layout design on MICROWIND
Layout design on MICROWINDLayout design on MICROWIND
Layout design on MICROWINDvaibhav jindal
 
Simple Presentation On Raspberry pi
Simple Presentation On Raspberry piSimple Presentation On Raspberry pi
Simple Presentation On Raspberry piSakkar Chowdhury
 
Demodulation of AM wave
Demodulation of AM waveDemodulation of AM wave
Demodulation of AM waveLokesh Parihar
 
Information Theory Coding 1
Information Theory Coding 1Information Theory Coding 1
Information Theory Coding 1Mahafuz Aveek
 
Watch-dog Timer in LPC1768
Watch-dog Timer in LPC1768Watch-dog Timer in LPC1768
Watch-dog Timer in LPC1768Srishti Kakade
 
Digital communication systems
Digital communication systemsDigital communication systems
Digital communication systemsNisreen Bashar
 
Signals and systems-1
Signals and systems-1Signals and systems-1
Signals and systems-1sarun soman
 
Introdução a Sistemas Embarcados com Arduino - mini-curso
Introdução a Sistemas Embarcados com Arduino - mini-cursoIntrodução a Sistemas Embarcados com Arduino - mini-curso
Introdução a Sistemas Embarcados com Arduino - mini-cursoFelipe Martins
 

What's hot (20)

Lecture13
Lecture13Lecture13
Lecture13
 
Pn sequence
Pn sequencePn sequence
Pn sequence
 
Embedded systems in biomedical applications
Embedded systems in biomedical applicationsEmbedded systems in biomedical applications
Embedded systems in biomedical applications
 
Mp3 player working by digital signal processing
Mp3 player working by digital signal processingMp3 player working by digital signal processing
Mp3 player working by digital signal processing
 
Analog vs digital
Analog vs digitalAnalog vs digital
Analog vs digital
 
Generation of AM-DSB-SC using Balanced FET Modulator.pptx
Generation of AM-DSB-SC using Balanced FET Modulator.pptxGeneration of AM-DSB-SC using Balanced FET Modulator.pptx
Generation of AM-DSB-SC using Balanced FET Modulator.pptx
 
A report on ultrasonic distance measurement
A report on ultrasonic distance measurementA report on ultrasonic distance measurement
A report on ultrasonic distance measurement
 
Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2
 
Layout design on MICROWIND
Layout design on MICROWINDLayout design on MICROWIND
Layout design on MICROWIND
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
 
Simple Presentation On Raspberry pi
Simple Presentation On Raspberry piSimple Presentation On Raspberry pi
Simple Presentation On Raspberry pi
 
Demodulation of AM wave
Demodulation of AM waveDemodulation of AM wave
Demodulation of AM wave
 
Information Theory Coding 1
Information Theory Coding 1Information Theory Coding 1
Information Theory Coding 1
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
Watch-dog Timer in LPC1768
Watch-dog Timer in LPC1768Watch-dog Timer in LPC1768
Watch-dog Timer in LPC1768
 
Digital communication systems
Digital communication systemsDigital communication systems
Digital communication systems
 
Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
 
Signals and systems-1
Signals and systems-1Signals and systems-1
Signals and systems-1
 
Introdução a Sistemas Embarcados com Arduino - mini-curso
Introdução a Sistemas Embarcados com Arduino - mini-cursoIntrodução a Sistemas Embarcados com Arduino - mini-curso
Introdução a Sistemas Embarcados com Arduino - mini-curso
 
Twin well process
Twin well processTwin well process
Twin well process
 

Viewers also liked

MicroPython&electronics prezentācija
MicroPython&electronics prezentācija MicroPython&electronics prezentācija
MicroPython&electronics prezentācija CRImier
 
International NodeBots Day Brisbane roundup (BrisJS)
International NodeBots Day Brisbane roundup (BrisJS)International NodeBots Day Brisbane roundup (BrisJS)
International NodeBots Day Brisbane roundup (BrisJS)Anna Gerber
 
JavaScript Robotics
JavaScript RoboticsJavaScript Robotics
JavaScript RoboticsAnna Gerber
 
Writing Secure Plugins — WordCamp New York 2009
Writing Secure Plugins — WordCamp New York 2009Writing Secure Plugins — WordCamp New York 2009
Writing Secure Plugins — WordCamp New York 2009Mark Jaquith
 
"Serverless" express
"Serverless" express"Serverless" express
"Serverless" expressAnna Gerber
 
Basics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADABasics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADAIndira Kundu
 

Viewers also liked (9)

Python for-microcontrollers
Python for-microcontrollersPython for-microcontrollers
Python for-microcontrollers
 
MicroPython&electronics prezentācija
MicroPython&electronics prezentācija MicroPython&electronics prezentācija
MicroPython&electronics prezentācija
 
Python Flavors
Python FlavorsPython Flavors
Python Flavors
 
International NodeBots Day Brisbane roundup (BrisJS)
International NodeBots Day Brisbane roundup (BrisJS)International NodeBots Day Brisbane roundup (BrisJS)
International NodeBots Day Brisbane roundup (BrisJS)
 
JavaScript Robotics
JavaScript RoboticsJavaScript Robotics
JavaScript Robotics
 
Writing Secure Plugins — WordCamp New York 2009
Writing Secure Plugins — WordCamp New York 2009Writing Secure Plugins — WordCamp New York 2009
Writing Secure Plugins — WordCamp New York 2009
 
Iot 101
Iot 101Iot 101
Iot 101
 
"Serverless" express
"Serverless" express"Serverless" express
"Serverless" express
 
Basics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADABasics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADA
 

Similar to Intro to Electronics in Python

Similar to Intro to Electronics in Python (20)

ArduinoSectionI-slides.ppt
ArduinoSectionI-slides.pptArduinoSectionI-slides.ppt
ArduinoSectionI-slides.ppt
 
Intro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptxIntro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptx
 
Instructor background
Instructor backgroundInstructor background
Instructor background
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Presentation S4A
Presentation S4A Presentation S4A
Presentation S4A
 
Presentation
PresentationPresentation
Presentation
 
SCSA1407.pdf
SCSA1407.pdfSCSA1407.pdf
SCSA1407.pdf
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
c ppt.pptx
c ppt.pptxc ppt.pptx
c ppt.pptx
 
Sensor and Actuators using Rasberry Pi controller
Sensor and Actuators using Rasberry Pi controllerSensor and Actuators using Rasberry Pi controller
Sensor and Actuators using Rasberry Pi controller
 
Arduino
ArduinoArduino
Arduino
 
Making things sense - Day 1 (May 2011)
Making things sense - Day 1 (May 2011)Making things sense - Day 1 (May 2011)
Making things sense - Day 1 (May 2011)
 
10 11_gen_revision_notes_term_3
10  11_gen_revision_notes_term_310  11_gen_revision_notes_term_3
10 11_gen_revision_notes_term_3
 
ECT 363 Project 1 Dr. Alaa Al GhazoSamuel I. Ward Dep.docx
ECT 363 Project 1  Dr. Alaa Al GhazoSamuel I. Ward Dep.docxECT 363 Project 1  Dr. Alaa Al GhazoSamuel I. Ward Dep.docx
ECT 363 Project 1 Dr. Alaa Al GhazoSamuel I. Ward Dep.docx
 
Sensor Lecture Interfacing
 Sensor Lecture Interfacing Sensor Lecture Interfacing
Sensor Lecture Interfacing
 
Computer hardware
Computer hardware Computer hardware
Computer hardware
 
480 sensors
480 sensors480 sensors
480 sensors
 
Arduino
Arduino Arduino
Arduino
 
Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011
 
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004
 

More from Anna Gerber

Internet of Things (IoT) Intro
Internet of Things (IoT) IntroInternet of Things (IoT) Intro
Internet of Things (IoT) IntroAnna Gerber
 
How the Web works
How the Web worksHow the Web works
How the Web worksAnna Gerber
 
Do you want to build a robot
Do you want to build a robotDo you want to build a robot
Do you want to build a robotAnna Gerber
 
Adding Electronics to 3D Printed Action Heroes
Adding Electronics to 3D Printed Action HeroesAdding Electronics to 3D Printed Action Heroes
Adding Electronics to 3D Printed Action HeroesAnna Gerber
 
3D Printing Action Heroes
3D Printing Action Heroes3D Printing Action Heroes
3D Printing Action HeroesAnna Gerber
 
3D Sculpting Action Heroes
3D Sculpting Action Heroes3D Sculpting Action Heroes
3D Sculpting Action HeroesAnna Gerber
 
Data Visualisation Workshop (GovHack Brisbane 2014)
Data Visualisation Workshop (GovHack Brisbane 2014)Data Visualisation Workshop (GovHack Brisbane 2014)
Data Visualisation Workshop (GovHack Brisbane 2014)Anna Gerber
 
Supporting Open Scholarly Annotation
Supporting Open Scholarly AnnotationSupporting Open Scholarly Annotation
Supporting Open Scholarly AnnotationAnna Gerber
 
Supporting Web-based Scholarly Annotation
Supporting Web-based Scholarly AnnotationSupporting Web-based Scholarly Annotation
Supporting Web-based Scholarly AnnotationAnna Gerber
 
Annotations Supporting Scholarly Editing (OA European Roll Out)
Annotations Supporting Scholarly Editing (OA European Roll Out)Annotations Supporting Scholarly Editing (OA European Roll Out)
Annotations Supporting Scholarly Editing (OA European Roll Out)Anna Gerber
 
Annotation Tools (OA European Roll Out)
Annotation Tools (OA European Roll Out)Annotation Tools (OA European Roll Out)
Annotation Tools (OA European Roll Out)Anna Gerber
 
Intro to data visualisation
Intro to data visualisationIntro to data visualisation
Intro to data visualisationAnna Gerber
 
Annotations Supporting Scholarly Editing
Annotations Supporting Scholarly EditingAnnotations Supporting Scholarly Editing
Annotations Supporting Scholarly EditingAnna Gerber
 
Getting started with the Trove API
Getting started with the Trove APIGetting started with the Trove API
Getting started with the Trove APIAnna Gerber
 
HackFest Brisbane: Discover Brisbane
HackFest Brisbane: Discover BrisbaneHackFest Brisbane: Discover Brisbane
HackFest Brisbane: Discover BrisbaneAnna Gerber
 
Using Yahoo Pipes
Using Yahoo PipesUsing Yahoo Pipes
Using Yahoo PipesAnna Gerber
 

More from Anna Gerber (17)

Internet of Things (IoT) Intro
Internet of Things (IoT) IntroInternet of Things (IoT) Intro
Internet of Things (IoT) Intro
 
How the Web works
How the Web worksHow the Web works
How the Web works
 
Do you want to build a robot
Do you want to build a robotDo you want to build a robot
Do you want to build a robot
 
Adding Electronics to 3D Printed Action Heroes
Adding Electronics to 3D Printed Action HeroesAdding Electronics to 3D Printed Action Heroes
Adding Electronics to 3D Printed Action Heroes
 
3D Printing Action Heroes
3D Printing Action Heroes3D Printing Action Heroes
3D Printing Action Heroes
 
3D Sculpting Action Heroes
3D Sculpting Action Heroes3D Sculpting Action Heroes
3D Sculpting Action Heroes
 
Data Visualisation Workshop (GovHack Brisbane 2014)
Data Visualisation Workshop (GovHack Brisbane 2014)Data Visualisation Workshop (GovHack Brisbane 2014)
Data Visualisation Workshop (GovHack Brisbane 2014)
 
Supporting Open Scholarly Annotation
Supporting Open Scholarly AnnotationSupporting Open Scholarly Annotation
Supporting Open Scholarly Annotation
 
Supporting Web-based Scholarly Annotation
Supporting Web-based Scholarly AnnotationSupporting Web-based Scholarly Annotation
Supporting Web-based Scholarly Annotation
 
Annotations Supporting Scholarly Editing (OA European Roll Out)
Annotations Supporting Scholarly Editing (OA European Roll Out)Annotations Supporting Scholarly Editing (OA European Roll Out)
Annotations Supporting Scholarly Editing (OA European Roll Out)
 
Annotation Tools (OA European Roll Out)
Annotation Tools (OA European Roll Out)Annotation Tools (OA European Roll Out)
Annotation Tools (OA European Roll Out)
 
Intro to data visualisation
Intro to data visualisationIntro to data visualisation
Intro to data visualisation
 
Annotations Supporting Scholarly Editing
Annotations Supporting Scholarly EditingAnnotations Supporting Scholarly Editing
Annotations Supporting Scholarly Editing
 
Getting started with the Trove API
Getting started with the Trove APIGetting started with the Trove API
Getting started with the Trove API
 
Intro to Java
Intro to JavaIntro to Java
Intro to Java
 
HackFest Brisbane: Discover Brisbane
HackFest Brisbane: Discover BrisbaneHackFest Brisbane: Discover Brisbane
HackFest Brisbane: Discover Brisbane
 
Using Yahoo Pipes
Using Yahoo PipesUsing Yahoo Pipes
Using Yahoo Pipes
 

Recently uploaded

"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions..."How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...Fwdays
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Product School
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17Ana-Maria Mihalceanu
 
"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor Fesenko"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor FesenkoFwdays
 
Campotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company ProfileCampotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company ProfileCampotelPhilippines
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr TsapFwdays
 
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...Adrian Sanabria
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Product School
 
"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro Kozhevin
"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro Kozhevin"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro Kozhevin
"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro KozhevinFwdays
 
Introduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVAIntroduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVARobert McDermott
 
LF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIELF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIEDanBrown980551
 
How we think about an advisor tech stack
How we think about an advisor tech stackHow we think about an advisor tech stack
How we think about an advisor tech stackSummit
 
Confoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceConfoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceSusan Ibach
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Product School
 
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERNRonnelBaroc
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfkatalinjordans1
 
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docxLeveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docxVotarikari Shravan
 
10 things that helped me advance my career - PHP UK Conference 2024
10 things that helped me advance my career - PHP UK Conference 202410 things that helped me advance my career - PHP UK Conference 2024
10 things that helped me advance my career - PHP UK Conference 2024Thijs Feryn
 
Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...
Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...
Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...DianaGray10
 

Recently uploaded (20)

"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions..."How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
 
"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor Fesenko"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor Fesenko
 
Campotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company ProfileCampotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company Profile
 
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
 
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
 
"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro Kozhevin
"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro Kozhevin"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro Kozhevin
"DevOps Practisting Platform on EKS with Karpenter autoscaling", Dmytro Kozhevin
 
Introduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVAIntroduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVA
 
LF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIELF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIE
 
How we think about an advisor tech stack
How we think about an advisor tech stackHow we think about an advisor tech stack
How we think about an advisor tech stack
 
Confoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceConfoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data science
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
 
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdf
 
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docxLeveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
 
10 things that helped me advance my career - PHP UK Conference 2024
10 things that helped me advance my career - PHP UK Conference 202410 things that helped me advance my career - PHP UK Conference 2024
10 things that helped me advance my career - PHP UK Conference 2024
 
Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...
Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...
Automation Ops Series: Session 1 - Introduction and setup DevOps for UiPath p...
 

Intro to Electronics in Python

  • 1. Intro to Electronics in Python Anna Gerber Intro to Electronics in Python
  • 2. Electricity •  Electricity is a form of energy •  We can connect components that convert electrical energy into other forms of energy: light, sound, movement, heat etc, into a circuit •  In a Direct Current (DC) circuit,
 electrical energy flows from 
 the positive side of a 
 power source to the
 negative side, i.e. from 
 + (power) to – (ground) Anna Gerber Intro to Electronics in Python
  • 3. Electrical concepts •  Current (Amps): measures the flow of electrical energy through a circuit •  Voltage (Volts): measures difference in potential energy between the positive and negative sides of a circuit •  Resistance (Ohms): measures a material's opposition to the flow of energy •  Power (Watts): the rate at which energy is converted from one form to another Anna Gerber Intro to Electronics in Python
  • 4. Ohm's Law Current = Voltage / Resistance •  Increase the voltage, and the current will increase (i.e. speed up) •  Increase the resistance and the current will decrease Anna Gerber Intro to Electronics in Python
  • 5. Sensors •  Environmental  condi/ons       (e.g.  temperature,  humidity,  smoke)   •  Magne/c  (e.g.  hall  effect  sensor)   •  Light  (e.g.  photo  resistor)   •  Sound  (e.g.  microphone)   •  Mo/on  (e.g.  accelerometer,  /lt,  pressure)   •  User  /  Physical  Input  (e.g.  buDon)   Anna Gerber Intro to Electronics in Python
  • 6. Actuators •  Light  &  Displays  (e.g.  LED,  LCD)   •  Sound  (e.g.  Piezo  buzzer)   •  Mo/on  (e.g.  Servo,  DC  Motor,  Solenoid)   •  Power  (e.g.  Relay)   Anna Gerber Intro to Electronics in Python
  • 7. Digital vs Analog •  Digital –  discrete values (0 or 1)(LOW or HIGH) –  Examples: tilt sensor, push button, relay, servo •  Analog –  continuous values –  Examples: photo resistor, DC motor •  Some sensors support both digital and analog outputs Anna Gerber Intro to Electronics in Python
  • 8. Using a Breadboard Anna Gerber Intro to Electronics in Python •  Use to prototype circuits without soldering by plugging in components and jumper wires •  Letters and numbers for reference •  Numbered rows are connected •  Some have power bus along the sides
  • 9. Resistors •  Introduces resistance, so restricts the amount of current that can flow through a circuit •  Coloured bands indicate resistance •  Can be connected in either direction Anna Gerber Intro to Electronics in Python
  • 10. LEDs •  Light Emitting Diode •  Polarized: diodes act like one way valves so must be connected in a certain direction •  Emits light when a current passes through Anna Gerber Intro to Electronics in Python Anode  (+)     longer  lead   connects  to  power   Cathode  (-­‐)     connects  to  ground  
  • 11. Control •  Arduino-compatible Microcontroller co- ordinates robot inputs (sensors) and outputs (actuators) •  See http://arduino.cc/ Anna Gerber Intro to Electronics in Python
  • 12. PyFirmata •  https://github.com/tino/pyFirmata •  Communicates with the Arduino using the Firmata protocol Install using pip: pip  install  pyfirmata   Anna Gerber Intro to Electronics in Python
  • 13. Loading Firmata onto the Arduino •  Once-off setup to prepare our Arduino for use with PyFirmata: –  Connect the microcontroller board via USB –  Launch Arduino IDE and open the Firmata sketch via the menu: File  >  Examples  >  Firmata  >   StandardFirmata   –  Select your board type (e.g. Arduino Nano w/ ATmega328) via Tools  >  Board   –  Select the port for your board via Tools  >   Serial  Port  > (the port of your Arduino) 
 e.g. /dev/tty.usbserial-A9GF3L9D –  Upload the program by clicking on Upload   –  Close the IDE Anna Gerber Intro to Electronics in Python
  • 14. BLINKING AN LED Anna Gerber Intro to Electronics in Python
  • 15. Connecting an LED to the Arduino •  Unplug the Arduino! •  Attach long lead of LED to pin 13 of Arduino •  Connect resistor to cathode of resistor and ground rail of breadboard •  Connect GND pin of Arduino to ground rail of breadboard using a jumper wire Anna Gerber Intro to Electronics in Python
  • 16. Creating the program 1.  Create a Python program file (e.g. blink.py) 2.  Edit it using a text editor e.g. SublimeText 3.  At the start of your program import the library import  pyfirmata   Anna Gerber Intro to Electronics in Python
  • 17. Creating the board We create a Board object which corresponds to our Arduino-compatible microcontroller board and store it in a variable. We need to provide the port as a parameter: board  =  pyfirmata.Arduino("/dev/tty.usbserial-­‐A9QPTF37")   Anna Gerber Intro to Electronics in Python
  • 18. Controlling the LED •  Then we can control the LED via the pin it is connected to (in this case, pin 13) •  Use a variable for the pin number to make it easier to change later –  PIN  =  13   •  Turn on LED on pin 13 –  board.digital[PIN].write(1)   •  Turn off LED on pin 13 –  board.digital[PIN].write(0)   Anna Gerber Intro to Electronics in Python
  • 19. Delayed behaviour •  Use the pass_time function to delay functions by a certain number of seconds e.g. blink LED on then off after one second:    board.digital[PIN].write(0)      board.pass_time(1)      board.digital[PIN].write(1)   Anna Gerber Intro to Electronics in Python
  • 20. Repeating behaviour (loops) Use a while loop to blink indefinitely: while  True  :   board.digital[PIN].write(0)   board.pass_time(1)   board.digital[PIN].write(1)   board.pass_time(1)   Anna Gerber Intro to Electronics in Python
  • 21. The entire blink program import  pyfirmata   PORT  =  "/dev/tty.usbserial-­‐A9QPTF37"   PIN  =  13   board  =  pyfirmata.Arduino(PORT)   while  True:          board.digital[PIN].write(0)          board.pass_time(1)          board.digital[PIN].write(1)          board.pass_time(1)   Anna Gerber Intro to Electronics in Python
  • 22. Running the program from Terminal •  Open the Terminal app •  Change directory to the location where you have saved your code e.g. 
  >  cd  ~/Desktop/code/   •  Run your program using Python e.g.
  >  python blink.py
 •  Hit control-C to stop the program Anna Gerber Intro to Electronics in Python
  • 23. Connecting to iPython Notebook •  We will use iPython Notebook running on Raspberry Pi •  Plug into Raspberry Pi via ethernet (connect to DHCP server on Pi) •  Open 192.168.1.1:8888 in your browser Anna Gerber Intro to Electronics in Python
  • 24. How to setup the software at home •  Install Arduino IDE –  Optional, only required if you want to load Firmata again or experiment with programming the Arduino using C++ •  Install Python •  Install PyFirmata   •    Install a code editor e.g. Atom (Mac only), SublimeText if you don't already have one or install iPython Notebook Anna Gerber Intro to Electronics in Python
  • 25. Where to find out more •  Electricity –  https://www.khanacademy.org/science/physics/ electricity-and-magnetism/v/circuits--part-1 •  Arduino Playground –  http://playground.arduino.cc/interfacing/python •  Sample code for Freetronics kit –  https://gist.github.com/AnnaGerber/ 26decdf2aa53150f7515 Anna Gerber Intro to Electronics in Python