Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
wiki:tcb:tcbinstall:io_ports_ab [2016/05/08 20:45] opadmin [Using an I/O Port as an Input] |
wiki:tcb:tcbinstall:io_ports_ab [2017/07/24 02:31] opadmin [Using an I/O Port as Output] |
||
---|---|---|---|
Line 14: | Line 14: | ||
Each I/O port is given three pins on the TCB board - the signal pin, +5 volts, and Ground. See the schematic below for how to wire an input switch or potentiometer. | Each I/O port is given three pins on the TCB board - the signal pin, +5 volts, and Ground. See the schematic below for how to wire an input switch or potentiometer. | ||
- | It is also possible to attach sensors to an analog input so long as they provide a signal that ranges from Ground to 5 volts. | + | It is also possible to attach sensors to an analog input so long as they provide a signal that ranges from Ground to 5 volts. |
**Note:** The digital input is considered On when the signal pin held to ground. In the schematic below, that will occur when the switch is closed. | **Note:** The digital input is considered On when the signal pin held to ground. In the schematic below, that will occur when the switch is closed. | ||
{{ wiki: | {{ wiki: | ||
+ | \\ | ||
{{ wiki: | {{ wiki: | ||
< | < | ||
+ | \\ | ||
{{ wiki: | {{ wiki: | ||
- | < | + | < |
+ | \\ | ||
===== Using an I/O Port as Output ===== | ===== Using an I/O Port as Output ===== | ||
- | When an I/O port is set to output, | + | When an I/O port is set to output, |
+ | |||
+ | If you wish to connect the output to another microcontroller (such as another Arduino) you can do so directly - just connect the signal pin of the I/O port to the input pin of your other controller, and also make sure both the TCB and the other controller share a ground connection. | ||
However keep in mind these outputs are only rated at 20mA each. That means they will almost surely be inadequate for driving lights, relays or other devices. For that you will need to add an external transistor or MOSFET circuit. A simple 2n2222 transistor circuit will work and there are many schematics on the internet. Or see the [[wiki: | However keep in mind these outputs are only rated at 20mA each. That means they will almost surely be inadequate for driving lights, relays or other devices. For that you will need to add an external transistor or MOSFET circuit. A simple 2n2222 transistor circuit will work and there are many schematics on the internet. Or see the [[wiki: | ||
- | There are also various logic-level modules available on eBay that can interface directly with the TCB using a male-to-male servo cable. But be careful when choosing them, because many use a different pinout than the TCB! They can still be used, but you will need to swap the pins on your servo cable. The order on the TCB is Ground/ | + | There are also various logic-level modules available on eBay that can interface directly with the TCB using a male-to-male servo cable. But be careful when choosing them, because many use a different pinout than the TCB! They can still be used, but you will need to swap the pins on your servo cable. The order on the TCB is Ground/ |
==== Relay Modules ==== | ==== Relay Modules ==== | ||
Line 40: | Line 46: | ||
{{ wiki: | {{ wiki: | ||
< | < | ||
+ | \\ | ||
{{ wiki: | {{ wiki: | ||
< | < | ||
+ | \\ | ||
- | {{ wiki:ebay_relay_tcb.jpg? | + | {{ wiki:relay_tcb.jpg? |
- | < | + | < |
+ | \\ | ||
==== Buzzer Module ==== | ==== Buzzer Module ==== | ||
The [[http:// | The [[http:// |