SlideShare a Scribd company logo
1 of 43
Download to read offline
Workshop
Kyushu Institute of Technology
Kazuaki Tanaka
2023/9/11-2023/9/15
About Me
• Kazuaki TANAKA(たなか かずあき)
• Kyushu Institute of Technology, JAPAN
Associate Professor
• Ph. D in Information Science
• Research topics: embedded systems, IoT,
mruby, wireless communication
Research topic:
mruby and mruby/c
• Ruby language for small devices
• OO Programming Language
• Target: one-chip microcontroller
PIC, ESP32, STM32, etc.
• Small memory footprint
minimum 20KB
• Open-Source Software
https://github.com/mruby/mruby
https://github.com/mrubyc/mrubyc
What is Ruby language?
• Object Oriented Programming Language
– Scripting language
– Web application, Ruby on Rails
• Matsumoto has said that Ruby is designed
for programmer productivity and fun.
led1 = GPIO.new(0)
while true do
led1.write 1
sleep 0.5
led1.write 0
sleep 0.5
end
Ruby code example:
Research topic:
wireless communication
• LPWA(Low Power Wide Area) communication
network
LPWA
• Long range wireless communication
– ~10km by small wireless module
– Using 920MHz band
24mm
17mm
Low power
Tx: 43mA
Rx: 20mA
Sleep: 1.7μA
Speed:
1kbps
Introduction
This workshop
• Experience in embedded software
development.
• mruby programming
• Controlling electronic circuits
• Brightness sensor
Simple Circuit
Electrical circuit
• Micro controller board
• Electrical parts and circuit
– LED, sensors
– Breadboard
(prototyping board)
Run the first program
• Coding
• Compile and Download
Download= transfer compiled program into
microcontroller board
• Execute
Programming environment
• Open following URL
or
https://mrubyc-ide.ddns.net/editor/rboard
https://bit.ly/45InC1H
Blinking LED
• program1
• First, run this program
led1 = GPIO.new(0)
while true do
led1.write 1
sleep 0.5
led1.write 0
sleep 0.5
end
Microcontroller board
• RBoard
• Features
– Execute program
– Store data
– I/O of Pins
– Input= Measure voltage
– Output= Set voltage
HIGH(1) or LOW(0)
Pin
Onboard LEDs
• 4 LEDs, each LED is connected to Pin
– LED 1: Pin 0
– LED 2: Pin 1
– LED 3: Pin 5
– LED 4: Pin 6
• Set pin voltage to HIGH, then turn on LED
Set to LOW, then turn off LED
Program
• GPIO: General Purpose Input and Output
led1 = GPIO.new(0)
while true do
led1.write 1
sleep 0.5
led1.write 0
sleep 0.5
end
Pin0 is assigned to variable led1
Iteration
write: set voltage
sleep: stop execution
Exercises
• Blink two LEDs alternately
• Blink four LEDs
LED 1: Pin 0
LED 2: Pin 1
LED 3: Pin 5
LED 4: Pin 6
LED
• Light Emitting Diode
Current flows from Anode to Cathode
Longer: Anode
Anode Cathode
LED Circuit
• Make LED on
– Current flowing through the LED
• Rboard feature
– Set voltage of Pin
– Set HIGH or LOW
Wrong circuit
Board
Pin (HIGH)
Pin (LOW)
LED
The resistance of LED is almost 0.
Many current flows,
cause damages to LED
LED circuit
Board
Pin (HIGH)
Pin (LOW)
LED
Resistor
1K ohm
Resistor limits current flowing.
LED circuit
Board
Pin (HIGH/LOW)
GND
LED
Resistor
1K ohm
GND is always LOW
LED on if Pin is HIGH
LED off if Pin is LOW
Breadboard
(Prototyping board)
• Red holes are connected
Using breadboard
• Connecting a LED and a resistor
LED
Resistor
Longer leg Shorter leg
Connecting
• Use jumper wires
Pin 15
GND
LED
Resistor
Pin 15
GND
Implement your code
led1 = GPIO.new(15)
led1.setmode(0)
while true do
led1.write 1
sleep 0.5
led1.write 0
sleep 0.5
end
Set pin mode
0: Output voltage
1: Input voltage
Pin 15
Exercises
• Blink several LEDs on breadboard
You can use Pin15, Pin16, Pin17, Pin18, Pin19, Pin20
PWM
PWM
Analog output
• Output of microcontrollers: Digital
– HIGH or LOW voltage
– In LED, ON or OFF
• We want: Analog
– Change voltage
– In LED, ON…bright…dark…OFF
Pseudo analog output
• PWM, pulse width modulation
• Control HIGH and LOW rapidly
– 1000 times a second
0.1 msec.
50% HIGH 50% LOW
Change brightness
• Change brightness => Change duty ratio
Time
1 msec.
Duty=1
Duty=2
Duty=1023
Duty=1022
Duty=1
Duty=0
Duty=0
PWM example
led1 = PWM.new(15)
led1.frequency 10000
while true do
for i in 0..1023 do
led1.duty i
sleep 0.001
end
for i in 0..1023 do
led1.duty 1023-i
sleep 0.001
end
end
duty: 0 to 1023
0: 0% HIGH
1023: 100% HIGH
Brightness Sensor
CdS
• CdS: Resistance changes with varying light
levels.
• Microcontroller can detect VOLTAGE
CdS circuit
CdS
3.3V
Pin20
GND
Resistor
1K ohm
R ohm
Bright: small R
Dark: large R
𝑃𝑖𝑛20 𝑣𝑜𝑙𝑡𝑎𝑔𝑒 = 3.3 ×
1𝐾
1𝐾 + 𝑅
3.3V
Use this Pin
ADC
• ADC: Analog Digital Converter
– Read voltage at Pin20
– Voltage v
0 < v < 1.5
adc = ADC.new(20)
v = adc.read
CdS example
led1 = GPIO.new(0)
adc = ADC.new(20)
while true do
v = adc.read
if v<0.5 then
led1.write 1
else
led1.write 0
end
sleep 0.1
end
Read voltage
from Pin20
Voltage: 0 < v < 1.5
Pin20 for ADC
Exercises
• Brightness sensor
• LED changes by brightness
– Green: bright
– Yellow: a little dark
– Red: dark
• adc.read returns around 0.2 in dark, and
returns around 0.9 in bright
Conclusion
Embedded systems
• Software and Hardware integration
• Software controls hardware
– Requires both software and hardware knowledge
workshop slide.pdf

More Related Content

What's hot

Bcd to 7 segment display
Bcd to 7 segment displayBcd to 7 segment display
Bcd to 7 segment displayMaulik Sanchela
 
Esp32 cam arduino-123
Esp32 cam arduino-123Esp32 cam arduino-123
Esp32 cam arduino-123Victor Sue
 
IC 555 timer and its applications
IC 555 timer and its applications IC 555 timer and its applications
IC 555 timer and its applications Jay Baria
 
EMBEDDED SYSTEM
EMBEDDED  SYSTEMEMBEDDED  SYSTEM
EMBEDDED SYSTEMAIRTEL
 
Operational Amplifier Part 1
Operational Amplifier Part 1Operational Amplifier Part 1
Operational Amplifier Part 1Mukesh Tekwani
 
Photodetector (Photodiode)
Photodetector (Photodiode)Photodetector (Photodiode)
Photodetector (Photodiode)Kalyan Acharjya
 
Logic Gates Presentation
Logic Gates PresentationLogic Gates Presentation
Logic Gates Presentationnad407
 
applications of photodetectors
applications of photodetectorsapplications of photodetectors
applications of photodetectorsRakesh Raki
 
object detection using ultra sonic sensors
object detection using ultra sonic sensorsobject detection using ultra sonic sensors
object detection using ultra sonic sensorsvijay kumar
 
Automatic room-light-controller-visitor-counter
Automatic room-light-controller-visitor-counterAutomatic room-light-controller-visitor-counter
Automatic room-light-controller-visitor-counterMohit Awasthi
 
IR Sensor Working and Concepts
IR Sensor Working and ConceptsIR Sensor Working and Concepts
IR Sensor Working and ConceptsRobo India
 
Passive infrared sensor technology(pir)
Passive infrared sensor technology(pir)Passive infrared sensor technology(pir)
Passive infrared sensor technology(pir)Umar Shuaib
 
INFRARED SENSOR WORKING PRINCIPLE AND CIRCUIT
INFRARED SENSOR WORKING PRINCIPLE AND CIRCUITINFRARED SENSOR WORKING PRINCIPLE AND CIRCUIT
INFRARED SENSOR WORKING PRINCIPLE AND CIRCUITKaushal Shah
 

What's hot (20)

Bcd to 7 segment display
Bcd to 7 segment displayBcd to 7 segment display
Bcd to 7 segment display
 
Esp32 cam arduino-123
Esp32 cam arduino-123Esp32 cam arduino-123
Esp32 cam arduino-123
 
aA000047
aA000047aA000047
aA000047
 
IC 555 timer and its applications
IC 555 timer and its applications IC 555 timer and its applications
IC 555 timer and its applications
 
Opto coupler
Opto couplerOpto coupler
Opto coupler
 
Ic 555 timer 0
Ic 555 timer 0Ic 555 timer 0
Ic 555 timer 0
 
EMBEDDED SYSTEM
EMBEDDED  SYSTEMEMBEDDED  SYSTEM
EMBEDDED SYSTEM
 
Ic 555
Ic 555Ic 555
Ic 555
 
HEART BEAT DETECTOR PPT
HEART BEAT DETECTOR PPTHEART BEAT DETECTOR PPT
HEART BEAT DETECTOR PPT
 
Operational Amplifier Part 1
Operational Amplifier Part 1Operational Amplifier Part 1
Operational Amplifier Part 1
 
Photodetector (Photodiode)
Photodetector (Photodiode)Photodetector (Photodiode)
Photodetector (Photodiode)
 
Logic Gates Presentation
Logic Gates PresentationLogic Gates Presentation
Logic Gates Presentation
 
applications of photodetectors
applications of photodetectorsapplications of photodetectors
applications of photodetectors
 
Op amp
Op ampOp amp
Op amp
 
object detection using ultra sonic sensors
object detection using ultra sonic sensorsobject detection using ultra sonic sensors
object detection using ultra sonic sensors
 
Automatic room-light-controller-visitor-counter
Automatic room-light-controller-visitor-counterAutomatic room-light-controller-visitor-counter
Automatic room-light-controller-visitor-counter
 
Digital logic families
Digital logic familiesDigital logic families
Digital logic families
 
IR Sensor Working and Concepts
IR Sensor Working and ConceptsIR Sensor Working and Concepts
IR Sensor Working and Concepts
 
Passive infrared sensor technology(pir)
Passive infrared sensor technology(pir)Passive infrared sensor technology(pir)
Passive infrared sensor technology(pir)
 
INFRARED SENSOR WORKING PRINCIPLE AND CIRCUIT
INFRARED SENSOR WORKING PRINCIPLE AND CIRCUITINFRARED SENSOR WORKING PRINCIPLE AND CIRCUIT
INFRARED SENSOR WORKING PRINCIPLE AND CIRCUIT
 

Similar to workshop slide.pdf

arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfAbdErrezakChahoub
 
internship report and presentation for electronics students
internship report and presentation for electronics studentsinternship report and presentation for electronics students
internship report and presentation for electronics studentsjaisivajaisiva0492
 
Digital clock workshop
Digital clock workshopDigital clock workshop
Digital clock workshopKedarv
 
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)markumoto
 
To measure the intensity of light using LDR sensor by calibrating voltage wit...
To measure the intensity of light using LDR sensor by calibrating voltage wit...To measure the intensity of light using LDR sensor by calibrating voltage wit...
To measure the intensity of light using LDR sensor by calibrating voltage wit...Ankita Tiwari
 
Arduino with brief description of sensorsppt.pptx
Arduino with brief description of sensorsppt.pptxArduino with brief description of sensorsppt.pptx
Arduino with brief description of sensorsppt.pptxBhuvanaN12
 
Arduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond BasicsArduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond BasicsVic Fernandes
 
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...Nishmi Suresh
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
04 Arduino Peripheral Interfacing
04   Arduino Peripheral Interfacing04   Arduino Peripheral Interfacing
04 Arduino Peripheral InterfacingWingston
 
Arduino spooky projects_class3
Arduino spooky projects_class3Arduino spooky projects_class3
Arduino spooky projects_class3Anil Yadav
 
Interfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using ArduinoInterfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using ArduinoDiksha Prakash
 

Similar to workshop slide.pdf (20)

workshop slide.pdf
workshop slide.pdfworkshop slide.pdf
workshop slide.pdf
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
 
Ardui no
Ardui no Ardui no
Ardui no
 
internship report and presentation for electronics students
internship report and presentation for electronics studentsinternship report and presentation for electronics students
internship report and presentation for electronics students
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
Intro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptxIntro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptx
 
Measurements upload
Measurements uploadMeasurements upload
Measurements upload
 
Iot 101
Iot 101Iot 101
Iot 101
 
Digital clock workshop
Digital clock workshopDigital clock workshop
Digital clock workshop
 
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)
 
To measure the intensity of light using LDR sensor by calibrating voltage wit...
To measure the intensity of light using LDR sensor by calibrating voltage wit...To measure the intensity of light using LDR sensor by calibrating voltage wit...
To measure the intensity of light using LDR sensor by calibrating voltage wit...
 
Arduino with brief description of sensorsppt.pptx
Arduino with brief description of sensorsppt.pptxArduino with brief description of sensorsppt.pptx
Arduino with brief description of sensorsppt.pptx
 
Arduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond BasicsArduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond Basics
 
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Fingerprint Biometrics
Fingerprint BiometricsFingerprint Biometrics
Fingerprint Biometrics
 
04 Arduino Peripheral Interfacing
04   Arduino Peripheral Interfacing04   Arduino Peripheral Interfacing
04 Arduino Peripheral Interfacing
 
Arduino spooky projects_class3
Arduino spooky projects_class3Arduino spooky projects_class3
Arduino spooky projects_class3
 
Interfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using ArduinoInterfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using Arduino
 
Arduino
ArduinoArduino
Arduino
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 

workshop slide.pdf

  • 1. Workshop Kyushu Institute of Technology Kazuaki Tanaka 2023/9/11-2023/9/15
  • 2. About Me • Kazuaki TANAKA(たなか かずあき) • Kyushu Institute of Technology, JAPAN Associate Professor • Ph. D in Information Science • Research topics: embedded systems, IoT, mruby, wireless communication
  • 3. Research topic: mruby and mruby/c • Ruby language for small devices • OO Programming Language • Target: one-chip microcontroller PIC, ESP32, STM32, etc. • Small memory footprint minimum 20KB • Open-Source Software https://github.com/mruby/mruby https://github.com/mrubyc/mrubyc
  • 4. What is Ruby language? • Object Oriented Programming Language – Scripting language – Web application, Ruby on Rails • Matsumoto has said that Ruby is designed for programmer productivity and fun. led1 = GPIO.new(0) while true do led1.write 1 sleep 0.5 led1.write 0 sleep 0.5 end Ruby code example:
  • 5. Research topic: wireless communication • LPWA(Low Power Wide Area) communication network
  • 6. LPWA • Long range wireless communication – ~10km by small wireless module – Using 920MHz band 24mm 17mm Low power Tx: 43mA Rx: 20mA Sleep: 1.7μA Speed: 1kbps
  • 8. This workshop • Experience in embedded software development. • mruby programming • Controlling electronic circuits • Brightness sensor
  • 10. Electrical circuit • Micro controller board • Electrical parts and circuit – LED, sensors – Breadboard (prototyping board)
  • 11. Run the first program • Coding • Compile and Download Download= transfer compiled program into microcontroller board • Execute
  • 12. Programming environment • Open following URL or https://mrubyc-ide.ddns.net/editor/rboard https://bit.ly/45InC1H
  • 13. Blinking LED • program1 • First, run this program led1 = GPIO.new(0) while true do led1.write 1 sleep 0.5 led1.write 0 sleep 0.5 end
  • 14. Microcontroller board • RBoard • Features – Execute program – Store data – I/O of Pins – Input= Measure voltage – Output= Set voltage HIGH(1) or LOW(0) Pin
  • 15. Onboard LEDs • 4 LEDs, each LED is connected to Pin – LED 1: Pin 0 – LED 2: Pin 1 – LED 3: Pin 5 – LED 4: Pin 6 • Set pin voltage to HIGH, then turn on LED Set to LOW, then turn off LED
  • 16. Program • GPIO: General Purpose Input and Output led1 = GPIO.new(0) while true do led1.write 1 sleep 0.5 led1.write 0 sleep 0.5 end Pin0 is assigned to variable led1 Iteration write: set voltage sleep: stop execution
  • 17. Exercises • Blink two LEDs alternately • Blink four LEDs LED 1: Pin 0 LED 2: Pin 1 LED 3: Pin 5 LED 4: Pin 6
  • 18. LED • Light Emitting Diode Current flows from Anode to Cathode Longer: Anode Anode Cathode
  • 19. LED Circuit • Make LED on – Current flowing through the LED • Rboard feature – Set voltage of Pin – Set HIGH or LOW
  • 20. Wrong circuit Board Pin (HIGH) Pin (LOW) LED The resistance of LED is almost 0. Many current flows, cause damages to LED
  • 21. LED circuit Board Pin (HIGH) Pin (LOW) LED Resistor 1K ohm Resistor limits current flowing.
  • 22. LED circuit Board Pin (HIGH/LOW) GND LED Resistor 1K ohm GND is always LOW LED on if Pin is HIGH LED off if Pin is LOW
  • 24. Using breadboard • Connecting a LED and a resistor LED Resistor Longer leg Shorter leg
  • 25.
  • 26. Connecting • Use jumper wires Pin 15 GND LED Resistor Pin 15 GND
  • 27. Implement your code led1 = GPIO.new(15) led1.setmode(0) while true do led1.write 1 sleep 0.5 led1.write 0 sleep 0.5 end Set pin mode 0: Output voltage 1: Input voltage Pin 15
  • 28. Exercises • Blink several LEDs on breadboard You can use Pin15, Pin16, Pin17, Pin18, Pin19, Pin20
  • 29. PWM
  • 30. PWM Analog output • Output of microcontrollers: Digital – HIGH or LOW voltage – In LED, ON or OFF • We want: Analog – Change voltage – In LED, ON…bright…dark…OFF
  • 31. Pseudo analog output • PWM, pulse width modulation • Control HIGH and LOW rapidly – 1000 times a second 0.1 msec. 50% HIGH 50% LOW
  • 32. Change brightness • Change brightness => Change duty ratio Time 1 msec. Duty=1 Duty=2 Duty=1023 Duty=1022 Duty=1 Duty=0 Duty=0
  • 33. PWM example led1 = PWM.new(15) led1.frequency 10000 while true do for i in 0..1023 do led1.duty i sleep 0.001 end for i in 0..1023 do led1.duty 1023-i sleep 0.001 end end duty: 0 to 1023 0: 0% HIGH 1023: 100% HIGH
  • 35. CdS • CdS: Resistance changes with varying light levels. • Microcontroller can detect VOLTAGE
  • 36. CdS circuit CdS 3.3V Pin20 GND Resistor 1K ohm R ohm Bright: small R Dark: large R 𝑃𝑖𝑛20 𝑣𝑜𝑙𝑡𝑎𝑔𝑒 = 3.3 × 1𝐾 1𝐾 + 𝑅
  • 38. ADC • ADC: Analog Digital Converter – Read voltage at Pin20 – Voltage v 0 < v < 1.5 adc = ADC.new(20) v = adc.read
  • 39. CdS example led1 = GPIO.new(0) adc = ADC.new(20) while true do v = adc.read if v<0.5 then led1.write 1 else led1.write 0 end sleep 0.1 end Read voltage from Pin20 Voltage: 0 < v < 1.5 Pin20 for ADC
  • 40. Exercises • Brightness sensor • LED changes by brightness – Green: bright – Yellow: a little dark – Red: dark • adc.read returns around 0.2 in dark, and returns around 0.9 in bright
  • 42. Embedded systems • Software and Hardware integration • Software controls hardware – Requires both software and hardware knowledge