Difference between revisions of "Introduction to Physical Computing"

From air
Jump to navigation Jump to search
 
(61 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Presentations ==
 
== Presentations ==
 
 
The aim of thees courses and practical sessions is to offer to students a theoretical and practical overview of
+
The aim of these courses/practical sessions is to offer to students a practical overview of
Physical Computing domain. By Physical Computing we means the building of little systems, usually interactive, composed of sensors (like button), actuator (like led and motors) which are linked by microcontroller. Finally this latter can eventually by connected to computer.
+
Physical Computing domain. By Physical Computing we means the building of little systems, usually interactives, composed of sensors (like button), actuator (like led and motors) which are linked by microcontroller (a little computer). Finally this latter can eventually by connected to computer.
  +
  +
'''Your report must be sent to <span style="color:red">nicolas.palix _at_ imag.fr</span> or <span style="color:red">olivier.richard _at_ imag.fr</span> '''
   
 
== Date and location ==
 
== Date and location ==
  +
  +
'''Location : [http://www.polytech-grenoble.fr/ Polytech'Grenoble]'''
   
   
 
{|class="wikitable alternance"
 
{|class="wikitable alternance"
|+ Date and Location
+
|+ Date and Room
 
|-
 
|-
 
|
 
|
 
!scope="col"| Date
 
!scope="col"| Date
!scope="col"| Location
+
!scope="col"| Room
   
 
|-
 
|-
 
!scope="row"| 1
 
!scope="row"| 1
| 5 June, 14:00-16:00
+
| 6 June, 09:30-11:30
| P048
+
| POLYTECH
 
|-
 
!scope="row"| 2
 
| 13 June, 13h30-16:30
 
| P048
 
 
|-
 
!scope="row"| 3
 
| 14 June, 14:00-17:00
 
| P048
 
 
|-
 
!scope="row"| 4
 
| 20 June, 13:30-17:30
 
| P048
 
 
|-
 
!scope="row"| 5
 
| 25 June, 8:00-12:00
 
| P048
 
   
 
|}
 
|}
Line 44: Line 28:
 
Students will be '''evaluated''' on the basis of '''reports written from material/experiments/coding elaborated during practical sessions'''.
 
Students will be '''evaluated''' on the basis of '''reports written from material/experiments/coding elaborated during practical sessions'''.
   
'''Questions which must be addressed in your report is prefixed below, by:''' <span style="color:red">'''In your report'''</span>.
+
'''Questions which must be addressed in your report are prefixed below, by:''' <span style="color:red">'''In your report'''</span>.
   
   
The reports must describe your realisations and experiments. You can adapt and modify circuits and codes to show your creativity or possible enhancements. When a circuit is operational '''give a demonstration to the teacher'''.
+
The report must describe your realisations and experiments. You can adapt and modify circuits and codes to show your creativity or possible enhancements. When a circuit is operational '''give a demonstration to the teacher'''.
 
In your report, for each built circuit present the '''schematic and code''' (you can omit some part of code if you give appropriate indication) with '''explanation'''. In report, always indicate your modification, circuit and code enhancements and your sources of information if any.
 
In your report, for each built circuit present the '''schematic and code''' (you can omit some part of code if you give appropriate indication) with '''explanation'''. In report, always indicate your modification, circuit and code enhancements and your sources of information if any.
   
Line 54: Line 38:
   
 
See also, translated wiki page [http://service.aximag.fr/xwiki/bin/view/imag/airimagfr?&ie=UTF8&rurl=translate.google.com&sl=fr&tl=en&u=http://air.imag.fr/mediawiki/index.php/Travaux_Pratiques_Arduino&usg=ALkJrhjKN56k2JkGDw9HQa8wLvqdfbEiY praticals with arduino]
 
See also, translated wiki page [http://service.aximag.fr/xwiki/bin/view/imag/airimagfr?&ie=UTF8&rurl=translate.google.com&sl=fr&tl=en&u=http://air.imag.fr/mediawiki/index.php/Travaux_Pratiques_Arduino&usg=ALkJrhjKN56k2JkGDw9HQa8wLvqdfbEiY praticals with arduino]
  +
  +
== Useful Links ==
  +
  +
* [http://arduino.cc/en/Reference/HomePage Arduino Language Reference]
  +
  +
* [https://dlnmh9ip6v2uc.cloudfront.net/learn/materials/8/Arduino_Cheat_Sheet.pdf Arduino Cheat Sheet]
   
 
== Level 1 : Basics ''(courses 1 and 2)'' ==
 
== Level 1 : Basics ''(courses 1 and 2)'' ==
The minimal circuits to realise are '''Blinking on board LED, Blinking external LED, Music , Push Button, Potentiometer and PushButton/Music'''.
+
The minimal circuits to realize are '''Blinking on board LED, Blinking external LED, Music , Push Button, Potentiometer and PushButton/Music'''.
   
 
# Blinking on board LED: use Files/Examples/Basics/Blink in Arduino IDE
 
# Blinking on board LED: use Files/Examples/Basics/Blink in Arduino IDE
# Blinking external LED: [http://ardx.org/CIRC01 explanations, code and Schematic]
+
# Blinking external LED: [http://www.oomlout.com/oom.php/products/ardx/circ-01 explanations, code and Schematic]
# Music with Piezo or Speaker: [http://ardx.org/CIRC06 explanations, code and Schematic]
+
# Music with Piezo or Speaker: [http://www.oomlout.com/oom.php/products/ardx/circ-06 explanations, code and Schematic]
 
# Push Button: [http://www.arduino.cc/en/Tutorial/Button explanations, code and Schematic]. Code is also in Arduino IDE (Files/Examples/Digital/Button). '''Pull Up / Pull Down Resistor'''
 
# Push Button: [http://www.arduino.cc/en/Tutorial/Button explanations, code and Schematic]. Code is also in Arduino IDE (Files/Examples/Digital/Button). '''Pull Up / Pull Down Resistor'''
# Multiple LEDs: [http://ardx.org/CIRC02 explanations, code and Schematic]
+
# Multiple LEDs: [http://www.oomlout.com/oom.php/products/ardx/circ-02 explanations, code and Schematic] '''(optional)'''
# Potentiometer (variable resistor): [http://ardx.org/CIRC08 explanations, code and Schematic]
+
# Potentiometer (variable resistor): [http://www.oomlout.com/oom.php/products/ardx/circ-08 explanations, code and Schematic]
 
# <span style="color:red">'''In your report:'''</span> ''' Create a circuit which plays a music or one note when you push the button and a another music when you release it.
 
# <span style="color:red">'''In your report:'''</span> ''' Create a circuit which plays a music or one note when you push the button and a another music when you release it.
   
== Level 2 : Medium ''(courses 2 and 3)'' ==
+
== Level 2 : Medium ''(courses 3 and 4)'' ==
  +
# '''Serial Communication''', basic Communications and use of serial monitor: See '''Serial.begin, Serial.print, Serial.println''' from reference documentation (IDE or [http://arduino.cc/en/Reference/Serial Arduino's site]).
'''to be completed'''
 
 
# DigitalReadSerial - read a switch, print the state out to the Serial Monitor [http://www.arduino.cc/en/Tutorial/DigitalReadSerial explanations, code and Schematic]
 
# <span style="color:red">'''In your report:'''</span> '''Experimenting and explain Bidirectional Communication with PC''' (write a simple or find in IDE's example, a simple program to demonstrate bidirectional communication with Serial Monitor).
 
# Demonstrates the use of analog output to fade an LED. [http://arduino.cc/en/Tutorial/Fade explanations, code and Schematic]. '''PWM'''
 
# Demonstrates the use of analog output to fade an LED. [http://arduino.cc/en/Tutorial/Fade explanations, code and Schematic]. '''PWM'''
 
# Servormotor: [http://ardx.org/CIRC04 explanations, code and Schematic]
 
# Servormotor: [http://ardx.org/CIRC04 explanations, code and Schematic]
# <span style="color:red">'''In your report:'''</span> '''Build a circuit with potentiometer and servomotor where the angular position of servomotor is controlled by the potentiometer.
+
# <span style="color:red">'''In your report:'''</span> '''Build a circuit with potentiometer and servomotor where the angular position of servomotor is controlled by the potentiometer.
# DigitalReadSerial - read a switch, print the state out to the Serial Monitor [http://www.arduino.cc/en/Tutorial/DigitalReadSerial explanations, code and Schematic] '''Serial Communication'''
 
 
# <span style="color:red">'''In your report:'''</span> '''Build a circuit with a servomotor which is controlled by value send via Serial Monitor'''
 
# <span style="color:red">'''In your report:'''</span> '''Build a circuit with a servomotor which is controlled by value send via Serial Monitor'''
  +
Note: If you send character '''0''', Arduino will receive '''48''' as byte accordingly to [http://en.wikipedia.org/wiki/ASCII ASCII table].
# <span style="color:red">'''In your report:'''</span> '''Experimenting and explain Bidirectional Communication with PC''' (write a simple or find a simple program to demonstrate communication with Serial Monitor).
 
  +
# Debouncing Push Button (see in IDE Example/Digital/Debounce)
# Introduction to [http://processing.org/ Processing] environment
 
 
# Use Nokia LCD 5510 ('''optional'''):
# Experiment communication between Arduino and Processing Program with [http://arduino.cc/en/Tutorial/Graph explanations, code and Schematic] (program is also in File/Examples/Communication/Graph directory)
 
  +
* [https://www.sparkfun.com/products/10168 https://www.sparkfun.com/products/10168]
# Debouncing Push Button
 
  +
* [http://playground.arduino.cc/Code/PCD8544 http://playground.arduino.cc/Code/PCD8544]
# Nokia LCD (''optionnal ...'')
 
 
# Introduction to [http://processing.org/ Processing] environment ('''optional''')
# Servermotor controlled by Wii Nunchuk (''optionnal'')
 
 
# Experiment communication between Arduino and Processing Program with [http://arduino.cc/en/Tutorial/Graph explanations, code and Schematic] (program is also in File/Examples/Communication/Graph directory) ('''optional''')
# Matrice Keyboard (''optionnal'')
 
 
# Servomotor controlled by Wii Nunchuk ('''optional''')
 
# Matrix Keyboard ('''optional''')
   
== Level 3 : Advanced ''(courses 3 and 4)''==
+
== Level 3 : Advanced ''(courses 4 and 5)''==
   
 
# Use of [[133696_HC-SR04_Ultrasonic_Sensor_Distance_Measuring_Module | HC-SR04 Ultrasonic Sensor Distance Measuring Module]] (test the simple example)
# Use interruption (see '''Help/Reference/AttachInterrupt''')
 
  +
# '''Control DC motor with H-Bridge (integrated circuit L293D or L298N)'''
# Play with [[133696_HC-SR04_Ultrasonic_Sensor_Distance_Measuring_Module | HC-SR04 Ultrasonic Sensor Distance Measuring Module]]
 
  +
# L298N http://www.robotshop.com/eu/fr/controleur-deux-moteurs-dc-l298.html
# Wireless Communication: Bluetooth or Zigbee ('''not addressed''')
 
  +
* [http://itp.nyu.edu/physcomp/Labs/DCMotorControl http://itp.nyu.edu/physcomp/Labs/DCMotorControl]
  +
* In a first step connect H-bridge to DC motor without arduino board (use only GND and +5V from Arduino Board) to test IC alone.
  +
* In a second step connect and program Arduino board to control DC motor.
  +
<span style="color:red">'''In your report:'''</span> ''' Give arduino's program which controls DC motor with commands sent from serial monitor.
   
 
'''For the report choose between the 2 following alternatives:'''
 
'''For the report choose between the 2 following alternatives:'''
   
=== Choice 1 ===
+
=== Choice 1 ===
# <span style="color:red">'''In your report:'''</span> ''' Use interruption in the circuit which plays a music when you push the button and a another music when you release it.
 
 
=== Choice 2 ===
 
 
# <span style="color:red">'''In your report:'''</span> ''' Use ultrasonic sensor to play note which its tone is fixed by distance given by sensor.
 
# <span style="color:red">'''In your report:'''</span> ''' Use ultrasonic sensor to play note which its tone is fixed by distance given by sensor.
   
 
=== Choice 2 ===
== Level 4 : Final ''(course 4 and 5)'' ==
 
  +
# Need interrupt (see '''Help/Reference/AttachInterrupt''')
  +
'''Note: for Arduino Leonardo Board the interrupt 0 is on pin 3'''
 
# <span style="color:red">'''In your report:'''</span> ''' Use interrupt in the circuit which plays a music when you push the button and a another music when you release it.
  +
 
# Wireless Communication: Bluetooth or Zigbee ('''not addressed''')
  +
 
== Level 4 : Advanced ''(course 5 and 6)'' ==
  +
  +
# <span style="color:red">'''In your report:'''</span> Debouncing Push Button
  +
- First create a program which counts the number of pushes on a button. Observe that the obtained number is false.
  +
  +
- Second have a look to IDE Example/Digital/Debounce and adapt the previous program
  +
 
# Use interrupt (see '''Help/Reference/AttachInterrupt''')
  +
'''Note: for Arduino Leonardo Board the interrupt 0 is on pin 3'''
   
 
<span style="color:red">'''In your report:'''</span> '''Address one project among those below:'''
 
<span style="color:red">'''In your report:'''</span> '''Address one project among those below:'''
   
# Develop a simple game with Nokia LCD and push buttons.
+
# Develop a simple game with Nokia LCD 5510 (see above level 3) and push buttons.
 
# [http://en.wikipedia.org/wiki/Simon_%28game%29 Simon game] with your personal modification.
 
# [http://en.wikipedia.org/wiki/Simon_%28game%29 Simon game] with your personal modification.
# [http://en.wikipedia.org/wiki/Pong Pong Game] with arduino + 2 potentiometers + processing + sound
+
# [http://en.wikipedia.org/wiki/Pong Pong Game] with arduino + 2 potentiometers + sound and processing or Nokia LCD 5510
# Develop program or game which use [[Afficheur_TM1638 |TM1638 display ]] (This display has 8x push buttons, 8x LED and 8x7-segments)
+
# Develop program or game which use [http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD_KeyPad_Shield_%28SKU:_DFR0009%29 LCD Keypad Shield] or [[Afficheur_TM1638 |TM1638 display ]] (This display has 8x push buttons, 8x LED and 8x7-segments) !!!
# Create our own project !!!
 
   
 
== Link ==
 
== Link ==

Latest revision as of 15:32, 14 February 2019

Presentations

The aim of these courses/practical sessions is to offer to students a practical overview of Physical Computing domain. By Physical Computing we means the building of little systems, usually interactives, composed of sensors (like button), actuator (like led and motors) which are linked by microcontroller (a little computer). Finally this latter can eventually by connected to computer.

Your report must be sent to nicolas.palix _at_ imag.fr or olivier.richard _at_ imag.fr

Date and location

Location : Polytech'Grenoble


Date and Room
Date Room
1 6 June, 09:30-11:30 POLYTECH

Examination

Students will be evaluated on the basis of reports written from material/experiments/coding elaborated during practical sessions.

Questions which must be addressed in your report are prefixed below, by: In your report.


The report must describe your realisations and experiments. You can adapt and modify circuits and codes to show your creativity or possible enhancements. When a circuit is operational give a demonstration to the teacher. In your report, for each built circuit present the schematic and code (you can omit some part of code if you give appropriate indication) with explanation. In report, always indicate your modification, circuit and code enhancements and your sources of information if any.

Practical materials

Circuits will be built with Arduino board as main component. Arduino IDE will be used to edit, compile program and to upload the compiled program on Arduino board (also referred as flashing the board).

See also, translated wiki page praticals with arduino

Useful Links

Level 1 : Basics (courses 1 and 2)

The minimal circuits to realize are Blinking on board LED, Blinking external LED, Music , Push Button, Potentiometer and PushButton/Music.

  1. Blinking on board LED: use Files/Examples/Basics/Blink in Arduino IDE
  2. Blinking external LED: explanations, code and Schematic
  3. Music with Piezo or Speaker: explanations, code and Schematic
  4. Push Button: explanations, code and Schematic. Code is also in Arduino IDE (Files/Examples/Digital/Button). Pull Up / Pull Down Resistor
  5. Multiple LEDs: explanations, code and Schematic (optional)
  6. Potentiometer (variable resistor): explanations, code and Schematic
  7. In your report: Create a circuit which plays a music or one note when you push the button and a another music when you release it.

Level 2 : Medium (courses 3 and 4)

  1. Serial Communication, basic Communications and use of serial monitor: See Serial.begin, Serial.print, Serial.println from reference documentation (IDE or Arduino's site).
  2. DigitalReadSerial - read a switch, print the state out to the Serial Monitor explanations, code and Schematic
  3. In your report: Experimenting and explain Bidirectional Communication with PC (write a simple or find in IDE's example, a simple program to demonstrate bidirectional communication with Serial Monitor).
  4. Demonstrates the use of analog output to fade an LED. explanations, code and Schematic. PWM
  5. Servormotor: explanations, code and Schematic
  6. In your report: Build a circuit with potentiometer and servomotor where the angular position of servomotor is controlled by the potentiometer.
  7. In your report: Build a circuit with a servomotor which is controlled by value send via Serial Monitor

Note: If you send character 0, Arduino will receive 48 as byte accordingly to ASCII table.

  1. Debouncing Push Button (see in IDE Example/Digital/Debounce)
  2. Use Nokia LCD 5510 (optional):
  1. Introduction to Processing environment (optional)
  2. Experiment communication between Arduino and Processing Program with explanations, code and Schematic (program is also in File/Examples/Communication/Graph directory) (optional)
  3. Servomotor controlled by Wii Nunchuk (optional)
  4. Matrix Keyboard (optional)

Level 3 : Advanced (courses 4 and 5)

  1. Use of HC-SR04 Ultrasonic Sensor Distance Measuring Module (test the simple example)
  2. Control DC motor with H-Bridge (integrated circuit L293D or L298N)
  3. L298N http://www.robotshop.com/eu/fr/controleur-deux-moteurs-dc-l298.html
  • http://itp.nyu.edu/physcomp/Labs/DCMotorControl
  • In a first step connect H-bridge to DC motor without arduino board (use only GND and +5V from Arduino Board) to test IC alone.
  • In a second step connect and program Arduino board to control DC motor.

In your report: Give arduino's program which controls DC motor with commands sent from serial monitor.

For the report choose between the 2 following alternatives:

Choice 1

  1. In your report: Use ultrasonic sensor to play note which its tone is fixed by distance given by sensor.

Choice 2

  1. Need interrupt (see Help/Reference/AttachInterrupt)

Note: for Arduino Leonardo Board the interrupt 0 is on pin 3

  1. In your report: Use interrupt in the circuit which plays a music when you push the button and a another music when you release it.
  1. Wireless Communication: Bluetooth or Zigbee (not addressed)

Level 4 : Advanced (course 5 and 6)

  1. In your report: Debouncing Push Button

- First create a program which counts the number of pushes on a button. Observe that the obtained number is false.

- Second have a look to IDE Example/Digital/Debounce and adapt the previous program

  1. Use interrupt (see Help/Reference/AttachInterrupt)

Note: for Arduino Leonardo Board the interrupt 0 is on pin 3

In your report: Address one project among those below:

  1. Develop a simple game with Nokia LCD 5510 (see above level 3) and push buttons.
  2. Simon game with your personal modification.
  3. Pong Game with arduino + 2 potentiometers + sound and processing or Nokia LCD 5510
  4. Develop program or game which use LCD Keypad Shield or TM1638 display (This display has 8x push buttons, 8x LED and 8x7-segments) !!!

Link

Translated wiki pages praticals with arduino