Things used in this project

Hardware components:
Chip%20v1
C.H.I.P.
×1
DC motor (generic)
×1
Omron b3f 1000 image 75px
SparkFun Pushbutton switch 12mm
×1
09590 01
LED (generic)
×1
Fairchild semiconductor fqu13n06ltu image 75px
Power MOSFET N-Channel
I used an IRF510
×1
Fairchild semiconductor pn2222abu. image
General Purpose Transistor NPN
I used an 2N3904
×1
Mfr 25fbf52 4k75 sml
Resistor 4.75k ohm
×2
12002 04
Breadboard (generic)
×1
Male/Male Jumper Wires
Some wires...
×10

Schematics

The Circuit Diagram
Wire it up carefully.
Circuit diagram.jpg

Code

MotorOnSw.pyPython
Press the button to switch the motor and LED on.

You need to install the AdaFruit C.H.I.P. GPIO library first of all. See here for instructions, usage guides and tips and other stuff: https://bbs.nextthing.co/t/adafruit-gpio-library-for-chip/2696
#!/usr/bin/python
#
# Nick Pettefar - 14th July 2016
#
import CHIP_IO.GPIO as GPIO
from time import sleep
#
delay=0.01
Motor = "XIO-P2"
LED = "XIO-P4"
Switch = "XIO-P0"
GPIO.setup(Motor, GPIO.OUT)
GPIO.setup(LED, GPIO.OUT)
GPIO.setup(Switch, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#
GPIO.output(Motor, GPIO.LOW)
GPIO.output(LED, GPIO.LOW)

try:
    while True:
        while GPIO.input(Switch)==1:
            sleep(delay)
        GPIO.output(Motor, GPIO.HIGH)
        GPIO.output(LED, GPIO.HIGH)
        sleep(delay)
        GPIO.output(Motor, GPIO.LOW)
        GPIO.output(LED, GPIO.LOW)

except KeyboardInterrupt:
    GPIO.output(Motor, GPIO.LOW)
    GPIO.output(LED, GPIO.LOW)

Credits

Nick head
Nick Pettefar

Unix biker Radio Ham bad Ukulele player.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Third Eye for The Blind
Intermediate
  • 673
  • 10

Full instructions

An innovative wearable technology for visually impaired peoples.

Roomba Dashboard - A CLI Dashboard for iRobot Create 2
Intermediate
  • 172
  • 1

Roomba-Dash is a CLI dashboard for the iRobot Create 2 platform written in Golang. It is cross-platform compatible.

FAM
Intermediate
  • 1,350
  • 7

Work in progress

Super Secret Messaging with PocketCHIP!

Push for Pizza Using Proximus Public LoRaWAN Connectivity
Intermediate
  • 147
  • 0

A simple push button using Proximus public LPWAN connectivity. Optimized for power consumption (<30 microAmps) and long distance (>15km!).

C.H.I.P.py Ruxpin ʕ•ᴥ•ʔ
Intermediate
  • 47,302
  • 73

Full instructions

Bring Teddy Ruxpin back to life, but on your own terms! Make him say whatever you want, or have him search twitter to read tweets!

Otto DIY +
Intermediate
  • 7,819
  • 50

Work in progress

"Otto DIY with steroids" + Bluetooth + APP + switch + sensors + strength +...

Otto DIY +

Team Otto builders

Add projectSign up / Login