forked from LarsSjodahl/ArduinoPythonTinkering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstructionsPythonArduinoWS_NTD.txt
74 lines (60 loc) · 3.12 KB
/
InstructionsPythonArduinoWS_NTD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
0. You are going to need a laptop which can detect an unknown USB device. If your laptop is provided by your company and it has added security about what you can plug into the USB, you might not be able to use it. If you run a virtual machine, and run the software on that, it might work, but otherwise I encourage you to join a person or group which has a laptop that works.
1. If you haven't already, install
Python3.x
with the following extra modules
tkinter
pyserial (this is used as "serial" but search for "pyserial")
matplotlib
math
time
datetime
Download the latest Arduino IDE from https://www.arduino.cc/en/Main/Software
it just requires java (JRE) to run.
When you have started the ArduinoIDE, go to the menu Sketch/"Include library"/"Manage libraries...". In the search box, enter "OneWire", and select the library from "Adafruit", which is usually the second item on the list.
2)
Your kits include:
1 Arduino, brand new
1 cable USB to USB-B
1 breadboard with tre-pin thermo sensor and 4.7kOhm pull-up resistor
1 Ultrasonic range sensor
1 9V battery connector
1 servo, with assortment of actuator arms and screws
8 connector wires, male-male
handed out separately:
9V battery
1 Big Clear LED, w red light. This can be driven directly from Arduino GPIO outputs. The long pin goes to positive and the negative to GND. Don't connect directly to "5V", though...
1 photo transistor LTR-4206E
14 of the kits also include
1 breadboard w L293D quad half-H driver (double bidirectional motor driver, but we only use "left" side), https://goo.gl/images/KKQFkw
Breadboards work like this:
https://goo.gl/images/W6Vpso
3) Agenda
*) installation
*) getting basic serial communication working, set LED from python
*) thermal sensor data into python
*) Adding servo function to existing buttons.
*) more power for driving motors. Wiring
Wiring:
Look at the link above for how breadboard is connected internally.
Thermo sensor:
The middle pin goes to pin 10 on the arduino.
The 2'nd pin that has the resistor connected, goes to 5V on the Arduino.
The last pin goes to GND on the Arduino.
Servo:
The brown wire goes to GND on Arduino.
The red wire goes to 5V on Arduino.
The last wire goes to pin 9 on Arduino.
Motor:
Do NOT plug it directly into the Arduino.
Look at the link above for how to wire motor &breadboard with the IC.
Both GND on Arduino and the blac wire on the battery holder goes to the GND on the IC.
The "Motor" outputs on the IC go to the motor. It doesnt matter with of the red and black wires goes in which.
The "Control" input on the IC go to pin 12 and 11 on the Arduino.
The arduino 5V goes to one of the pins that has a tiny wire connecting them at one end.
The Red wire from the battery holder goes to the "4-36V for controlling motor".
4) Creative Tinker time! Suggestions:
*) adding or modifying buttons.
*) adding charts w same data (scaling? average?)
More advanced:
*) try the range sensor. Send a short pulse to the "Trig" pin, and wait for the "Echo" pin to go high.
*) use a photo transistor. You will also need a resistor. Google for an image for how to wire it. You need to connect it+resistor to 5V, a sense pin on the arduino, and GND.