SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
Arduino workshop 2018Arduino workshop 2018
Hands-on Arduino:
8-step drum sequencer
Tom Tobback
www.cassiopeia.hk
2018
Arduino workshop 2018
some of Tom’s projects
cassiopeia.hk/category/projects/
Arduino workshop 2018
Before we start… check the connection between your
Arduino board and your laptop:
● plugin your Arduino board USB cable into your laptop
● open Arduino IDE software (www.arduino.cc)
● open the Blink sketch from File>Examples>Basic
● pick the correct port from Tools>Serial Port
● pick the correct board type from Tools>Board “Uno”
● hit ‘upload’ to test the connection
● look for ‘Done uploading’ and check if the onboard LED
is blinking
Arduino workshop 2018
Arduino: what is it?
Arduino is an open-source
electronics prototyping platform
based on flexible, easy-to-use
hardware and software
It is intended for artists, designers,
hobbyists and anyone interested in
creating interactive objects or
environments
• sensors
• sound
• light
• wifi
• ...
Arduino workshop 2018
Our program for today
terminology 4
software 2
basic electronics 4
projects 20+
blink
sequencer
Slides PDF:
Desktop/workshop/SonarHK2018-arduino-slides.pdf
Arduino workshop 2018
Arduino terminology
software:
• IDE
• web editor
• sketch
• uploading
• syntax
hardware:
• board
• microcontroller (mcu)
• pin headers
• input
• output
• digital/analog
• breadboard
• jumper wires
• components
Arduino workshop 2018
Arduino vs Raspberry Pi
➔ looks similar
➔ similar price
➔ micro-controller vs
mini-computer
➔ Arduino: IO
➔ Pi: OS
Other popular platforms:
ESP8266, Particle Photon, micro:bit
Arduino workshop 2018
Arduino boards
➔ many official boards
➔ different sizes
➔ different connections
➔ use same code
➔ mostly compatible
➔ extra functions via shields
Arduino workshop 2018
Arduino UNO
Arduino workshop 2018
Arduino-style boards
➔ many copies
➔ many improvements
➔ extra functions included
(Wifi, GPS, motor, Ethernet,...)
➔ use same code
➔ mostly compatible
➔ cheaper!
Arduino workshop 2018
Arduino software: IDE
➔ Integrated Development Environment
➔ Write sketch -> upload to board
➔ Useful examples
➔ ‘Libraries’ to make our life easier
Always make sure to pick the correct BOARD
➔ Connect using USB cable, pick correct PORT
➔ Upload sketch
➔ Check output of Serial Monitor
➔ Save your sketches..
Arduino workshop 2018
Arduino software: Web Editor
Same functionality with:
➔ Browser based editor (needs login)
➔ Accessible from any computer
➔ Storage in the cloud
➔ Need to sign up for username
➔ Need to install the Arduino Create plugin for upload
Arduino workshop 2018
Basic electronics
➔ DC direct current vs alternating current AC
➔ voltage: volts 5V (usb), 3V3, 9V
➔ current: milli ampere 40 mA = 0.04 A
➔ power: watts 1-2 W (USB limit)
➔ resistors: reduce voltage
➔ diodes: one-way + light
➔ capacitors: small battery
➔ schematics
Arduino workshop 2018
Basic electronics
DIGITAL: on/off
1/0
true/false
high/low
0V/5V
ANALOG: variable 0->5V
Ohm’s law: U = I * R
Kirchoff’s laws:
Arduino workshop 2018
From prototype to product
Arduino workshop 2018
Breadboard = connections
Arduino workshop 2018
Breadboard power rails
5V to red line
GND to blue line
Optional:
connect to other side
Arduino workshop 2018
Our project
Arduino workshop 2018
Arduino projects for today
➔ Blink: the ‘hello world’ of Arduino pinMode
digitalWrite
delay
➔ Read push button digitalRead
➔ Read potentiometer analogRead
Build the step sequencer
Connect to drum PCB
Arduino workshop 2018
Arduino: ‘blink’ sketch
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
initialisation
setup { }
loop { }
change these numbers and see what happens
‘upload’ after each change!
File>Open> “Desktop/workshop/blink1/blink1.ino”
Arduino workshop 2018
Arduino: blink
Blink: the ‘hello world’ of Arduino
220 ohm
LEDs short straight leg goes
into the blue line (GND)
Arduino workshop 2018
resistor colour code
220 ohm = 220 Ω
red red black black (brown)
10k ohm = 10,000 Ω
brown black black red
(brown)
Arduino workshop 2018
connect the drum PCB
8 inputs - power - speaker
power:
PWR+ goes to 5V (red line on breadboard)
PWR- goes to GND (blue line on breadboard)
speaker:
connect SPK+
and SPK-
BD = bass drum
SD = snare drum
CH = closed hi-hat
OH = open hi-hat
RS = rim shot
CL = clap
RD = ride
CR = crash
Arduino workshop 2018
connect the drum PCB
can also connect to amplifier or earphones with
3.5mm mini jack
Arduino workshop 2018
connect the drum PCB
drum triggered on
the falling edge
HIGH
LOW
drum sound
starts
Arduino workshop 2018
Arduino: button
[add this to setup]
pinMode(2, INPUT_PULLUP);
[replace loop with]
if (digitalRead(2) == LOW) {
digitalWrite(13, LOW);
}
else {
digitalWrite(13, HIGH);
}
which is same as:
digitalWrite(13, digitalRead(2));
INPUT_PULLUP:
● avoid ‘floating’ input status
● inverted logic: push = LOW
Arduino workshop 2018
Arduino: potentiometer
put the pot legs in
columns 8,10,12
Arduino workshop 2018
Arduino: potentiometer
[replace loop with]
void loop() {
digitalWrite(13, HIGH);
delay(10);
digitalWrite(13, LOW);
delay(analogRead(A0));
}
[analogRead returns 0->1023]put the pot legs in
columns 8,10,12
Arduino workshop 2018
Serial Monitor and Plotter
[add this line to setup]
Serial.begin(9600);
[modify loop to]
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
Serial.println(analogRead(A0));
Arduino workshop 2018
Arduino: sound
[modify loop to]
digitalWrite(13, HIGH);
tone(3, 1000);
delay(100);
digitalWrite(13, LOW);
noTone(3);
delay(analogRead(A0));
Arduino workshop 2018
7 segment display
use 8 short wires
D13 to D6 (8 pins)
resistor from blue
line to column 3
10,11,x,12,13
9,8,x,7,6
Arduino workshop 2018
7 segment display
File>Open> “Desktop/workshop/seq8-template1/seq8-template1.ino”
this sketch has helper functions in tab “sonar.h”
add in loop:
showStep();
delay(analogRead(A0));
increaseStep();
Arduino workshop 2018
7 segment display + pulse
modify loop:
showStep();
digitalWrite(13, HIGH);
delay(10);
digitalWrite(13, LOW);
delay(analogRead(A0));
increaseStep();
pulse delay
showStep increaseStep
Arduino workshop 2018
connect clock to drum PCB
add a long wire from the breadboard
(dot of segment display, column 5) to
the drum PCB, any input e.g. CH
CH
Arduino workshop 2018
Add 4 control buttons
use the 4-pin ribbon cable
A1 to A4
X
Arduino workshop 2018
Add 3 drum LEDs
use the short 3-pin ribbon cable
D5 to D3 LED’s short straight leg goes
into the blue line (GND)
X
Arduino workshop 2018
LED pulses
modify loop:
showStep();
sendPulses();
delay(analogRead(A0));
increaseStep();
pulse delay
showStep increaseStep
X
Arduino workshop 2018
Add 3 outputs to drum PCB
use the long 3-pin ribbon cable to BD SD OH
X
Arduino workshop 2018
play/step mode
modify loop:
showStep();
if (playMode()) {
sendPulses();
delay(analogRead(A0));
} else {
editStep();
}
increaseStep();
add a wire from D2 to
GND (blue line)
Arduino workshop 2018
edit step mode
with the D2 wire connected, move to next step with button 4
the LEDs show
which drum is
active for that step
use the 3 buttons
to toggle on/off
Arduino workshop 2018
hack it :-)
● change the 3+1 output wires to different drum sounds
● use a wire connected to GND to trigger other drum
sounds while the sequence is playing
● change the code to 6 steps
● replace the drum samples in the drum chip with your own
samples
● build a box for this sequencer
● ...
Arduino workshop 2018
drum chip
Arduino chip (Atmega328p)
Open Source code “dsp-D8” from
https://janostman.wordpress.com/2016/01/03/the-dsp-d8-drumchip-source-code/
(minor modifications)
Arduino workshop 2018
Arduino: suppliers
ONLINE
➔ Official Arduino shop: http://arduino.cc/
great documentation, projects, forum
➔ Seeedstudio: http://www.seeedstudio.com/depot/
➔ Telesky: https://telesky.world.tmall.com/
➔ Adafruit: http://www.adafruit.com/ great documentation
IN HONG KONG - Apliu St
➔ WECL http://www.weclonline.com/wecl_eng/index.html
Arduino workshop 2018
Arduino: kits
➔ Seeedstudio Sidekick
Arduino kit
➔ Arduino Starter Kit
Arduino workshop 2018
Dimsum Labs
the hackerspace of HK www.dimsumlabs.com/
community of technology enthusiasts
space for creativity in Sheung Wan
Tuesday evening HackJam
www.facebook.com/groups/hackjamhk/
Arduino workshop 2018Arduino workshop 2018
Thank you
www.cassiopeia.hk
Happy tinkering!

Weitere ähnliche Inhalte

Was ist angesagt?

IOTC08 The Arduino Platform
IOTC08 The Arduino PlatformIOTC08 The Arduino Platform
IOTC08 The Arduino PlatformEoin Brazil
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshopatuline
 
How to measure frequency and duty cycle using arduino
How to measure frequency and duty cycle using  arduinoHow to measure frequency and duty cycle using  arduino
How to measure frequency and duty cycle using arduinoSagar Srivastav
 
Arduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of MoratuwaArduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of MoratuwaAbarajithan Gnaneswaran
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!Makers of India
 
Arduino Introduction by coopermaa
Arduino Introduction by coopermaaArduino Introduction by coopermaa
Arduino Introduction by coopermaa馬 萬圳
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labAnnamaria Lisotti
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Sudar Muthu
 
Ardublock tutorial
Ardublock tutorialArdublock tutorial
Ardublock tutorialJakie_Li
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorialsAnshu Pandey
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Eoin Brazil
 
Advanced view of atmega microcontroller projects list 1649 at mega32 avr
Advanced view of atmega microcontroller projects list 1649  at mega32 avrAdvanced view of atmega microcontroller projects list 1649  at mega32 avr
Advanced view of atmega microcontroller projects list 1649 at mega32 avrWiseNaeem
 
Intro to Hardware Programming with the Arduino Uno
Intro to Hardware Programming with the Arduino UnoIntro to Hardware Programming with the Arduino Uno
Intro to Hardware Programming with the Arduino UnoVui Nguyen
 

Was ist angesagt? (20)

IOTC08 The Arduino Platform
IOTC08 The Arduino PlatformIOTC08 The Arduino Platform
IOTC08 The Arduino Platform
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Apostila arduino
Apostila arduinoApostila arduino
Apostila arduino
 
How to measure frequency and duty cycle using arduino
How to measure frequency and duty cycle using  arduinoHow to measure frequency and duty cycle using  arduino
How to measure frequency and duty cycle using arduino
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Arduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of MoratuwaArduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of Moratuwa
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Arduino Introduction by coopermaa
Arduino Introduction by coopermaaArduino Introduction by coopermaa
Arduino Introduction by coopermaa
 
Arduino Programming
Arduino ProgrammingArduino Programming
Arduino Programming
 
arduino
arduinoarduino
arduino
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics lab
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
 
Ardublock tutorial
Ardublock tutorialArdublock tutorial
Ardublock tutorial
 
Presentation S4A
Presentation S4A Presentation S4A
Presentation S4A
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorials
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
 
Advanced view of atmega microcontroller projects list 1649 at mega32 avr
Advanced view of atmega microcontroller projects list 1649  at mega32 avrAdvanced view of atmega microcontroller projects list 1649  at mega32 avr
Advanced view of atmega microcontroller projects list 1649 at mega32 avr
 
Intro to Hardware Programming with the Arduino Uno
Intro to Hardware Programming with the Arduino UnoIntro to Hardware Programming with the Arduino Uno
Intro to Hardware Programming with the Arduino Uno
 

Ähnlich wie Arduino 8-step drum sequencer 3 channels

Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
Cassiopeia ltd Arduino follow-up workshop 2018
Cassiopeia ltd   Arduino follow-up workshop 2018Cassiopeia ltd   Arduino follow-up workshop 2018
Cassiopeia ltd Arduino follow-up workshop 2018tomtobback
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 
Using arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of thingsUsing arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of thingsSudar Muthu
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshopmayur1432
 
Arduino - Learning.pdf
Arduino - Learning.pdfArduino - Learning.pdf
Arduino - Learning.pdfKhalilSedki1
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduinoavikdhupar
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.pptZainIslam20
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxethannguyen1618
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Tom Paulus
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using ArduinoBalajiK109
 

Ähnlich wie Arduino 8-step drum sequencer 3 channels (20)

Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Cassiopeia ltd Arduino follow-up workshop 2018
Cassiopeia ltd   Arduino follow-up workshop 2018Cassiopeia ltd   Arduino follow-up workshop 2018
Cassiopeia ltd Arduino follow-up workshop 2018
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Using arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of thingsUsing arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of things
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
 
Arduino - Learning.pdf
Arduino - Learning.pdfArduino - Learning.pdf
Arduino - Learning.pdf
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
Indroduction arduino
Indroduction arduinoIndroduction arduino
Indroduction arduino
 
Indroduction the arduino
Indroduction the arduinoIndroduction the arduino
Indroduction the arduino
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using Arduino
 

Kürzlich hochgeladen

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Kürzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Arduino 8-step drum sequencer 3 channels

  • 1. Arduino workshop 2018Arduino workshop 2018 Hands-on Arduino: 8-step drum sequencer Tom Tobback www.cassiopeia.hk 2018
  • 2. Arduino workshop 2018 some of Tom’s projects cassiopeia.hk/category/projects/
  • 3. Arduino workshop 2018 Before we start… check the connection between your Arduino board and your laptop: ● plugin your Arduino board USB cable into your laptop ● open Arduino IDE software (www.arduino.cc) ● open the Blink sketch from File>Examples>Basic ● pick the correct port from Tools>Serial Port ● pick the correct board type from Tools>Board “Uno” ● hit ‘upload’ to test the connection ● look for ‘Done uploading’ and check if the onboard LED is blinking
  • 4. Arduino workshop 2018 Arduino: what is it? Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software It is intended for artists, designers, hobbyists and anyone interested in creating interactive objects or environments • sensors • sound • light • wifi • ...
  • 5. Arduino workshop 2018 Our program for today terminology 4 software 2 basic electronics 4 projects 20+ blink sequencer Slides PDF: Desktop/workshop/SonarHK2018-arduino-slides.pdf
  • 6. Arduino workshop 2018 Arduino terminology software: • IDE • web editor • sketch • uploading • syntax hardware: • board • microcontroller (mcu) • pin headers • input • output • digital/analog • breadboard • jumper wires • components
  • 7. Arduino workshop 2018 Arduino vs Raspberry Pi ➔ looks similar ➔ similar price ➔ micro-controller vs mini-computer ➔ Arduino: IO ➔ Pi: OS Other popular platforms: ESP8266, Particle Photon, micro:bit
  • 8. Arduino workshop 2018 Arduino boards ➔ many official boards ➔ different sizes ➔ different connections ➔ use same code ➔ mostly compatible ➔ extra functions via shields
  • 10. Arduino workshop 2018 Arduino-style boards ➔ many copies ➔ many improvements ➔ extra functions included (Wifi, GPS, motor, Ethernet,...) ➔ use same code ➔ mostly compatible ➔ cheaper!
  • 11. Arduino workshop 2018 Arduino software: IDE ➔ Integrated Development Environment ➔ Write sketch -> upload to board ➔ Useful examples ➔ ‘Libraries’ to make our life easier Always make sure to pick the correct BOARD ➔ Connect using USB cable, pick correct PORT ➔ Upload sketch ➔ Check output of Serial Monitor ➔ Save your sketches..
  • 12. Arduino workshop 2018 Arduino software: Web Editor Same functionality with: ➔ Browser based editor (needs login) ➔ Accessible from any computer ➔ Storage in the cloud ➔ Need to sign up for username ➔ Need to install the Arduino Create plugin for upload
  • 13. Arduino workshop 2018 Basic electronics ➔ DC direct current vs alternating current AC ➔ voltage: volts 5V (usb), 3V3, 9V ➔ current: milli ampere 40 mA = 0.04 A ➔ power: watts 1-2 W (USB limit) ➔ resistors: reduce voltage ➔ diodes: one-way + light ➔ capacitors: small battery ➔ schematics
  • 14. Arduino workshop 2018 Basic electronics DIGITAL: on/off 1/0 true/false high/low 0V/5V ANALOG: variable 0->5V Ohm’s law: U = I * R Kirchoff’s laws:
  • 15. Arduino workshop 2018 From prototype to product
  • 17. Arduino workshop 2018 Breadboard power rails 5V to red line GND to blue line Optional: connect to other side
  • 19. Arduino workshop 2018 Arduino projects for today ➔ Blink: the ‘hello world’ of Arduino pinMode digitalWrite delay ➔ Read push button digitalRead ➔ Read potentiometer analogRead Build the step sequencer Connect to drum PCB
  • 20. Arduino workshop 2018 Arduino: ‘blink’ sketch /* Blink Turns on an LED on for one second, then off for one second, repeatedly. */ // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } initialisation setup { } loop { } change these numbers and see what happens ‘upload’ after each change! File>Open> “Desktop/workshop/blink1/blink1.ino”
  • 21. Arduino workshop 2018 Arduino: blink Blink: the ‘hello world’ of Arduino 220 ohm LEDs short straight leg goes into the blue line (GND)
  • 22. Arduino workshop 2018 resistor colour code 220 ohm = 220 Ω red red black black (brown) 10k ohm = 10,000 Ω brown black black red (brown)
  • 23. Arduino workshop 2018 connect the drum PCB 8 inputs - power - speaker power: PWR+ goes to 5V (red line on breadboard) PWR- goes to GND (blue line on breadboard) speaker: connect SPK+ and SPK- BD = bass drum SD = snare drum CH = closed hi-hat OH = open hi-hat RS = rim shot CL = clap RD = ride CR = crash
  • 24. Arduino workshop 2018 connect the drum PCB can also connect to amplifier or earphones with 3.5mm mini jack
  • 25. Arduino workshop 2018 connect the drum PCB drum triggered on the falling edge HIGH LOW drum sound starts
  • 26. Arduino workshop 2018 Arduino: button [add this to setup] pinMode(2, INPUT_PULLUP); [replace loop with] if (digitalRead(2) == LOW) { digitalWrite(13, LOW); } else { digitalWrite(13, HIGH); } which is same as: digitalWrite(13, digitalRead(2)); INPUT_PULLUP: ● avoid ‘floating’ input status ● inverted logic: push = LOW
  • 27. Arduino workshop 2018 Arduino: potentiometer put the pot legs in columns 8,10,12
  • 28. Arduino workshop 2018 Arduino: potentiometer [replace loop with] void loop() { digitalWrite(13, HIGH); delay(10); digitalWrite(13, LOW); delay(analogRead(A0)); } [analogRead returns 0->1023]put the pot legs in columns 8,10,12
  • 29. Arduino workshop 2018 Serial Monitor and Plotter [add this line to setup] Serial.begin(9600); [modify loop to] digitalWrite(13, HIGH); delay(100); digitalWrite(13, LOW); Serial.println(analogRead(A0));
  • 30. Arduino workshop 2018 Arduino: sound [modify loop to] digitalWrite(13, HIGH); tone(3, 1000); delay(100); digitalWrite(13, LOW); noTone(3); delay(analogRead(A0));
  • 31. Arduino workshop 2018 7 segment display use 8 short wires D13 to D6 (8 pins) resistor from blue line to column 3 10,11,x,12,13 9,8,x,7,6
  • 32. Arduino workshop 2018 7 segment display File>Open> “Desktop/workshop/seq8-template1/seq8-template1.ino” this sketch has helper functions in tab “sonar.h” add in loop: showStep(); delay(analogRead(A0)); increaseStep();
  • 33. Arduino workshop 2018 7 segment display + pulse modify loop: showStep(); digitalWrite(13, HIGH); delay(10); digitalWrite(13, LOW); delay(analogRead(A0)); increaseStep(); pulse delay showStep increaseStep
  • 34. Arduino workshop 2018 connect clock to drum PCB add a long wire from the breadboard (dot of segment display, column 5) to the drum PCB, any input e.g. CH CH
  • 35. Arduino workshop 2018 Add 4 control buttons use the 4-pin ribbon cable A1 to A4 X
  • 36. Arduino workshop 2018 Add 3 drum LEDs use the short 3-pin ribbon cable D5 to D3 LED’s short straight leg goes into the blue line (GND) X
  • 37. Arduino workshop 2018 LED pulses modify loop: showStep(); sendPulses(); delay(analogRead(A0)); increaseStep(); pulse delay showStep increaseStep X
  • 38. Arduino workshop 2018 Add 3 outputs to drum PCB use the long 3-pin ribbon cable to BD SD OH X
  • 39. Arduino workshop 2018 play/step mode modify loop: showStep(); if (playMode()) { sendPulses(); delay(analogRead(A0)); } else { editStep(); } increaseStep(); add a wire from D2 to GND (blue line)
  • 40. Arduino workshop 2018 edit step mode with the D2 wire connected, move to next step with button 4 the LEDs show which drum is active for that step use the 3 buttons to toggle on/off
  • 41. Arduino workshop 2018 hack it :-) ● change the 3+1 output wires to different drum sounds ● use a wire connected to GND to trigger other drum sounds while the sequence is playing ● change the code to 6 steps ● replace the drum samples in the drum chip with your own samples ● build a box for this sequencer ● ...
  • 42. Arduino workshop 2018 drum chip Arduino chip (Atmega328p) Open Source code “dsp-D8” from https://janostman.wordpress.com/2016/01/03/the-dsp-d8-drumchip-source-code/ (minor modifications)
  • 43. Arduino workshop 2018 Arduino: suppliers ONLINE ➔ Official Arduino shop: http://arduino.cc/ great documentation, projects, forum ➔ Seeedstudio: http://www.seeedstudio.com/depot/ ➔ Telesky: https://telesky.world.tmall.com/ ➔ Adafruit: http://www.adafruit.com/ great documentation IN HONG KONG - Apliu St ➔ WECL http://www.weclonline.com/wecl_eng/index.html
  • 44. Arduino workshop 2018 Arduino: kits ➔ Seeedstudio Sidekick Arduino kit ➔ Arduino Starter Kit
  • 45. Arduino workshop 2018 Dimsum Labs the hackerspace of HK www.dimsumlabs.com/ community of technology enthusiasts space for creativity in Sheung Wan Tuesday evening HackJam www.facebook.com/groups/hackjamhk/
  • 46. Arduino workshop 2018Arduino workshop 2018 Thank you www.cassiopeia.hk Happy tinkering!