This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
oak:tutorials:serial_through_arduino [2017/01/12 18:34] Rover#18 minor clarifying edits |
oak:tutorials:serial_through_arduino [2018/01/06 20:57] pfeerick ammended warning about 5v tolerance due to corrections to datasheet |
||
|---|---|---|---|
| Line 7: | Line 7: | ||
| This article describes an alternative method which uses an Arduino as a USB serial converter. This method is particularly convenient for those of us who don't have a 3.3V USB UART on-hand but do happen to have a spare Arduino. | This article describes an alternative method which uses an Arduino as a USB serial converter. This method is particularly convenient for those of us who don't have a 3.3V USB UART on-hand but do happen to have a spare Arduino. | ||
| - | {{ :oak:tutorials:img_20160316_185542.jpg?400 |}} | + | {{ :oak:tutorials:img_20160316_185542.jpg?500 |}} |
| ===== Components used ===== | ===== Components used ===== | ||
| ^ Part ^ Quantity ^ | ^ Part ^ Quantity ^ | ||
| - | | Oak with soldered headers |1| | + | | Oak with soldered headers | 1 | |
| - | | Arduino| 1| | + | | Arduino| 1 | |
| - | | Breadboard| 1| | + | | Breadboard| 1 | |
| - | | Jumper wires| 5-6| | + | | Jumper wires| 7-10 | |
| - | | 1 kOhm resistor* | 1| | + | | 1 kOhm resistor* | 1 | |
| - | | 2 kOhm resistor* | 1| | + | | 2 kOhm resistor* | 1 | |
| ** * Note:** The resistor values above are not critical. \\ | ** * Note:** The resistor values above are not critical. \\ | ||
| Line 77: | Line 77: | ||
| ==== Warning regarding direct connection to 5V UART ==== | ==== Warning regarding direct connection to 5V UART ==== | ||
| + | |||
| + | {{ :oak:tutorials:esp8266_5v_tolerant_io.png?150|}}I'll leave the below for posterity, but the answer is pretty simple... the ESP8266 (and hence the Digistump Oak, as the ESP8266 is the microcontroller the Oak is based on) has 5v tolerant I/O pins. You should **NOT** put 5v on the VCC connector, as that WILL kill the Oak, but due to confusion resulting from mistranslation of the original Chinese datasheet which has been cleared up in later releases, and also by the CEO of Espressif (shown on the right), the I/O pins of the ESP8266 have snapback diodes that protect the chip from over-voltage up to 5.8v, and also from reverse voltages. | ||
| + | |||
| Several users ([[http://digistump.com/board/index.php/topic,2036.msg9266.html#msg9266|1]], [[https://github.com/digistump/OakCore/issues/56#issuecomment-197618541|2]]) have reported success wiring an Oak's Tx/Rx pins directly to an Arduino's 5V UART. The [[https://www.adafruit.com/images/product-files/2471/0A-ESP8266__Datasheet__EN_v4.3.pdf|ESP8266 data sheet]] describes over-voltage protection on all GPIO pins (pg 17+), suggesting the Oak should be able to safely read 5V TTL signal directly. However, it is not well known whether operating in this way degrades the life of the ESP8266. Inserting a resistor (300+ Ohm, typ. 1K) between the Arduino's 5V transmit pin and the Oak's Rx pin will help to limit current into the Oak, although the signal level received by the ESP8266 will still be 5V at the Oak Rx pin, and the same caution regarding the longevity of your Oak still applies. If you choose to connect your Oak to a 5V serial signal, either directly from an external 5V UART or through a current limiting resistor, do so at your own risk. | Several users ([[http://digistump.com/board/index.php/topic,2036.msg9266.html#msg9266|1]], [[https://github.com/digistump/OakCore/issues/56#issuecomment-197618541|2]]) have reported success wiring an Oak's Tx/Rx pins directly to an Arduino's 5V UART. The [[https://www.adafruit.com/images/product-files/2471/0A-ESP8266__Datasheet__EN_v4.3.pdf|ESP8266 data sheet]] describes over-voltage protection on all GPIO pins (pg 17+), suggesting the Oak should be able to safely read 5V TTL signal directly. However, it is not well known whether operating in this way degrades the life of the ESP8266. Inserting a resistor (300+ Ohm, typ. 1K) between the Arduino's 5V transmit pin and the Oak's Rx pin will help to limit current into the Oak, although the signal level received by the ESP8266 will still be 5V at the Oak Rx pin, and the same caution regarding the longevity of your Oak still applies. If you choose to connect your Oak to a 5V serial signal, either directly from an external 5V UART or through a current limiting resistor, do so at your own risk. | ||
| Line 122: | Line 125: | ||
| <code> | <code> | ||
| Arduino "Tx"* ---------- Oak Tx | Arduino "Tx"* ---------- Oak Tx | ||
| - | Arduino "Tx"* ---------- Oak Rx <-- 5V input - do so at your own risk | + | Arduino "Rx"* ---------- Oak Rx <-- 5V input - do so at your own risk |
| Arduino Gnd ---------- Oak Gnd | Arduino Gnd ---------- Oak Gnd | ||
| | | ||
| Line 189: | Line 192: | ||
| This tutorial focuses on the voltage division method for connecting the Oak to an Arduino UART. To build this circuit, you'll need to select two resistors per the guidance provided [[http://digistump.com/wiki/oak/tutorials/serial_through_arduino#voltage_divider_resistor_selection|above]]. | This tutorial focuses on the voltage division method for connecting the Oak to an Arduino UART. To build this circuit, you'll need to select two resistors per the guidance provided [[http://digistump.com/wiki/oak/tutorials/serial_through_arduino#voltage_divider_resistor_selection|above]]. | ||
| - | | FIXME: Redraw the Fritzing diagram. The Arduino "Rx" pin should connect to the TOP of the voltage divider. The Oak Rx pin should connect to the voltage divider junction. The Arduino Tx pin should connect directly to the Oak Tx pin. Add jumper between Arduino Reset and ground. | | + | {{:oak:tutorials:oaktoarduinoserialwithvoltagedivider_fritzingdiagram_jwhendy.png?direct&400 |}} |
| \\ | \\ | ||
| ==== Procedure for Connecting Oak to Arduino with Voltage Divider ==== | ==== Procedure for Connecting Oak to Arduino with Voltage Divider ==== | ||