Main Board

From Opensprints

Jump to: navigation, search
The Main Board, aka the USB interface board. Not to be confused with a Network Hub.

The Main Board, aka the USB interface board, is basically an Arduino piggyback board that provides a safe and convenient interconnect for the sensors. Ethernet cables are used to connect the sensors to the Arduino. Extensive prototyping area on the board allows for ease of extending the functionality of the system.

Contents

[edit] Assembly

  1. Press in four RJ45 Jacks.
    TOP: OpenSprints Interface Board
    TOP: When pressed, RJ45 jacks will snap into place.
    BOTTOM: RJ45 Jacks pressed into place.
    BOTTOM: RJ45 Jacks pressed into place.
  2. Solder in RJ45 Jacks.
    BOTTOM: RJ45 Jacks soldered into place.
    BOTTOM: All RJ45 Jacks soldered into place.
  3. Install Power LED (and resistor).
    Colors of a 100 ohm Resistor, brown on one end, gold on the other.
    TOP: White power LED goes in D1, direction DOES matter. 100 ohm resistor goes in R1, direction doesn't matter.
    TOP: Power LED and resistor installed.
  4. Get your parts ready to install the Arduino Board.
    Arduino board and mounting hardware.
  5. Install Standoffs.
    TOP: Hold countersunk screw from bottom.
    TOP: Thread on standoffs.
    BOTTOM: Tighten standoffs from the bottom with the countersunk screws. DO NOT OVER TIGHTEN. This is not the Jesus nut on your helicopter.
  6. Install male headers.
    If need be, break male headers into two 6 pin and two 8 pin sections.
    TOP: Insert the shorter legs of the male headers into the PCB which means the longer ones are pointing up. DO NOT SOLDER YET.
    TOP: Place the Arduino.
    TOP: Screw Arduino into place with the remaining 3 countersunk screws. AGAIN, DO NOT OVER TIGHTEN. Let us repeat, this is not the Jesus nut on your helicopter.
    BOTTOM: Now that the Arduino is holding the headers straight and in place, solder the headers from the bottom of the PCB. The breakaway headers are very sensitive to heat. When soldering in the pins, work fast or the plastic casing will melt around the pin.
  7. Get the rest of your parts ready.
    Main Board parts
  8. Install End Panels.
    Attach end panels and set everything into the bottom of the case. NOTE: It is almost impossible to put in the end panels on AFTER you screw the PCB in place.
  9. Screw PCB to case.
    TOP: Screw interface board to bottom of the case using the pan head screws.
  10. Screw Case Together.
    BOTTOM: Screw case together while upside down using the screws that came with the enclosure. They are usually in a little baggy.
  11. Install Adhesive Feet.
    BOTTOM: Note the indentations on the bottom of the case
    BOTTOM: The indentations are where the adhesive feet go.
    BOTTOM: There are four adhesive feet.
  12. Install Stickers.
    Naked case. Something is missing...
    Stickers! Now you are ready for the Firmware update.

[edit] Tips & Tricks

If you didn't buy a kit directly from OpenSprints, but you are using these instructions, these tips will help.

  1. Install blinker LED with anode connected to Arduino pin 13, and a resistor connected between the LED's cathode and GND. A good resistor value for white, blue, or green LEDs is 100 Ohms. A good resistor value for red, yellow, or orange LEDs is 220 Ohms. The newest version of the interface PCB has pads for the LED and resistor.
  2. Cutting your own End Panels. Cut the face plates of the project box to make openings for the USB jack and the RJ45 jack(s), and slide the face plates into place on the project box. This will add much needed structural support to the enclosure in the event it is stepped on, however you can omit this step. Here are the CAD drawings for the parts if you wanted to get them professionally cut:

[edit] Updating Firmware

SKIP THIS STEP if you bought a pre-assembled and tested system. The pre-assembled systems already have this step done for you.

If you intend to use a USB Flash Drive, DO NOT install this step on the USB Flash Drive -- you will run out of room. Instead install the firmware from windows or mac.

In order for the Arduino Environment to be able to talk to the Arduino, the OpenSprints app should not be running.

  1. Have your Main Board and USB 2.0 A / B Cable handy and ready to go.
    Have your Main Board and USB 2.0 A / B Cable handy and ready to go as well as a sensor plugged into Port #1.
    The Main Board has power when the red LED blinks.
  2. After you have downloaded and installed the latest Arduino Environment for your Operating System, open up the Arduino Environment. Make sure the OpenSprints app is not running at the same time. Linux users: install the dependencies as described in the Arduino Environment site.
    After you have downloaded and installed the latest Arduino Environment for your Operating System, open up the Arduino Environment.
  3. Select the correct board and device / serial port from the "Tools" menu. If you are nervous about which one to pick, just unplug the other USB cables on your computer before you do this.
    Here is an example of what it shows up as in Windows Vista's Device Manager.
  4. After you have downloaded and installed the latestOpenSprints software open the firmware directory.
    After you have downloaded and installed the latestOpenSprints software open the firmware directory.
    If you have installed the OpenSprints software via the Ubuntu repository, copy the directory /opt/opensprints/firmware/arduino/basic_msg/ to your Desktop and then in the Arduino environment, open basic_msg.pde in the directory on the Desktop.
  5. Open the OpenSprints basic_msg.pde in the Arduino IDE and then click the "Upload" button -- marked with the red arrow in the picture.
    Open the OpenSprints basic_msg.pde in the Arduino IDE and then click the "Upload" button -- marked with the red arrow in the picture.
  6. If you see Done Uploading at the bottom, OpenSprints basic_msg.pde was loaded successfully.
    If you see Done Uploading at the bottom, OpenSprints basic_msg.pde was loaded successfully.
  7. Visually verify that the firmware was successful. Plug in the sensors. You were successful if they light up red instead of red and green. If both the red and green lights come on (especially in ports 1 & 2) it means the default Arduino firmware is still on there.
    If both the red and green lights come on (especially in ports 1 & 2) it means the default Arduino firmware is still on there.
    You were successful if the sensor ONLY lights up red.

[edit] Troubleshooting

Follow these instructions if the software doesn't seem to be responding when the people pedal. This step by-passes the software to see if the hardware is sending data to the computer.

Connect all the hardware together: the sensors connected to the interface board with ethernet cables, the programmed Arduino mounted on the interface board, and the Arduino connected to the computer with a USB cable.
Make sure the sensor blinks when the magnet passes by. If it doesn't that means the magnet is too far away from the sensor or it isn't facing the right way (AKA Polarity: North and South Poles). Fix that first.

[edit] Setup for testing under Linux

  1. Run gtkterm
  2. Configure the port (Configuration -> Port) and select the following values:
    • Port: /dev/ttyUSB0
    • Speed: 115200
    • Parity: none
    • Bits: 8
    • Stopbits: 1
    • Flow Control: none
    • End of line delay: 0

[edit] Setup for testing under Windows

  1. Install and run PuTTY.
  2. With the Arduino connect to the PC, go to Hardware Manager and determine which COM port the Arduino is connected to.
  3. Configure the port:
    • Click on the Serial radio button.
    • COM?, as determined in previous step.
    • As far as I remember, everything else should be default.

[edit] Running a fake race

Once the chosen terminal is configured as per the previous step, you should see a cursor with nothing going on. Type the letter 'g' on the keyboard. Nothing should happen for a few seconds (during the countdown - "4, 3, 2, 1, 0, go!"). Then you should see a stream of numbers and letters filling the screen.

This is an example of what you might see in the terminal at an instant:

1: 0
2: 0
3: 0
4: 0
t: 15311

Test the hardware by waving a magnet in front of the hall effect sensor. (Turn the magnet around until the tick LED flashes. That will be the correct orientation of the magnet.)

Every time you wave a magnet in front of the hall effect sensor you will see the number following the corresponding sensor increment. So if you caused a tick on sensor 2, the following report will look like this:

1: 0
2: 1
3: 0
4: 0
t: 15562

At this point, if all the sensors are behaving as expected, it's time to install and start running the PC application. Check out the page on software installation.

[edit] Complete Testing Process

  1. Program the arduino with firmware.
  2. Test each RJ45 port on each sensor as it's completed to make sure the White LED lights up when the magnet passes by the HE. The default Arduino firmware will light up both the Green and Red LEDs when it has power, the OpenSprints firmware will only light up the Red LED.
  3. Full system integration test
    1. Connect all 4 sensors to the interface board
    2. Run a serial monitor program (Arduino environment, putty, gtkterm, etc.)
    3. Run the magnet by each of the sensors and make sure messages sent from interface board correspond to the ticks that you are creating on the HE's.
    4. Verify the Stop/Go LEDs. (or you could verify the stop/go lights in step 2 if you want).

[edit] See Also

Personal tools