Code Monkey home page Code Monkey logo

nodeboats-jsconf2018's Introduction

Welcome to NodeBoats at JS Conf 2018!

Getting Started

As part of this workshop, you should divide up into teams of 3-4 people. Try to find people with a similar boat "vision" as you to partner with.

Teams will be building a motor-propelled boat, which will require some soldering. Feel free to ask any of the workshop team members if you need help with any part of this process.

Each boat kit will include the following materials. Make sure you let us know if any components are missing! (Please also keep in mind that we do need the parts back at the end of the day!)

Boat Kits

  • Arduino Nano
  • Electronic Speed Controller (ESC) 30A with Reverse
  • Micro Servo
  • HC-06 Bluetooth Module
  • 2S Lipo Battery with XT60 connector
  • 2S USB Lipo Charger
  • Breadboard
  • USB A <-> Mini-B USB cable
  • Jumper Wires (Male-to-Male && Female-to-Male)
  • Wire Extension
  • Brushless Motor
  • Propellor
  • L-shaped connector
  • Boat Hull (aka Plastic Takeout Boxes)

Things you may need (And We Have!!!)

  • Goopy goo glue sealant
  • Styrofoam (we have sheets and will cut off what your boat needs)
  • Popsicle Sticks!
  • Hot glue gun
  • Soldering irons & solder
  • Heat shrink tubing & heaters
  • Wire cutters/strippers
  • A drill
  • Box cutters
  • Googly eyes
  • Feathers
  • Mini Pool Floaties

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 with some key changes for the HC-06 and this workshop.

For the workshop, you can skip to steps 4 and 5 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 (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

You will need the Arduino IDE to upload the configuration sketch file to your Arduino. The sketch will create a connection between the Arduino's serial port and the HC-06, as well as configure the HC-06 to use the same baudrate as Johnny-Five.o

  // 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, probably 1234
    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() {}

Step 2: Check configuration

The setup() function will take about 6 seconds to run. You can connect to the Arduino with Serial Monitor and you should see the following output.


  Starting config
  OK
  OK[VERSION]
  OK[PSWD]
  OK
  OK
  Done!

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 a different baud rate.


  Starting config





  Done!

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: 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 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 or using 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, 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

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' 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, and the pin code will be 1234.) 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.

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.

Resources for Building Your Boat!

You may need some help while setting up your NodeBoat. Here are some tips and tricks so you can learn from our experiences:

  • Check out the build guide to see wiring examples and tips for working with the ESC and servo.
  • The Arduino Nano pinout is a handy reference for what each pin can do
  • The name of the Bluetooth module should be on its bag, look for this when pairing it with your laptop
  • Connect the ground (GND) wire before connecting the power wire, especially when working with the lipo battery.
  • Unplugging or turning off power when switching wires is good practice to avoid unexpected short circuits.

First Time Using Johnny-Five? Don't hesitate to ask us for help! That's why we're here. Here are some intro materials and parts of the docs that will be particularly helpful while building your boats:

Examples

These are a few examples of boats that the Nodeboats Team has built to show the variety of design and creativity that can go into creating your vessel.

Captain Sammy

AJ Nodeboat

nodeboats-jsconf2018's People

Contributors

dependabot[bot] avatar hipsterbrown avatar opheliasdaisies avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nodeboats-jsconf2018's Issues

Questions for The Conference

Ask any question you have of the conference here and I'll get it answered.

Questions so far;

  • @ajfisher asked What is the size of the pool?
  • @reconbot asked What facilities do we have at the pool and what do we have at the workshop area? (Power, network, etc)
  • Can we have a map again? (slack history ate this)
  • @reconbot Do we have any equipment from 2015?
  • How long is the workshop? (9-5?)
  • Can the conf give us nodeboat stickers?
  • Confirmation of the budget

Write Workshop and Educational Materials

In the 2015 NodeBoats workshop we had a repo to walk attendees through the basic build of the boat, which also linked out to helpful resources to get them started with Johnny-Five. Some of this can be repurposed from the 2015 materials, but since so much time has passed and we're updating the boat build, these materials should be updated and expanded on for the 2018 workshop.

For this issue to be complete we need:

  • a tutorial write-up for the workshop for how to build a base NodeBoat (both motor-powered and paddleboat options should be included)
  • links to resources on how to set up the microcontroller being used (dependent on issue #1 )
  • links to helpful Johnny-Five resources and documentation most relevant to the boat build

Plan Boat Physical Designs

Beyond the hardware elements of the boat, the look, feel, and creative elements are very important, and something attendees had a lot of fun with last time! (A bunch of teams even made runs to Walmart to get additional supplies beyond what we provided.) We might have 3d printers available but in the past they've been slow and in very high demand and shouldn't be relied upon.

Last workshop we provided:

  • A container for the hull of the boat (we had a waterproof plastic box, but some people made rafts with soda bottles, and styrofoam pool noodles)
  • Goopy goo glue sealant
  • Styrofoam (we have sheets and will cut off what your boat needs)
  • Popsicle Sticks
  • Hot glue guns
  • Soldering irons & solder
  • Heat shrink tubing & heaters
  • Wire cutters/strippers
  • A drill
  • Box cutters
  • Googly eyes googly_eye_on_a_hammer

Obviously we're not limited to these supplies and we don't have to do things exactly the same as 2015, there are a lot of cool materials and tools we can provide. We can get creative.

For this issue, we need:

  • A list of tools and equipment needed to support the teams (these will be kept for next year, hot glue guns, knives, drill, etc)
  • a list of materials to buy for the core of the 16 boats (eg, hull materials, paddles, rudders, waterproof glue etc)
  • A list of creative materials to buy for fun (markers, feathers, flags, googly eyes, stickers, contact paper, whatever)

Prototype Updated Boat Hardware for 2018

The last NodeBoats workshop in 2015 used the Particle (or Spark) Core for the microcontroller, but there were some complications from the wifi congestion at the conference. For the 2018 workshop, we should prototype a new boat using a different microcontroller.

We want to make sure the microcontroller we use will be reliable (or as reliable as possible given the limitations of a conference setting), and that it will allow attendees to easily transfer their boats from the indoor conference workshop area area to the outdoor pool area.

For the boat build, we'll want attendees to be able to use either a Tamiya motor pod (a basic motor) plus a standard servo (for steering) to create a motor boat, or two (or more) continuous rotation servos to create a paddle boat.

I was initially thinking we may want to use a board with bluetooth so that wifi wouldn't be necessary, but that's not a requirement. However, we ideally would want something that attendees would be able to implement on their own at home after learning the basics at the workshop.

The final challenge for the day at the workshop will be a race across the short length of the pool, but we don't need to have everyone go at once - we could have teams go in smaller batches and time them with a stopwatch so that they could walk alongside the boats as they go along. (This would also allow them to reach out and rescue their boats if needed, which happened a few times during the 2015 workshop.)

For this issue to be complete we need:

  • a prototype boat
  • a build of materials for 16 boats (plus some spare parts)
  • the firmware / j5 plugin for controlling the selected hardware

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.