SlideShare a Scribd company logo
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

Phototransistors
PhototransistorsPhototransistors
Phototransistors
Abisheik Samuel
 
Revista Tehnium 74_10
Revista Tehnium 74_10Revista Tehnium 74_10
Revista Tehnium 74_10
mircea7
 
ELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsx
ELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsxELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsx
ELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsx
elijahachiekpanchol1
 
Arduino Based Smart Light Management System for Smart Cities
Arduino Based Smart Light Management System for Smart CitiesArduino Based Smart Light Management System for Smart Cities
Arduino Based Smart Light Management System for Smart Cities
ijtsrd
 
Digital Alarm Clock (IC-TMS-8560)
Digital Alarm Clock (IC-TMS-8560)Digital Alarm Clock (IC-TMS-8560)
Digital Alarm Clock (IC-TMS-8560)
Chintan Patel
 
Trabajo del protoboard
Trabajo del protoboardTrabajo del protoboard
Trabajo del protoboard
Richard Torres
 
Tutoriel alarme
Tutoriel alarmeTutoriel alarme
Tutoriel alarme
Conrad
 
Digital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerDigital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontroller
Saylee joshi
 
Rc oscillator circuit
Rc oscillator circuitRc oscillator circuit
Rc oscillator circuit
THE CREATORS ACADEMY
 
Crystal oscillator
Crystal oscillatorCrystal oscillator
Crystal oscillator
yash sawarkar
 
Bi directional visitor counter rewat
Bi directional visitor counter   rewatBi directional visitor counter   rewat
Bi directional visitor counter rewat
vishwesh sharma
 
Blood pressure measurement by using photoelectric transducers
Blood pressure measurement by using photoelectric transducersBlood pressure measurement by using photoelectric transducers
Blood pressure measurement by using photoelectric transducers
Yuga Aravind Kumar
 
Electronic Measurement - Pressure Measurement
Electronic Measurement - Pressure MeasurementElectronic Measurement - Pressure Measurement
Electronic Measurement - Pressure Measurement
Burdwan University
 
Hunk-160R-FI-Hero-MotoCorp.pdf
Hunk-160R-FI-Hero-MotoCorp.pdfHunk-160R-FI-Hero-MotoCorp.pdf
Hunk-160R-FI-Hero-MotoCorp.pdf
BrayanDavid44
 

What's hot (14)

Phototransistors
PhototransistorsPhototransistors
Phototransistors
 
Revista Tehnium 74_10
Revista Tehnium 74_10Revista Tehnium 74_10
Revista Tehnium 74_10
 
ELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsx
ELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsxELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsx
ELC2242 14- Sedra Ch 14 CMOS Digital Logic Circuits Spring 2020 Eng Nar.ppsx
 
Arduino Based Smart Light Management System for Smart Cities
Arduino Based Smart Light Management System for Smart CitiesArduino Based Smart Light Management System for Smart Cities
Arduino Based Smart Light Management System for Smart Cities
 
Digital Alarm Clock (IC-TMS-8560)
Digital Alarm Clock (IC-TMS-8560)Digital Alarm Clock (IC-TMS-8560)
Digital Alarm Clock (IC-TMS-8560)
 
Trabajo del protoboard
Trabajo del protoboardTrabajo del protoboard
Trabajo del protoboard
 
Tutoriel alarme
Tutoriel alarmeTutoriel alarme
Tutoriel alarme
 
Digital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerDigital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontroller
 
Rc oscillator circuit
Rc oscillator circuitRc oscillator circuit
Rc oscillator circuit
 
Crystal oscillator
Crystal oscillatorCrystal oscillator
Crystal oscillator
 
Bi directional visitor counter rewat
Bi directional visitor counter   rewatBi directional visitor counter   rewat
Bi directional visitor counter rewat
 
Blood pressure measurement by using photoelectric transducers
Blood pressure measurement by using photoelectric transducersBlood pressure measurement by using photoelectric transducers
Blood pressure measurement by using photoelectric transducers
 
Electronic Measurement - Pressure Measurement
Electronic Measurement - Pressure MeasurementElectronic Measurement - Pressure Measurement
Electronic Measurement - Pressure Measurement
 
Hunk-160R-FI-Hero-MotoCorp.pdf
Hunk-160R-FI-Hero-MotoCorp.pdfHunk-160R-FI-Hero-MotoCorp.pdf
Hunk-160R-FI-Hero-MotoCorp.pdf
 

Similar to workshop slide.pdf

workshop slide.pdf
workshop slide.pdfworkshop slide.pdf
workshop slide.pdf
Kazuaki Tanaka
 
Ardui no
Ardui no Ardui no
Ardui no
Amol Sakhalkar
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
AbdErrezakChahoub
 
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
jaisivajaisiva0492
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
Zhentao Xu
 
Intro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptxIntro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptx
CephasMpandikaKalemb
 
Measurements upload
Measurements uploadMeasurements upload
Measurements upload
Nandana Priyanka Eluri
 
Iot 101
Iot 101Iot 101
Iot 101
Anna Gerber
 
Digital clock workshop
Digital clock workshopDigital clock workshop
Digital clock workshop
Kedarv
 
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.pptx
BhuvanaN12
 
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
Vic 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).pptx
HebaEng
 
Fingerprint Biometrics
Fingerprint BiometricsFingerprint Biometrics
Fingerprint Biometrics
Rudra Prasad Maiti
 
04 Arduino Peripheral Interfacing
04   Arduino Peripheral Interfacing04   Arduino Peripheral Interfacing
04 Arduino Peripheral Interfacing
Wingston
 
Arduino spooky projects_class3
Arduino spooky projects_class3Arduino spooky projects_class3
Arduino spooky projects_class3
Anil 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 Arduino
Diksha Prakash
 
Arduino
ArduinoArduino

Similar to workshop slide.pdf (20)

workshop slide.pdf
workshop slide.pdfworkshop slide.pdf
workshop slide.pdf
 
Ardui no
Ardui no Ardui no
Ardui no
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
 
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

2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
HODECEDSIET
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 

Recently uploaded (20)

2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 

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