Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Interface
board
0.3
General Interface to
Lego NXT Motors & Sensors
Gary L Fernandes
Seattle University
Lego Interface Breadboard (LIB)
Revision History
Revision
Date
Rev 0.1
2/11/2001
Rev 0.2
2/23/2011
Rev 0.3
3/11/2011
Description
Created:
Updated everything.
Updated Altera Expansion Header info, Cleaned up everything.
Person
Gary L Fernandes, fernandg@seattleu.edu
Gary
Gary
WARNING
Vc must be > 6 < 9.5 Vdc
Set proper power supply voltage BEFORE connecting the Lego Interface
Board.
To avoid damage to Lego products to not change or disturb circuits or
operate without proper instruction, supervision, or EE knowhow.
If a wire or component has come loose please have a supervisor repair
before connecting power.
Robot Applications
Example Youtube Robot Apps
Vc
GND
6 - 9.5VDC
Header1
Use this
Signal
Name
FPGA Pin
No.
Header1
Pin No.
Signal
Type
Input
Output
Bi
Signal Name
Description
GPIO_1[0]
PIN_K25
Input
1,2EN
Motor Driver
See Motor Driver Function Table
GPIO_1[2]
PIN_M22
Input
1A
GPIO_1[4]
PIN_M19
Input
2A
GPIO_1[6]
PIN_N20
Input
3,4EN
GPIO_1[8]
PIN_M24
Input
3A
11
VCC5
11
N.C.
13
GPIO_1[10] PIN_N24
13
Input
4A
15
GPIO_1[12] PIN_R25
15
17
GPIO_1[14] PIN_R20
17
19
GPIO_1[16] PIN_T23
19
21
GPIO_1[18] PIN_T25
21
23
GPIO_1[20] PIN_T21
23
25
GPIO_1[22] PIN_U26
25
27
GPIO_1[24] PIN_U23
27
29
VCC33
29
31
GPIO_1[26] PIN_R19
31
N.C.
TACHOA0
33
GPIO_1[28] PIN_U20
33
N.C.
TACHOA1
35
GPIO_1[30] PIN_V26
35
N.C.
TACHOA2
37
GPIO_1[32] PIN_V24
37
N.C.
TACHOA3
39
GPIO_1[34] PIN_W25
39
GPIO_1[1]
PIN_K26
Output
SDETECT
GPIO_1[3]
PIN_M23
Output
DEBSDETECT
GPIO_1[5]
PIN_M20
Input
DIGICI0
Light Sensor
Input to Lego Light Sensor.
HIGH = Enable Lego Light Sensor.
LOW = Disable Lego Light Sensor.
GPIO_1[7]
PIN_M21
Output
LDETECT
Light Sensor
Debounced Signal.
When reflected light is detected LDETECT
goes LOW. Normal HIGH.
Sensitivity is adjustable by POT.
10
GPIO_1[9]
PIN_M25
N.C
N.C.
ADC_C0
12
GND
--
12
GND
GND
Digital GND
14
GPIO_1[11] PIN_P24
14
Output
TOUCHSEN1
Touch Sensor 1
Non-debounced Signal.
HIGH = Sensor Switch Open. LOW =
Sensor Switch Closed.
16
GPIO_1[13] PIN_R24
16
Output
18
GPIO_1[15] PIN_T22
18
Output
TOUCHSEN2
20
GPIO_1[17] PIN_T24
20
Output
22
GPIO_1[19] PIN_T18
22
Touch Sensor 2
Non-debounced Signal.
HIGH = Sensor Switch Open. LOW =
Sensor Switch Closed.
GPIO_1[21] PIN_T20
24
26
GPIO_1[23] PIN_U25
26
28
GPIO_1[25] PIN_U24
28
30
GND
30
32
GPIO_1[27] PIN_T19
32
34
GPIO_1[29] PIN_U21
34
36
GPIO_1[31] PIN_V25
36
38
GPIO_1[33] PIN_V23
38
40
GPIO_1[35] PIN_W23
40
--
Input
BUZZ1
Piezo Speaker
Signal BUZZ1 is connected to a terminal 1
on a piezo element. Terminal 2 is tied to
Vc.
GND
GND
Digital GND
Name of Code/Tutorial
Download Link
http://www.seattleu.edu/scieng/ece/projects.html
http://www.seattleu.edu/scieng/ece/projects.html
http://www.seattleu.edu/scieng/ece/projects.html
http://www.seattleu.edu/scieng/ece/projects.html
http://www.seattleu.edu/scieng/ece/projects.html
Name of Code/Tutorial
Download Link
http://www.seattleu.edu/scieng/ece/projects.html
Input
1,2EN
0
1
1
1
1
1
1
1
1
Header1
Pin No.
Signal
Type
7
Input
9
Input
13
3,4EN
Datasheet http://focus.ti.com/lit/ds/symlink/sn754410.pdf
MOTOR 1 CONTROL
SN754410 SN754410 PIN FUNCTION
PIN NAME
Pin No.
1,2EN
1
ENABLE MOTOR DRIVER OUTPUTS 1 & 2
1A
2
INPUT 1
1Y
3
DC MOTOR OUTPUT 1
2A
7
INPUT 2
2Y
6
DC MOTOR OUTPUT 2
Breadboard motor driver circuit includes 10K pulldown resistor on all SN754410 inputs
Input
MOTOR 2 CONTROL
SN754410 SN754410 PIN FUNCTION
PIN NAME
Pin No.
3,4EN
9
ENABLE MOTOR DRIVER OUTPUTS 3 & 4
3A
10
INPUT 3
3Y
11
DC MOTOR OUTPUT 3
4A
15
INPUT 4
4Y
14
DC MOTOR OUTPUT 4
Breadboard motor driver circuit includes 10K pulldown resistor on all SN754410 inputs
INPUTS
3A
4A
MOTOR FUNCTION
SN754410 SIGNAL
OFF = OPEN
ON = CLOSED
1,2EN
1A
2A
3,4EN
3A
4A
LOW
10K Pulldown
LOW
10K Pulldown
LOW
10K Pulldown
LOW
10K Pulldown
LOW
10K Pulldown
LOW
10K Pulldown
HIGH
1K Pullup
HIGH
1K Pullup
HIGH
1K Pullup
HIGH
1K Pullup
HIGH
1K Pullup
HIGH
1K Pullup
Note
LOW = DISABLE MODE,
HIGH = ENABLE DEVICE
Figure 2a
Figure 2b
Figure 2c
The duty cycle is defined as the percentage of digital high to digital low signals present during a PWM period.
Common modulating frequencies range from 1 kHz to 200 kHz with real motor drivers.
Header1
Header1
Pin No.
Signal
Type
LM324
Signal Name
LM324
Pin No.
Description
Note
Input
Output
Bi
Output
SDETECT
Output
DEBSDETECT
Comparator
Output,
Normal LOW
Comparator
Output,
Normal LOW
Header1
Header1
Pin No.
Signal
Type
TS Signal Name
74HC14 Pin
No.
Description
Note
Direct from
Sensor
Non-debounced Signal.
HIGH = Sensor Switch Open.
LOW = Sensor Switch Closed.
10K Pullup
Debounced Signal.
LOW = Sensor Switch Open.
HIGH = Sensor Switch Closed.
Schmitt Inverter
Output.
Normal LOW
Input
Output
Bi
14
Output
TOUCHSEN1
16
Output
DEBTOUCHSEN1
Signal
Type
TS Signal Name
74HC14 Pin
No.
Description
Note
Direct from
Sensor
Non-debounced Signal.
HIGH = Sensor Switch Open.
LOW = Sensor Switch Closed.
10K Pullup
Debounced Signal.
LOW = Sensor Switch Open.
HIGH = Sensor Switch Closed.
Schmitt Inverter
Output.
Normal LOW
Input
Output
Bi
18
Output
TOUCHSEN2
20
Output
DEBTOUCHSEN2
Switch Pressed & Released: No Capacitor C1: Yellow = TOUCHSENx, Green = DEBTOUCHSENx
Header1
Light Sensor
Circuit consists of a LM324 comparator to convert the Lego light sensors analog signal to digital bit
Header1
Pin No.
Signal
Type
Signal
Name
Description
Note
Input
Output
Bi
Input
DIGICI0
10K Pulldown
Output
LDETECT
Debounced Signal.
When reflected light is detected LDETECT goes LOW.
Normal HIGH.
Sensitivity is adjustable by POT2. You may need to adjust
POT2 for different colors and glossy-flat finishes.
LED 2 is ON when light has crossed threshold
Output from
Comparator
INPUTS
DIGICI0
LOW
HIGH
HIGH
OUTPUT
LDETECT
HIGH
HIGH
LOW
Header1
Header1
Pin No.
Piezo Speaker
Signal
Type
Signal
Name
Description
BUZZ1
LIB Note
Input
Output
Bi
26
Input
Continued below
8. Robot Applications
Controlled by breadboard
microcontroller or Altera
Board.