Jason Morton
Created April 12, 2023

Project 09: Motorized Pinwheel

Jason Morton UCF-Spring 2023-DIG3602C-Davis Project #9”

Showcase (no instructions)3
Project 09: Motorized Pinwheel

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
PTS 645 Series Switch
C&K Switches PTS 645 Series Switch
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×9
9V battery (generic)
9V battery (generic)
×1
9V Battery Clip
9V Battery Clip
×1
DC motor (generic)
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
Power MOSFET N-Channel
Power MOSFET N-Channel
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Illustration Project 09

Project 09 Schematic

Code

Project 9 Code

C/C++
/*
  Arduino Starter Kit example
  Project 9 - Motorized Pinwheel


  This sketch is written to accompany Project 9 in the Arduino Starter Kit


  Parts required:
  - 10 kilohm resistor
  - pushbutton
  - motor
  - 9V battery
  - IRF520 MOSFET
  - 1N4007 diode


  created 13 Sep 2012
  by Scott Fitzgerald


  https://store.arduino.cc/genuino-starter-kit


  This example code is part of the public domain.
*/


// named constants for the switch and motor pins
const int switchPin = 2;  // the number of the switch pin
const int motorPin = 9;   // the number of the motor pin


int switchState = 0;  // variable for reading the switch's status


void setup() {
  // initialize the motor pin as an output:
  pinMode(motorPin, OUTPUT);
  // initialize the switch pin as an input:
  pinMode(switchPin, INPUT);
}


void loop() {
  // read the state of the switch value:
  switchState = digitalRead(switchPin);


  // check if the switch is pressed.
  if (switchState == HIGH) {
    // turn motor on:
    digitalWrite(motorPin, HIGH);
  } else {
    // turn motor off:
    digitalWrite(motorPin, LOW);
  }
}

Credits

Jason Morton
13 projects • 0 followers

Comments