+353-1-416-8900REST OF WORLD
+44-20-3973-8888REST OF WORLD
1-917-300-0470EAST COAST U.S
1-800-526-8630U.S. (TOLL FREE)

Microcontroller Prototypes with Arduino and a 3D Printer. Learn, Program, Manufacture. Edition No. 1

  • Book

  • 352 Pages
  • April 2021
  • John Wiley and Sons Ltd
  • ID: 5842102
Microcontroller Prototypes with Arduino and a 3D Printer

Discover a complete treatment of microcomputer programming and application development with Arduino and 3D printers

Microcontroller Prototypes with Arduino and a 3D Printer: Learn, Program, Manufacture delivers a comprehensive guide to learning microcontrollers that’s perfectly suited to educators, researchers, and manufacturers. The book provides readers with a seasoned expert’s perspective on the process of microcomputer programming and application development. Carefully designed and written example code and explanatory figures accompany the text, helping the reader fully understand and retain the concepts described within.

The book focuses on demonstrating how to craft creative and innovative solutions in embedded systems design by providing practical and illustrative methods and examples. An accompanying website includes functioning and tested source code and learning exercises and the book relies on freeware development tools for the creation of firmware and software code, 3D printed enclosures, and debugging. It allows the reader to work with modern sensors and collect sensor data to a host PC for offline analysis.

Table of Contents

About the Author xi

List of Figures xii

List of Tables xxvi

Preface xxvii

Acknowledgments xxx

Abbreviations xxxi

Syllabus xxxv

1 The Art of Embedded Computers 1

Overview of Embedded Computers and Their Interdisciplinarity 1

Computer vs. Embedded Computer Programming and Application Development 2

Group 1: Programmable Logic Devices 3

Group 2: Reconfigurable Computers 4

Group 3: Microcomputers 4

Group 4: Single-Board Computers 6

Group 5: Mobile Computing Devices 6

TPACK Analysis Toward Teaching and Learning Microcomputers 7

TPACK Analysis of the Interdisciplinary Microcontroller Technology 7

Content Knowledge (The What) 8

Technology Knowledge (The Why) 9

Pedagogical Knowledge (The How) 11

From Computational Thinking (CT) to Micro-CT (μCT) 12

CT Requirement and Embedded Computers 13

Microcomputers and Abstraction Process 14

The μCT Concept: An Onion Learning Framework 15

“Transparent” Teaching Methods 17

The Impact of Microcontroller Technology on the Maker Industry 19

Hardware Advancement in μC Technology 20

Software Advancement in μC Technology 23

The Impact of Arduino on the μC Community 23

Where Is Creativity in Embedded Computing Devices Hidden? 26

Creativity in Mobile Computing Devices: Travel Light, Innovate Readily! 26

Communication with the Outside World: Sensors, Actuators, and Interfaces 28

Conclusion 30

2 Embedded Programming with Arduino 31

Number Representation and Special-Function Codes 31

Arduino and C Common Language Reference 34

Working with Data (Variables, Constants, and Arrays) 36

Arduino UART Interface to the Outside World (Printing Data) 39

Arduino Ex.2-1 40

Arduino Ex.2-2 44

Program Flow of Control (Arithmetic and Bitwise Operations) 47

Arduino UART Interface (Flow of Control and Arithmetic/Bitwise Examples) 52

Arduino Ex.2-3 52

Arduino Ex.2-4 53

Arduino Ex.2-5 54

Arduino Ex.2-6 59

Arduino Ex.2-7 63

Code Decomposition (Functions and Directives) 69

Arduino Ex.2-8 69

Conclusion 72

Problem 2-1 (Data Output from the μC Device: Datatypes and Bytes Reserved by the hw) 73

Problem 2-2 (Data Output from the μC Device: Logical Operators in Control Flow) 73

Problem 2-3 (Data Input to the μC Device: Arithmetic and Bitwise Operations) 73

Problem 2-4 (Code Decomposition) 73

3 Hardware Interface with the Outside World 75

Digital Pin Interface 75

Arduino Ex.3.1 76

Arduino Ex.3.2 77

Arduino Ex.3.3 81

Arduino Ex.3.4 82

Arduino Ex.3.5 84

Analog Pin Interface 86

Arduino Ex.3.6 87

Arduino Ex.3.7 91

Interrupt Pin Interface 91

Arduino Ex.3.8 94

UART Serial Interface 96

Arduino Ex.3.9 97

Arduino Ex.3.10 98

Arduino Ex.3.11 99

SPI Serial Interface 101

Arduino Ex.3.12 103

Arduino Ex.3.13 110

Arduino Ex.3.14 115

Arduino Ex.3.15 121

I2C Serial Interface 122

Arduino Ex.3.16 125

Arduino Ex.3.17 130

Arduino Ex.3.18 135

Arduino Ex.3.19 142

Conclusion 146

Problem 3.1 (Data Input and Output to/from the μC Using Push-Button and LED IO Units) 147

Problem 3.2 (PWM) 147

Problem 3.3 (UART, SPI, I2C) 147

4 Sensors and Data Acquisition 149

Environmental Measurements with Arduino Uno 149

Arduino Ex.4-1 150

DAQ Accompanying Software of the Ex.4-1 157

DAQ Accompanying Software with Graphical Monitoring Feature Via gnuplot 166

Arduino Ex.4-2 169

Orientation, Motion, and Gesture Detection with Teensy 3.2 171

Arduino Ex.4-3 173

Arduino Ex.4-4 174

Arduino Ex.4-5 177

Arduino Ex.4-6 184

DAQ Accompanying Software for Orientation, Motion, and Gesture Detection with gnuplot 191

Real Time Monitoring with Open GL 193

Distance Detection and 1D Gesture Recognition with TinyZero 200

Arduino Ex.4-7 201

Arduino Ex.4-8 205

DAQ Accompanying Software for Distance Measurements 209

Color Sensing and Wireless Monitoring with Micro:bit 211

Arduino Ex.4-9 212

Arduino Ex.4-10 216

Open GL Example Applying to RGB Sensing 220

Arduino Ex.4-11 222

Conclusion 226

Problem 4-1 (Data Acquisition of Atmospheric Pressure) 226

Problem 4-2 (Fusion of Linear Acceleration and Barometric Altitude) 226

Problem 4-3 (1D Gesture Recognition) 226

Problem 4-4 (Color Sensing) 226

5 Tinkering and Prototyping with 3D Printing Technology 227

Tinkering with a Low-cost RC Car 227

Arduino Ex.5.1 231

Arduino Ex.5.2 236

A Prototype Interactive Game for Sensory Play 237

Hardware Boards of the Prototype System 238

Assembly Process of the 3D Printed Parts of the System’s Enclosure 243

Firmware Code Design and User Instructions 249

Arduino Ex.5.3 250

Arduino Ex.5.4 253

Arduino Ex.5.5 256

Arduino Ex.5.6 260

3D Printing 262

Modeling 3D Objects with FreeCAD Software 262

Preparing the 3D Prints with Ultimaker Cura Software 269

3D Printing with Prima Creator P120 272

Presentation of the Rest 3D Models of the Prototype Interactive Game 276

PrototypeB (Modeling the battery.stl Part) 276

PrototypeC (Modeling the booster.stl Part) 278

PrototypeD (Modeling the speaker.stl Part) 283

PrototypeE (Modeling the cover.stl Part) 284

PrototypeF (Modeling the button.stl Part) 287

PrototypeG (Modeling the sensor.stl Part) 290

PrototypeH (Modeling the front.stl Part) 290

Conclusion 294

Problem 5.1 (Tinkering with a Low-cost RC Car) 294

Problem 5.2 (A Prototype Interactive Game for Sensory Play) 294

Problem 5.3 (A Prototype Interactive Game for Sensory Play) 295

Problem 5.4 (A Prototype Interactive Game for Sensory Play) 296

Problem 5.5 (3D Printing) 296

References 297

Index 301

Authors

Dimosthenis E. Bolanakis University of Ioannina, Greece.