====== 101 - Arduino ===== {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino_matrix.jpg?nolink&600|}} This intro to Arduino uses a LED matrix to show how to connect and use existing libraries to create fun projects without too much coding and wiring. This is a redevelopment of previous Arduino LED matrix workshops, including [[workshops:trials:deskduino_v1:start|Deskduino]] and [[workshops:trials:wearables2-v3:start|Badgeduino]]. Michelle Brown and Peter Lin, September 2022. ===== Acknowledgement ===== We acknowledge Aboriginal and Torres Strait Islander peoples and their continuing connection to land and as custodians of stories for millennia. We respectfully acknowledge the land on which we all meet today, and pay our respects to elders past, present and emerging. ===== Summary ===== Participants will learn about the Arduino IDE program and connecting an Arduino Nano and a programmable 8×8 LED Matrix display. ===== Skills Introduced ===== * Overview of circuit and components * Assembling components * Using the Arduino IDE and basic coding ====== Materials ====== ==== ==== ^ Material ^ Quantity ^ Cost ^ | Arduino Nano V3.0 Board | 10 | $13.48 | | USB cable (included with Nano) | 10 | $0.00 | | MAX7219 Serial Dot Matrix Display Module | 10 | $9.05 | | Solderless Breadboard | 10 | $4.36 | | Solderless Breadboard Jumper Cable Wires (10 x 10) | 50 | $0.80 | | | Total | $27.69 | ==== ==== ===== Requirements ===== * Computer with USB A port or adaptor * Arduino IDE program installed =====Health & Safety===== Running this workshop at The Edge?.. You should familiarise yourself and your participants with: * DML Risk Assessment ====== Workshop Walk through ====== === What is a microcontroller? === A microcontroller (or MCU for microcontroller unit) is a small computer on a single integrated circuit. * one or more CPUs (processor cores) * memory * programmable input/output peripherals * can be mixed signal devices interacting with * digital signals * analogue signals === Why use an MCU? === Microcontrollers are small, low powered and robust, making them perfect for [[https://en.wikipedia.org/wiki/Embedded_system|embedded systems]] such as: * medical devices * remote controls * office machines * appliances * power tools * toys * wearable technology === What is Arduino? === Arduino is an open source computer hardware and software organisation, project, and user community (([[https://en.wikipedia.org/wiki/Arduino|https://en.wikipedia.org/wiki/Arduino]])) * The hardware is based on the Amtel 8-bit AVR MCU * The software uses the Processing IDE, with a simplified version of the Java programming language * Open source has led to the creation of a huge range of * clones * compatible devices * peripherals * A strong community means * "Someone, Somewhere has solved the problem" * we can run this workshop using and adapting existing resources. === Basic circuitry === Example diagram {{workshops:prototypes:2022-23delivery-lasercutcovers:microcontroller-tutorial-atmega32u2-circuitwith-values-1024x512.png}} ===== Step 1 ===== Downloading or checking our software is installed and up to date. We an install updates to our software on the DML (Digital Media Lab) computers, it just won't save the update when the computers are restarted. [[https://www.arduino.cc/en/software|Arduino IDE]] {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_1.png}} Open Arduino IDE, it will automatically open a blank code base document for you. {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_2.png}} Connect the Arduino Nano with the blue USB cable provided. {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_4.jpg?}} Do a Blink test by navigating to the File menu>Examples>0.1 Basics>Blink {{workshops:prototypes:2022-23delivery-lasercutcovers:3arduino101_2.png}} {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_5.png}} ===== Step 2 ===== ====Components==== **What are breadboards?** A breadboard (sometimes called a plugblock) is used for building temporary circuits. It is useful to designers because it allows components to be removed and replaced easily. {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_6.png}} **What connectors and cables do we use for basic electronics?** In this workshop we are using Solderless Breadboard Jumper Cable Wires so we don't have to do any soldering. Connecting cables, what you need to know (pins, ground etc). Let's put our kit together (explaining which cable goes where and why we need to know this for the programming) {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_7.png}} ^ Nano Pin ^ ^ ^ | TX1. | | | | RX0 | | | | RST | | | | GND | | | | D2 | | | | D3 | | | | D4 | | | | D5 | | | | D6 | | | | D7 | | | | D8 | | | | D9 | | | | D10 | CS | Load | | D11 | CLK | | | D12 | DIN | Data in | | - | - | - | | D13 | | | | 303 | | | | REF | | | | AV | | | | A1 | | | | A2 | | | | A3 | | | | A4 | | | | A5 | | | | A6 | | | | A/ | | | | 5V | VCC | 5 volts | | RST | | | | GND | GND | Ground | | VIN | | | ===== Step 3 ===== ===Downloading and adding libraries=== For this we need LedControl library, so let's learn how to add a library. {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_8.png}} Install LedControl Library {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_9.png}} and can use the example "LCDemoMatrix.ino" to test our devices are working {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_10.png}} Run Example Code {{workshops:prototypes:2022-23delivery-lasercutcovers:arduino101_11.png}} This should have our matrix working! If not, let's troubleshoot. If you did get it working, try some of the other example library code. ====== References ====== [[https://xantorohara.github.io/led-matrix-editor/]] ===== Downloads ===== [[https://www.arduino.cc/en/software]] ===== Additional Learning ===== Take a look at our [[https://wiki.slq.qld.gov.au/doku.php?id=workshops:prototypes:intro_to_coding_for_physical_computing-arduinoide|Arduino 101 - Coding workshop]]