Skip to content

Commit

Permalink
Merge pull request #7 from opheliasdaisies/readme-updates
Browse files Browse the repository at this point in the history
Updates for the workshop tutorial README
  • Loading branch information
opheliasdaisies authored Aug 20, 2018
2 parents c20bb2c + 7d37519 commit b120327
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ Each boat kit will include the following materials. Make sure you let us know if

### Configuring the Arduino Nano & HC-06 Bluetooth module

To avoid using extemely long USB cables to drive the boats from the water to your laptops, the HC-06 Bluetooth module will allow you to run Johnny-Five commands wirelessly to the Arduino Nano. The Nodeboats team has pre-configured the modules to do this, so the following instructions are useful if you are building the boat at home later or need to reconfigure the module. They are based on the [HC-05 configuration docs](https://github.com/rwaldron/johnny-five/wiki/Getting-Started-with-Johnny-Five-and-HC-05-Bluetooth-Serial-Port-Module) with some key changes for the HC-06 and this workshop. Skip to step 4 and 5 to learn about pairing the module with your laptop.
To avoid using extemely long USB cables to drive the boats from the water to your laptops, the HC-06 Bluetooth module will allow you to run Johnny-Five commands wirelessly to the Arduino Nano. The NodeBoats team has pre-configured the modules to do this, so the following instructions are useful if you are building the boat at home later or need to reconfigure the module. They are based on the [HC-05 configuration docs](https://github.com/rwaldron/johnny-five/wiki/Getting-Started-with-Johnny-Five-and-HC-05-Bluetooth-Serial-Port-Module) with some key changes for the HC-06 and this workshop.

**For the workshop, you can [skip to steps 4 and 5](https://github.com/opheliasdaisies/nodeboats-jsconf2018#step-4-wire-the-module-to-the-arduinos-hardware-port) to learn about pairing the pre-configured module with your laptop.**

#### Step 1: Connect the HC-05 module to the Arduino for configuration

We will program the Arduino to send AT commands to the module to configure it via a SoftwareSerial connection. Wire the TX and RX pins of your module to your Arduino. They need wired in a crossover configuration, so from the module to the Arduino wire TX to pin 10 and RX to pin 11.
We will program the Arduino to send AT commands to the module to configure it via a SoftwareSerial connection. Wire the TX (transmit) and RX (receive) pins of your module to your Arduino. They need to be wired in a crossover configuration, so from the module to the Arduino wire TX to pin 10 and RX to pin 11. (For the purpose of configuring the Bluetooth module, pin 10 is used as RX on the Arduino, and pin 11 is used as TX. Later, when running Johnny-Five code, we'll use the pins labeled TX and RX on the arduino.)

![Arduino Nano to HC-06 Bluetooth breadboard](./diagrams/Nano-HC06-config_bb.png)

Expand Down Expand Up @@ -144,9 +146,9 @@ The setup() function will take about 6 seconds to run. You can connect to the Ar

```
If you saw that congratulations, you're done this step.
If you saw that, congratulations! You're done with this step.
If you see the following output instead, you will probably have to change BLUETOOTH_SPEED to another value and upload it again. This could be because the HC-06 chip had different baud rate.
If you see the following output instead, you will probably have to change BLUETOOTH_SPEED to another value and upload it again. This could be because the HC-06 chip had a different baud rate.
```

Expand All @@ -160,24 +162,24 @@ If you see the following output instead, you will probably have to change BLUETO

```
If you are having troubles uploading the firmata firmware to the device, make sure that nothing is connected to pins 0 and 1 when uploading as this can interfere with the upload process.
If you are having trouble uploading the firmata firmware to the device, make sure that nothing is connected to pins 0 and 1 when uploading, as this can interfere with the upload process.
#### Step 3: Reupload StandardFirmataPlus
#### Step 3: Re-upload StandardFirmataPlus
Once the baud rate is properly set, re upload the StandardFirmataPlus sketch to your board. If you don't do this it might seems that your bluetooth module is getting a connection, the light will stop blinking, but you won't be able to connect.
Once the baud rate is properly set, re-upload the StandardFirmataPlus sketch to your board. If you don't do this it might seem that your bluetooth module is getting a connection and the light will stop blinking, but you won't be able to connect.
You can upload StandardFirmataPlus through the [Arduino IDE](https://www.instructables.com/id/Arduino-Installing-Standard-Firmata/) or using [firmata-party](https://www.npmjs.com/package/firmata-party) from the command line.
#### Step 4: Wire the module to the Arduino's hardware port
Once the baud rate is properly set & Firmata reloaded, connect the TX and RX pins to Arduino pins RX0 and TX1 respectively.
Once the baud rate is properly set & Firmata reloaded, which has already been done for you for the workshop, connect the TX and RX pins to Arduino pins RX0 and TX1 respectively.
![Arduino Nano to HC-06 hookup](./diagrams/Nano-HC06-working_bb.png)
#### Step 5: Pair the module
Pair to the module from your host device, once you have paired with your bluetooth device the serial port should be visible with the 'ROBOT_NAME' you used in Step 1. It will be something like /dev/tty.ROBOT_NAME-SPPDev (in UNIX) and use COMX in Windows (where X is the number of the port). Use this name to tell [Johnny-Five which port to use](http://johnny-five.io/api/board/#component-initialization).
Pair to the module from your host device. Once you have paired with your bluetooth device the serial port should be visible with the 'ROBOT_NAME' used in Step 1. (If you're in the workshop at JS Conf, the 'ROBOT_NAME' will be labeled on your module when you receive it.) It will be something like /dev/tty.ROBOT_NAME-SPPDev (in UNIX) and use COMX in Windows (where X is the number of the port). Use this name to tell [Johnny-Five which port to use](http://johnny-five.io/api/board/#component-initialization).
You can test the connection by modifying the `blink.js` program to add the path to the Bluetooth port and running the program. Make sure Johnny-Five is installed in the `code` directory (`npm install`) before running `node code/blink.js`.
Expand Down
14 changes: 9 additions & 5 deletions build.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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.
In order to power the boat, the battery will connect directly to the Electronic Speed Controller (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):
The following is an example hookup for using the ESC:
![Arduino Nano to ESC hookup](./diagrams/Nano-HC06-ESC_bb.png)

Pin hookup:
Expand All @@ -13,7 +13,7 @@ Pin hookup:
- 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
- Every red wire, VCC on HC-06, and VIN on Nano 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)
Expand All @@ -25,9 +25,9 @@ Pin hookup:
- 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
- Every red wire, VCC on HC-06, and VIN on Nano 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.
The L-shaped connector included in the kit can be used as a rudder and/or mount for the motor. This can be attached with one end on the top of the servo and the other end attached to the back of the motor, or the motor can be fastened to the boat and the L-connector can be used to fashion a rudder connected to the servo. You can use glue, duct tape, or whatever method you'd like for attaching and modifying it. Or you can come up with some other configuration entirely. Let your boat be its true self!

## Wiring Tips

Expand All @@ -36,3 +36,7 @@ The L-shaped connector included in the kit should be attached with one end on th
## 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.
- If you drill a hole in your boat hull that could possibly be submerged, make sure you seal it well! After your wires are properly positioned through the hole, apply waterproof sealant to both sides of the hole and allow it to dry before testing it in the water.
- Servos are not waterproof! Make sure to keep them out of the water!
- The motors we're using are [brushless motors](https://www.renesas.com/us/en/support/technical-resources/engineer-school/brushless-dc-motor-01-overview.html) and can go underwater, like magic! Don't worry about submerging these, but also know that standard brushed motors can't be.
- If you need to extend any jumper wires, we have heat shrink tubing which can form a watertight seal and help you join them.

0 comments on commit b120327

Please sign in to comment.