4-2 Build Smart Device

Your team needs to build its smart device prototype by connecting the necessary inputs and outputs to your Photon board. Your team’s system model should identify each of the parts needed for your device.

You will need to use online references (such as: References for Wiring & Coding, Photon Experiment Guide, etc.) to verify how to correctly wire the parts to the I/O pins and power. (I/O = Input/Output)

Your team will need to test the wiring of each part by adding temporary code in the Photon app to do something simple with each part (such as: turn LED on and off, rotate servo motor back and forth, etc.).

In addition, you may need to construct other non-electronic parts for your team’s smart device prototype. For example, if your smart device locks a door, then your team should build a small-scale model door (using cardboard, etc.) that can be locked and unlocked by your device.

YOUR TASK

  1. Connect the necessary parts to build the smart device:

    1. Use your team’s system model to identify and gather all the parts needed for inputs and outputs.

      • If your team's system model does NOT clearly and correctly identify all the specific inputs and outputs needed for your device, then revise your system model to be accurate.

      • If necessary, you can simulate certain parts. For example, the smart thermostat prototype used a red LED and blue LED to represent heating and cooling systems.

      • TIP: If people will interact directly with the device, consider whether you need to add parts to provide visual and/or audio feedback to indicate the device status or a device response. For example, if a user presses a button on the device, how will the user know the device detected this? Devices and apps that don't provide any obvious feedback can be frustrating or confusing to users.

    2. Research the wiring connections for each part, and fill out this wiring table. Here's an example wiring table for a smart security system.

      • How many wires does the part need, and what do the wires connect to? Each part will connect to at least one I/O pin and to GND. Certain parts (such as: LED, etc.) connect to GND using a resistor. Certain parts (such as: OLED display, etc.) connect to additional I/O pins and/or to a power supply pin (3.3V or 5V).

      • Will the part gets its power from its I/O pin, the 3.3V pin, or the 5V pin (V-USB)? Some parts get power directly from their I/O pin, while other parts have separate wires for power. Certain parts (OLED display, etc.) are limited to only 3.3V of power, while other parts (servo motor, etc.) require 5V of power.

      • Does the part need to connect to specific pins? Certain inputs (such as: photocell, etc.) need an analog pin. Certain outputs (such as: servo motor, etc.) need a PWM pin. Certain parts (such as: OLED display, etc.) need to be connected to other specific pins.

    3. Plan out where the parts will placed on the breadboard, so the layout will be easy to understand and use (e.g., if users need to look at device and/or physically interact with device).

    4. Determine whether you need to connect one or more power rails on the breadboard:

      • Use a jumper wire to connect one of the negative power rails on the breadboard to a GND pin on the Photon board. Then connect each part’s GND wire (or resistor) into this negative power rail.

      • If there is one (and only one) part requiring 3.3V, then connect that part directly to the 3.3V pin on the Photon board.

      • If there are multiple parts requiring 3.3V, then use a jumper wire to connect one of the positive power rails on the breadboard to the 3.3V pin on the Photon board. Then connect each part’s 3.3V wire into this positive power rail.

      • If there is one (and only one) part requiring 5V, then connect that part directly to the V-USB pin (5V) on the Photon board.

      • If there are multiple parts requiring 5V, then use a jumper wire to connect one of the positive power rails on the breadboard to the V-USB pin (5V) on the Photon board. (If you already connected one positive power rail to 3.3V, then connect the second positive power rail to V-USB). Then connect each part’s 5V wire into this positive power rail.

      • If there are no parts requiring 3.3V or 5V, then do not connect a positive power rail (because all the parts will receive power from their I/O pins). However, you will still use the negative power rail for the GND wires.

    5. Connect each of the wires (and resistors, if applicable) for each part, and use your wiring table to record which I/O pin each part is connected to. This information will be needed to code the Photon app.

      • NOTE: Several analog pins are duplicated on the Photon board. A2, A3, A4, and A5 are each represented by two pins. If you use one of these pins, you cannot use its duplicate.

      • TIP: You may want to connect one part at a time, and then test the wiring of that part using Photon code (step 2) before connecting the next part.

  2. Test the wiring of each part using temporary code in the Photon app. The "test" code for each part should do something simple to verify the part functions correctly.

    • For example, an LED light could be programmed to blink on and off repeatedly, a motion sensor could be programmed to briefly turn on the built-in D7 LED if movement is detected, etc.

    • For inputs that take measurements (such as: photocell, accelerometer, etc.), you will have to do a bit more work to test that the part is working correctly. For example, if you first connect and test the OLED display screen, then you could display a measurement taken with another part. (Later, you could remove the OLED screen if it's not needed as part of your final device.) Another option would be to share the measurement variable with a simple web app that would display the measurement value.

  3. Construct any additional parts needed to demonstrate how your team’s smart device prototype works.

    • For example, if your smart device locks a door, then create a small-scale model door (using materials such as cardboard, etc.), so that your device can actually lock or unlock the model door.

  4. Once the smart device, Photon app, and web app have all been completed, conduct integration testing to verify they work together properly.

Last updated