-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from opheliasdaisies/docs
Initial setup documentation
- Loading branch information
Showing
14 changed files
with
2,115 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
.DS_Store | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Tips for Building The Motor-powered Nodeboat! | ||
|
||
This build does require soldering, so ask for help if you need it. | ||
|
||
In order to power the boat, the battery will connect directly to the ESC and share the power from the ESC to the breadboard. See the hookup diagram below. The battery has an XT60 connector that needs a matching connector soldered onto the ESC's red and black wires. Check out the sides of the XT60 for a plus (+) and a minus (-) sign with the red wire (power) lining up with the plus sign and the black wire (ground) lining up with the minus sign. Once the battery is hooked up to the ESC, you can use the power switch on the ESC to test the connection. | ||
|
||
The following is an example hookup for using the Electronic Speed Controller (ESC): | ||
![Arduino Nano to ESC hookup](./diagrams/Nano-HC06-ESC_bb.png) | ||
|
||
Pin hookup: | ||
|
||
- RXD on HC-06 <-> TX1 on Nano | ||
- TXD on HC-06 <-> RX0 on Nano | ||
- Orange wire on ESC <-> D10 on Nano | ||
- Every black wire goes to the ground (GND) rail | ||
- Every red wire goes to the power rail | ||
|
||
Adding the servo for steering is as simple as adding three more wires to the breadboard: | ||
![Arduino Nano with ESC and Servo hookup](./diagrams/Nano-HC06-ESC-Servo_bb.png) | ||
|
||
Pin hookup: | ||
|
||
- RXD on HC-06 <-> TX1 on Nano | ||
- TXD on HC-06 <-> RX0 on Nano | ||
- Orange wire on ESC <-> D10 on Nano | ||
- **Yellow wire on Servo <-> D11 on Nano** | ||
- Every black wire goes to the ground (GND) rail | ||
- Every red wire goes to the power rail | ||
|
||
The L-shaped connector included in the kit should be attached with one end on the top of the servo and the other end to the back of the motor. You can use glue, duct tape, or whatever method you'd like for attaching it. | ||
|
||
## Wiring Tips | ||
|
||
- You may notice the 5V pin on the Arduino Nano is not powering the HC-06 or any other device. This is to prevent [brownouts](https://en.wikipedia.org/wiki/Brownout_(electricity)) that can be caused by spikes in power draw from the servo or motor. | ||
|
||
## General Tips | ||
|
||
- Before drilling a hole in the boat hull to pass through the wires from the motor pod, it is strongly recommended that you put all of your components in the boat first, to test the bouyancy and add the appropriate amount of styrafoam to the boat. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Set ROBOT_NAME to something unique | ||
#define ROBOT_NAME "RandomBot" | ||
|
||
// If you haven't configured your device before use this | ||
#define BLUETOOTH_SPEED 9600 //This is the default baudrate that HC-06 uses | ||
// If you are modifying your existing configuration, use this: | ||
// #define BLUETOOTH_SPEED 57600 | ||
|
||
#include <SoftwareSerial.h> | ||
|
||
// Swap RX/TX connections on bluetooth chip | ||
// Pin 10 --> Bluetooth TX | ||
// Pin 11 --> Bluetooth RX | ||
SoftwareSerial mySerial(10, 11); // RX, TX | ||
|
||
/* | ||
The possible baudrates are: | ||
AT+UART=1200,0,0 -------1200 | ||
AT+UART=2400,0,0 -------2400 | ||
AT+UART=4800,0,0 -------4800 | ||
AT+UART=9600,0,0 -------9600 - Default for hc-06 | ||
AT+UART=19200,0,0 ------19200 | ||
AT+UART=38400,0,0 ------38400 | ||
AT+UART=57600,0,0 ------57600 - Johnny-five speed | ||
AT+UART=115200,0,0 -----115200 | ||
AT+UART=230400,0,0 -----230400 | ||
AT+UART=460800,0,0 -----460800 | ||
AT+UART=921600,0,0 -----921600 | ||
AT+UART=1382400,0,0 ----1382400 | ||
*/ | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
|
||
Serial.println("Starting config"); | ||
mySerial.begin(BLUETOOTH_SPEED); | ||
delay(1000); | ||
|
||
// Should respond with OK | ||
mySerial.print("AT\r\n"); | ||
waitForResponse(); | ||
|
||
// Should respond with its version | ||
mySerial.print("AT+VERSION\r\n"); | ||
waitForResponse(); | ||
|
||
// Should respond with default password | ||
mySerial.print("AT+PSWD\r\n"); | ||
waitForResponse(); | ||
|
||
// Set the name to ROBOT_NAME | ||
String rnc = String("AT+NAME=") + String(ROBOT_NAME) + String("\r\n"); | ||
mySerial.print(rnc); | ||
waitForResponse(); | ||
|
||
// Set baudrate to 57600 | ||
mySerial.print("AT+UART=57600,0,0\r\n"); | ||
waitForResponse(); | ||
|
||
Serial.println("Done!"); | ||
} | ||
|
||
void waitForResponse() { | ||
delay(1000); | ||
while (mySerial.available()) { | ||
Serial.write(mySerial.read()); | ||
} | ||
Serial.write("\n"); | ||
} | ||
|
||
void loop() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const five = require('johnny-five'); | ||
|
||
const board = new five.Board({ | ||
port: '', // path to bluetooth connection, i.e. /dev/tty.ROBOT_NAME-SPPDev or COMX | ||
}); | ||
|
||
board.on('ready', () => { | ||
const led = new five.Led(13); // use built-in led on Arduino | ||
led.blink(); | ||
}); |
Oops, something went wrong.