Quantcast
Channel: SparkFun: Commerce Blog
Viewing all 2614 articles
Browse latest View live

IoTuesday: Maximize Your WiFi With This One Weird Trick!

$
0
0

Terrible clickbait titles aside, I wanted to improve on a project from a few weeks ago. Nick Poole gave me the idea of automating the DIY Yagi-Uda antenna/divining rod I had put together in order to find the orientation of the maximum WiFi signal strength.

The execution was straightforward: mount the antenna and ESP8266 Thing Dev Board onto a pan/tilt bracket with some servos. The ESP8266 code was updated to connect to a WiFi access point (AP) and begin sweeping up and down (about 70°) and left to right (about 180°). At 5° increments, the ESP8266 would take an RSSI reading and remember the yaw and pitch settings of the highest RSSI. After sweeping, the antenna automatically returns to the position with the best RSSI.

Here’s a video of it in action:

There are, of course, a number of problems with this whole setup:

  1. The polarization (roll) of the antenna is not taken into consideration. It would require another servo to test vertical and horizontal orientations.
  2. If the antenna were moved, it would obviously require another maximizer sweep.
  3. If you stand in front of the antenna, place your hand near it, or put any sort of object in its line of sight. You change the multipath propagation of the radio waves, which can mess up the sweep tests or change where the best signal strength might be.
  4. I’m still relying on a poorly made DIY antenna. A professionally made directional antenna should, in theory, perform a lot better than my warped popsicle stick and paperclip monstrosity.
  5. Because the sweep arc is limited, the best connection might be behind the antenna.

Here’s a shot of the rig post-maximization:

WiFi maximizer using a pan/tilt bracket and servos

The OLED display shows an updated RSSI to give you an idea of the connection strength even after the sweep is complete. If you think the given dBm might be unacceptable, then you may want to move the rig and test another spot, especially if you are indoors and multipath is an issue.

If you are interested in trying out the WiFi Auto Maximizer for yourself, you can find the pin connections and code here.

This setup could be useful for performing a very basic characterization of antennas (as per 71784’s suggestion) if you are outdoors and have line of sight to an access point. By sweeping through the different angles, you could develop very simple and limited azimuth and elevation plots. It would not be very accurate, but it could still be useful for those of us without access to an anechoic chamber.

If I wanted to buy an inexpensive 2.4 GHz directional antenna (in lieu of DIY) to test with this rig, what would you recommend? Share your thoughts and suggestions in the comments below.

comments | comment feed


Hardware Hump Day: Earth Day Hacking

$
0
0

This Saturday is Earth Day, and all of us at SparkFun are super proud and excited to share how we celebrate Earth Day every day. SparkFun is deeply committed to engaging in environmentally conscious practices and behaviors. From our aggressive recycling habits to our solar panel-covered roof and bike-to-work program, we are doing everything we can to have a minimal carbon footprint.

Today I want to share a simple way to bring the green spirit into your own home with an energy conservation hack. With this project, you will be able to connect any of your appliances to a timer so that they will automatically turn on and off based on your schedule and habits. To make this I used only three parts:

Arduino Uno - R3 SMD

DEV-11224
29.95
19
SparkFun DeadOn RTC Breakout - DS3234

BOB-10160
19.95
12
PowerSwitch Tail II

COM-10747
28.95
7

The below diagram illustrates the circuit.

alt text

Having a hard time seeing the circuit? Click on the wiring diagram for a closer look.

You will notice that there are two open leads going to + and -. These represent the terminals in the PowerSwitch Tail. You will also need to plug one end of the PowerSwitch Tail into the wall and then plug your home appliance into its other end as shown below.

alt text

Once your circuit is completed, it should look like this.

alt text

Now it’s time to upload your program using the Arduino IDE. I relied on the SparkFun DS3234 Arduino Library. This program will turn your appliance on at 7 a.m. and turn it off at 7 p.m. I have added comments in the code for you to follow along and easily customize the timer based on your own schedule.

// Earth Day Conservation Hack by Melissa Felderman for SparkFun Electronics
#include <SPI.h> //include SPI library
#include <SparkFunDS3234RTC.h> //include Sparkfun DS3234 RTC library

//RTC pin definition
#define PRINT_USA_DATE
#define DS13074_CS_PIN 10

//Power switch tail Pin
int pin = 7;


void setup() {

   Serial.begin(9600);

   //start RTC clock
  rtc.begin(DS13074_CS_PIN);
  rtc.autoTime();


  //Pin mode for power switch tail
  pinMode(pin, OUTPUT);


}

void loop() {
//serial print commands for debugging

  static int8_t lastSecond = -1;

   rtc.update();

   if (rtc.second() != lastSecond) // If the second has changed
  {
    printTime(); // Print the new time

    lastSecond = rtc.second(); // Update lastSecond value
  }

//line of code to control appliance with the RTC.
//To change the times at which to turn on and off the appliance, change the values in the IF statement.
  if(rtc.hour() > 7 && rtc.hour() < 19 ){
    digitalWrite(pin, HIGH);
  }else {
    digitalWrite(pin, LOW);
  }

}

//function for serial
void printTime()
{
  Serial.print(String(rtc.hour()) + ":"); // Print hour
  if (rtc.minute() < 10)
    Serial.print('0'); // Print leading '0' for minute
  Serial.print(String(rtc.minute()) + ":"); // Print minute
  if (rtc.second() < 10)
    Serial.print('0'); // Print leading '0' for second
  Serial.print(String(rtc.second())); // Print second

  if (rtc.is12Hour()) // If we're in 12-hour mode
  {
    // Use rtc.pm() to read the AM/PM state of the hour
    if (rtc.pm()) Serial.print(" PM"); // Returns true if PM
    else Serial.print(" AM");
  }

  Serial.print(" | ");

  // Few options for printing the day, pick one:
  Serial.print(rtc.dayStr()); // Print day string
  //Serial.print(rtc.dayC()); // Print day character
  //Serial.print(rtc.day()); // Print day integer (1-7, Sun-Sat)
  Serial.print(" - ");
#ifdef PRINT_USA_DATE
  Serial.print(String(rtc.month()) + "/" +   // Print month
                 String(rtc.date()) + "/");  // Print date
#else
  Serial.print(String(rtc.date()) + "/" +    // (or) print date
                 String(rtc.month()) + "/"); // Print month
#endif
  Serial.println(String(rtc.year()));        // Print year
}

It’s as easy as that! Look at this light automatically turn on for me!

alt text

The best part about this project is the PowerSwitch Tail. With this part, you can easily control any appliances with your sensors and microcontroller. It eliminates the trouble of working with a relay switch and will cut your project build time dramatically!

It’s not pretty, but it’s a quick and easy to way to save energy. If you’re constructing a house from the ground up, you can look into some energy-saving features like the automatic lights and gray outlets at SparkFun’s headquarters. The goal of the outlets is to shut off at night, cutting phantom power draw from any electronics plugged into them. Just like the gray outlets, some of our lights are on a timer as well as motion sensors. One of the really cool features about the lights that are close to the windows is that they have light sensors attached to them. If it is super sunny out, the lights will shut off, and the natural light will flood into the building.

Learn more about SparkFun’s sustainability efforts on Facebook and Twitter (#EarthWeek) and share your Earth Day projects with us there and in the comments below!

comments | comment feed

Enginursday: I2Considerations

$
0
0

When it comes to microcontrollers, it’s easy to run out of IO pins before you run out of programming space. Back in 1982, NXP Semiconductor (formerly known as Philips Semiconductor) came up with a solution called Inter-Integrated Circuit, or I2C. With this technology, designers are able to connect up to 127 devices using just two pins for clock and data. I2C not only frees up I/O pins but also maintains the measurement from the source to the device reading the measurement. With analog outputs, the output is susceptible to noise, which will need to be filtered through hardware or software. Because I2C is digital, noise can often be ignored, but that doesn’t mean it’s problem free, and there are design considerations that need be addressed — no pun intended.

alt text

One of the first things to look at is the speed to communicate between the microcontroller, known as the master, and the device that is being controlled, known as the slave. For Arduino, the Wire library defaults to 100kHz, but depending on the master and the slave device, you could communicate as low as 10kHz (low-speed mode), to as fast as 3.4MHz (high-speed mode). The faster you communicate, the less amount of capacitance is tolerated on the line, due to the increased rise time of signals. The standard maximum capacitance for I2C lines is around 400pF.

What creates the capacitance, though? There is some capacitance from the devices themselves (around 20pF), but the bulk of the capacitance comes from the wires to connect the devices together. On a circuit board, capacitance isn’t that big of a concern, but there is some created just by having the traces run closely to the ground plane. On cables, however, you could create 40–120pF per meter. For example, with CAT5 cable used for wired internet connections, the capacitance must not exceed 50pF per meter. Shielded cable is higher at 114pF per meter.

What does this mean for the real world? I set up a test using two cables. One was 6 inches long, and the other was 6 feet long. In order to see the effect of cable length more clearly, I removed the pull-up resistors that are normally required for I2C communication.

6 inch cable rise time

6-inch cable

6 foot cable rise time

6-foot cable

With the 6-inch cable, the SDA line (in yellow) sort of looks like a square wave with a rise time of 3.8us. In the 6-foot line, however, the data line looks more like a saw-tooth wave than a square wave with a rise time of around 11us. This is a result of the capacitance of the wires, and grounding the other wire of the twisted pair from the CAT5 cable would increase the rise time even more.

The second half of the design is the pull-up resistors used. I2C uses open-drain technology, meaning that the devices are able to pull the signal down to ground, but are not able to pull the signal high. For that reason, all of our boards that use I2C have pull-up resistors on them. The resistors need to be of a certain value, though. If the resistor value is too high, the rise time of the signals can be too large to be read.

alt text

6-inch cable with a 100 kΩ pull-up resistor

alt text

6-foot cable with a 100 kΩ pull-up resistor

And if the value is too low, oscillations known as ringing can be large enough that the master or slave devices misread the data on the lines. Too small of a resistor value can also prevent the signals from reaching a low enough voltage to be read as a logic 0.

alt text

6-inch cable with 100Ω pull-up resistor

alt text

6-foot cable with 100Ω pull-up resistor

Looking at the waveforms, we can see the ringing when the signals switch from low to high, as well as some crosstalk on the data line when the clock line switches. We can also see that when the signal is low, the voltage is around 1.2V. If our sensor were powered off of 3.3V, that voltage could be too high to be read as a logic 0.

Here at SparkFun, most if not all of our boards use 4.7kΩ pull-up resistors. The value doesn’t need to be too specific, 1kΩ to 10kΩ would work just as well. With 4.7kΩ, though, you can connect a couple devices together without having to disable the pull-ups. But if you’re planning on using a few or more boards on the same I2C bus, make sure you disable the pull-ups on all but one of the boards using a hobby knife.

comments | comment feed

Friday Product Post: Due Digilence

$
0
0

Hello, and welcome to another Friday Product Post! We have a lighter week in preparation for the next couple of weeks, but don’t worry, we have a few things that you are really going to like! This week we are happy to bring you the new Digilent BNC Adapter Board for the Analog Discovery 2 USB oscilloscope, as well as an updated 2xAAA battery holder. Let’s dive on in and take a look.

Run BNC

Digilent BNC Adapter Board

TOL-14260
19.95

The Digilent BNC Adapter Board is a simple add-on board that is intended to be used with the Digilent Analog Discovery 2, allowing you to use standard BNC-terminated test leads and probes with your pocket-sized oscilloscope. The adapter board provides BNC terminations to each of the two oscilloscope channels and enables you to AC couple or DC couple signals to the oscilloscope in the Analog Discovery.

Speaking of the Analog Discovery 2…

Diligent Digilent!

Digilent Analog Discovery 2

TOL-13929
279.95
10

In case you haven’t picked up this pocket-sized USB oscilloscope, we are happy to reintroduce the Digilent Analog Discovery 2. This multifunction instrument allows users to measure, visualize, generate, record and control mixed-signal circuits of all kinds. Developed in conjunction with Analog Devices and supported by Xilinx University Program, the Analog Discovery 2 is powerful enough to replace a stack of lab equipment, providing engineering students, hobbyists and electronics enthusiasts the freedom to work with analog and digital circuits in virtually any environment, in or out of the lab.

Battery Holder - 2xAAA with Cover and Switch

PRT-14219
1.5

This is a simple 2xAAA battery holder that can be adapted to almost any project that can utilize AAA alkaline batteries. This little guy is a revised version of the battery holder we already carried, with the issue of the metal contact resolved.

On top of the products listed in today’s post, we have quite a few smaller “Ding and Dent” items newly available. You can find them on the New Products page or in our “Ding and Dent” category. Be sure to check back in with us next week for even more new products! We’ll see you then.

comments | comment feed

Getting started with the micro:bit - Making a temperature gauge

$
0
0

As we continue with the micro:bit series, we look at another onboard feature: the temperature sensor. Interestingly, there is no separate chip for the temperature sensor. Instead, we read from the temperature sensor built into the main processor (nRF51822). While it was originally intended for detecting overheating, we can use it to get an idea of the ambient temperature (just make sure you’re not taxing the processor, as you’ll really start throwing off the readings with the extra heat).

In addition to reading temperatures, the micro:bit is capable of controlling small servos. We can use alligator clips to make connections to the pads or use #4–40 screws to more permanently attach wires. I say “small servos” because the sub-micro servos seem to function with the provided 3–3.3V from the micro:bit. If you need better torque (and actually want to operate the servo in the specified voltage range), you’ll need to find another power source that can provide 4.8–6V.

That being said, the small servos (even at 3V) seem to perform adequately for moving small loads, such as Popsicle sticks and cardboard. In the video, you can see that I glued a Popsicle stick to the servo’s arm and mounted it to a cardboard backing to create a more visually appealing temperature gauge.

Because I love the idea that I can share an interactive version of my code complete with simulator, here is the temperature gauge program from the video:

The micro:bit is still on pre-order, but you can click here to learn more about it.

For anyone who has used servos with students in the classroom, clubs, etc., what kinds of projects have worked well? What materials (e.g., cardboard) do they enjoy using with the servo? Please share your thoughts in the comments below.

comments | comment feed

IoTuesday: DIY IoT LED Weather Visualizer

$
0
0

A few weeks ago, my coworker Blake approached me with the idea of building a weather visualizer inspired by the beautiful Rocky Mountains. The idea was to make an indoor visual display that would imitate the look and feel of the current weather outside.

Blake had a strong idea of how the project should look. He stained reclaimed wood different colors to build a mountain scene based on the view from our office. Then he handed it off to me to add the electronics and write the program. The sky was the main area where the weather would be displayed, so I added two addressable LED strips— one under a lip at the top facing downward, and one hidden behind the back mountain range facing upward. These two strips project light onto the sky area, causing a different visual effect with each animation. I also added an LED strip behind each of the lower mountains to add a small amount of ambient light, which will help define the mountains in low light.

alt text

Then I worked on designing LED animations for several weather patterns: sunrise, sunset, rain, snow and clear skies. I built each of these based on images I found online of the Rocky Mountain sky during different local weather patterns.

In order to trigger the animations according to weather events, I used the Weather Underground service for IFTTT to pull and publish local weather data to my Particle Photon. I wrote a program to my Photon that will call the LED animations whenever IFTTT publishes a new weather event.

alt text

If you are interested in making a version for yourself, feel free to grab my code here:

//IoT LED Weather Visualizer by Melissa Felderman for SparkFun Electronics
// This #include statement was automatically added by the Particle IDE.

#include "Particle.h"
#include "neopixel.h"

SYSTEM_MODE(AUTOMATIC);

// IMPORTANT: Set LED pixel COUNT, PIN and TYPE
#define PIXEL_PIN D2
#define PIXEL_COUNT 210
#define PIXEL_TYPE WS2812B

//setup LED strip
Adafruit_NeoPixel topStrip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

//array for even pizels for animation
int evenPixels[] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50};

void setup() {

  //initialize LED strip
  topStrip.begin();
  topStrip.show();

  //set up functions, sun for seun events, conditions for changes in weather conditions
  Particle.function("sun", sun);
  Particle.function("conditions", conditions);


}

void loop() {


}

//sun function
int sun (String value) {

  //variables for animations
  int firstStripEnd = 48;
  int secondStripStart = 49;
  int secondStripEnd = 107;
  int thirdStripStart = 108;
  int thirdStripEnd = 158;
  int fourthStipStart = 159;
  int fourthStripEnd = 210;
  int secondStripThird = 19;
  int secondStripFifth = 11;

  //sunset animation
  if (value == "sunset") {
    for ( int i = 0; i < firstStripEnd / 6 ; i++) {
      topStrip.setPixelColor(i, 30, 0, 255);
    } for (int i = firstStripEnd / 6; i < firstStripEnd / 6 * 2; i++) {
      topStrip.setPixelColor(i, 40, 0, 255);
    } for (int i = firstStripEnd / 6 * 2; i < firstStripEnd / 6 * 3; i++) {
      topStrip.setPixelColor(i, 60, 0, 255);
    } for (int i = firstStripEnd / 6 * 3; i < firstStripEnd / 6 * 4; i++) {
      topStrip.setPixelColor(i, 90, 0, 255);
    } for (int i = firstStripEnd / 6 * 4; i < firstStripEnd / 6 * 5; i++) {
      topStrip.setPixelColor(i, 120, 0, 255);
    } for (int i = firstStripEnd / 6 * 5; i < firstStripEnd; i++) {
      topStrip.setPixelColor(i, 130, 0, 255);
    }

    for (int i = secondStripStart; i < secondStripStart + secondStripFifth; i++) {
      topStrip.setPixelColor(i, 200, 50, 75);
    }

    for (int i = secondStripEnd - secondStripFifth; i < secondStripEnd; i++) {
      topStrip.setPixelColor(i, 200, 50, 75);
    }

    for (int i = secondStripStart + secondStripFifth; i < secondStripFifth * 2 + secondStripStart; i++) {
      topStrip.setPixelColor(i, 255, 100, 0);
    } for (int i = 86; i < 97; i++) {
      topStrip.setPixelColor(i, 255, 100, 0);




    } for (int i = secondStripFifth * 2 + secondStripStart; i < secondStripFifth * 2 + secondStripStart + 14; i++) {
      topStrip.setPixelColor(i, 250, 250, 50);
    }
    for (int i = secondStripStart + 22; i < secondStripStart + 26; i++) {
      topStrip.setPixelColor(i, 255, 150, 0);
    }

    for (int i = 83; i < 87; i++) {
      topStrip.setPixelColor(i, 255, 150, 0);
    }



    for (int i = thirdStripStart; i < fourthStripEnd; i++) {
      int bright = 10;
      topStrip.setPixelColor(i, bright + 17, bright + 10, bright);
    }
    topStrip.show();
    delay(100000);

  }
  //sunrise animation
  if (value == "sunrise") {
    for (int i = firstStripEnd / 3; i < firstStripEnd / 3 * 2; i++) {
      topStrip.setPixelColor(i, 90, 90, 100);
    } for (int i = 0; i < firstStripEnd / 3; i++) {
      topStrip.setPixelColor(i, 140, 140, 150);
    } for (int i = firstStripEnd / 3 * 2; i < firstStripEnd; i++) {
      topStrip.setPixelColor(i, 140, 140, 150);
    }


    for (int i = secondStripStart + secondStripThird ; i < secondStripEnd - secondStripThird; i++) {
      topStrip.setPixelColor(i, 255, 255, 100);
    } for (int i = secondStripStart; i < secondStripStart + secondStripThird; i++) {
      topStrip.setPixelColor(i, 255, 255, 25);
    } for (int i =  secondStripThird * 2 + 1 + secondStripStart; i < secondStripEnd; i++) {
      topStrip.setPixelColor(i, 255, 255, 25);

    } for (int i = secondStripStart + secondStripThird + 5; i < secondStripEnd - secondStripThird - 5; i++) {
      topStrip.setPixelColor(i, 255, 255, 150);
    }


    for (int i = thirdStripStart; i < fourthStripEnd; i++) {
      int bright = 30;
      topStrip.setPixelColor(i, bright + 20, bright + 20, bright);
    }
    topStrip.show();
    delay(100000);
  }
}

//conditions function
int conditions (String value) {

  //variables for animation
  int firstStripEnd = 48;
  int secondStripStart = 49;
  int secondStripEnd = 107;
  int thirdStripStart = 108;
  int thirdStripEnd = 158;
  int fourthStipStart = 159;
  int fourthStripEnd = 210;
  int secondStripThird = 19;
  int secondStripFifth = 11;

  //rain animation
  if (value == "rain") {
    for (int i = 1; i < 49; i++) {
      int bright = random(50, 70);
      topStrip.setPixelColor(i, bright, bright, bright);

    }
    for (int i = 50; i < 107; i++) {
      int bright = 20;
      topStrip.setPixelColor(i, bright, bright, bright);

    }
    topStrip.show();



    int rainDrop = evenPixels[random(0, 26)];

    topStrip.setPixelColor(rainDrop, 100, 100, 120);
    topStrip.show();
    delay(500);
    topStrip.setPixelColor(rainDrop, 0, 0, 0);
    topStrip.show();


    for (int i = thirdStripStart; i < fourthStripEnd; i++) {
      int bright = 10;
      topStrip.setPixelColor(i, bright + 10, bright + 10, bright);
    }

  }
  //snow animation
  if (value == "snow") {
    for (int i = 1; i < secondStripEnd; i = i + 2) {
      int bright = random(150, 250);
      topStrip.setPixelColor(i, bright, bright, bright);

    }
    for (int i = 0; i < secondStripEnd; i = i + 2) {
      int bright = random(50, 100);
      topStrip.setPixelColor(i, bright, bright, bright);

    } for (int i = thirdStripStart + 1; i < fourthStripEnd; i = i + 2) {
      int bright = random(150, 230);
      topStrip.setPixelColor(i, bright - 20, bright, 255);

    }
    for (int i = thirdStripStart; i < fourthStripEnd; i = i + 2) {
      int bright = random(50, 100);
      topStrip.setPixelColor(i, bright - 20, bright, 255);

    }

    topStrip.show();


    delay(100);

  }
  //clear animation
  if (value == "clear") {
    for (int i = PIXEL_COUNT / 3; i < PIXEL_COUNT / 3 * 2; i++) {
      topStrip.setPixelColor(i, 200, 200, 255);
    } for (int i = 0; i < PIXEL_COUNT / 3; i++) {
      topStrip.setPixelColor(i, 150, 150, 255);
    } for (int i = PIXEL_COUNT / 3 * 2; i < PIXEL_COUNT; i++) {
      topStrip.setPixelColor(i, 150, 150, 255);
    }
    for ( int i = secondStripStart; i < secondStripEnd; i++) {
      topStrip.setPixelColor(i, 200, 200, 200);
    }
    for (int i = thirdStripStart; i < fourthStripEnd; i++) {
      int bright = 10;
      topStrip.setPixelColor(i, bright, bright, bright);
    }
    topStrip.show();

  }
  //cloudy animation
  if (value == "clouds") {

    for (int i = 0; i < secondStripEnd; i++) {
      topStrip.setPixelColor(i, 30, 30, 30);
    } for (int i = thirdStripStart; i < fourthStripEnd; i++) {
      topStrip.setPixelColor(i, 10, 10, 10);
    }

  }
}

Please note: This is certainly not the most efficient or elegant program for addressing LEDs, but it works beautifully for these purposes. Please feel free to share how you would address the LEDs in the comments below.

You will need the following supplies to build the electronic component of this project:

Particle Photon (Headers)

WRL-13774
19
24
DC Barrel Jack Adapter - Female

PRT-10288
2.95
LED RGB Strip - Addressable, Bare (5m)

COM-12026
99.95
Electrolytic Decoupling Capacitors - 1000uF/25V

COM-08982
0.35
1
SparkFun Photon ProtoShield

DEV-13598
2.5
2

The circuit is super simple and is illustrated in the diagram below.

alt text

Having a hard time seeing the circuit? Click on the wiring diagram for a closer look.

The applet recipe is simple on IFTTT. For ‘this’ select the Weather Underground service and then the weather event that you would like your display to react to. For ‘that’ select the Particle ‘Call Funtion’ service. Select your Photon and function name in the first field, and then add the value that you would like to pass through in the second.

alt text

Share your thoughts and favorite weather projects on Facebook, Twitter and in the comments below!

comments | comment feed

Hardware Hump Day: Air Quality Measurements with the CCS811

$
0
0

If you’ve been keeping up with the stream of experimental products coming out of SparkX over the past several months, you may have recently seen the CCS811 Air Quality Breakout go by. The CCS811 is a tiny part that reports air quality as a function of the total Volatile Organic Compounds (VOCs) detected. We thought this was a pretty cool part, so this week it earns its wings as a full-fledged SparkFun storefront product. To celebrate, I threw together a little project and did some research on VOCs and “CO2 Equivalent Units.”

alt text

What’s a VOC?

Volatile organic compounds are more or less what they say they are: organic (carbon-containing) compounds that exhibit the property of volatility. Substances can be said to be volatile if they have a very low boiling point, and therefore tend to readily escape into the air at room temperature. The term encompasses a pretty huge collection of materials, including several produced by the human body — every time you exhale, you produce VOCs. Most of the scents and odors that you smell are VOCs, and although many are harmless in normal concentrations, there are also many that are harmful to people and/or the environment.

Day to day, we encounter the highest concentrations of VOCs indoors. Paint, carpets, cleaning materials, machines, people and pets all contain and release VOCs and they tend to accumulate in enclosed spaces without proper ventilation. Human-made (or anthropogenic) VOCs are regulated by law for just this reason.

The health effects of VOCs can be difficult to study because they tend to cause cumulative damage over years of moderate exposure. They don’t pose a significant health risk for normal people living in homes with proper ventilation, but indoor air quality is something worth thinking about. Some specialized HVAC systems even contain sensors to detect rising VOC levels and turn on fresh-air ventilation or air scrubbers.

The legal definition of VOCs, on the other hand, can be harder to nail down. They tend to encompass only a subset of chemically-defined VOCs and vary from country to country depending on the purpose of the legislation where the definition is found. In the US, for instance, many legal definitions of VOCs are concerned specifically with environmental precursors to smog, whereas in Canada the emphasis is placed more widely on substances affecting air quality.

CO2 Equivalent Units

One measurement that causes a lot of confusion is “Equivalent CO2.” The CCS811 will report equivalent CO2 in parts-per-million, but that number can be a little bit deceptive. It’s important to recognize that the CCS811 cannot measure CO2 and that the “equivalent CO2” being reported by the CCS811 has nothing to do with actual CO2 present in the area. So why the heck is it called “CO2 Equivalent Units” and why would anyone need it? The answer comes down to the use of indoor air quality sensors — like the CCS811 — in HVAC control.

Building ventilation, it turns out, is all about occupancy. The more people present in a space, the more CO2 they’re exhaling, and the more ventilation is required. Now, it’s certainly possible to design and operate an HVAC system around the design occupancy of a building or room, in other words the number of people expected to use a space. But this means that you may be wasting energy at times when the building isn’t actually occupied. To solve this problem, many HVAC systems will monitor the concentration of CO2 in a given area in order to calculate the amount of air exchange needed in a scheme called “demand-controlled ventilation.”

Makers of indoor air quality sensors that don’t detect CO2 (in an attempt to market their devices for demand-controlled ventilation systems) have correlated rising CO2 levels in certain environments to rising VOC levels. It’s important to recognize that this is a correlation of the change in levels and not a correlation of the levels themselves: High VOC concentrations are not analogous to high CO2 concentrations. But it can be said that if the VOC concentration of a given space begins to slowly climb above baseline, it probably corresponds to room occupancy and an increase in CO2 (because humans exhale both CO2 and VOCs). Therefore, the manufacturers of these devices report the “CO2 Equivalent Units” with respect to this correlation so that their devices might fit more easily into an existing demand-controlled ventilation scheme.

In my limited research, HVAC experts tend to suggest using real IR-based CO2 sensors in situations where people’s health may be at risk. This doesn’t mean, however, that VOC sensors are unsafe in properly designed systems, or that they don’t have a place alongside CO2 sensors in smart ventilation systems. For instance, VOC sensors can react quickly to non-occupant-related VOC sources and leaking environmental contaminants.

Pocket Air Quality Sensor

To play with this new sensor, and to put myself in the shoes of a ventilation controller, I decided to build a portable readout for the air quality sensor and take it for a walk around the office. To display the readings taken by the CCS811, I used a MicroView, which acted both as the display and the controller to talk to the sensor. The circuit for my project is essentially identical to the one outlined in this tutorial, but I exchanged the MAG3110 magnetometer for the CCS811. As for the code, I simply modified our example code for the CCS811 to include the MicroView library, and used the OLED to print the output values instead of the serial port. If you want to build your own, here’s a list of the parts that I used besides the sensor itself:

SparkFun Logic Level Converter - Bi-Directional

BOB-12009
2.95
67
SparkFun MicroView - OLED Arduino Module

DEV-12923
39.95
37
Break Away Headers - Straight

PRT-00116
1.5
20
SparkFun Solder-able Breadboard

PRT-12070
4.95
12
SparkFun Power Cell - LiPo Charger/Booster

PRT-11231
19.95
12
Lithium Ion Battery - 850mAh

PRT-13854
9.95
1
Jumper Wire Kit

PRT-00124
6.95
7
SparkFun MicroView - USB Programmer

DEV-12924
14.95
5

And here’s what the code looks like after modification:

/*
  CCS811 Air Quality Sensor Example Code
  By: Nathan Seidle
  SparkFun Electronics
  Date: February 7th, 2017
  Modified By: Nick Poole (for use with MicroView)
  License: This code is public domain but you buy me a beer if you use this
  and we meet someday (Beerware license).

  Works with SparkFun CCS811 board https://www.sparkfun.com/products/14181
  Or Combo board https://www.sparkfun.com/products/14241
  Enjoy this code? Buy a board and help support SparkFun!

  Read the TVOC values from the SparkFun CSS811 breakout board and display
  them on the MicroView.

  A new sensor requires at 48-hour burn in. Once burned in a sensor requires
  20 minutes of run in before readings are considered good.

*/

#include <MicroView.h>
#include <Wire.h>

//These are the air quality values obtained from the sensor
unsigned int tVOC = 0;
unsigned int CO2 = 0;

void setup()
{
  uView.begin();        // start MicroView
  uView.clear(PAGE);      // clear page
  uView.setCursor(0,0);
  uView.print("CCS811 Read Example");
  uView.display();

  Wire.begin();

  if (configureCCS811() == false)
  {
    uView.clear(PAGE);
    uView.setCursor(0,0);
    uView.print("Problem with CCS811");
    uView.display();
    while(1);
  }
  else
  {
    uView.clear(PAGE);
    uView.setCursor(0,0);
    uView.print("CCS811 online");
    uView.display();
  }
}

void loop()
{
  if (dataAvailable())
  {
    readAlgorithmResults(); //Calling this function updates the global tVOC and CO2 variables

    uView.clear(PAGE);
    uView.setCursor(0,0);
    uView.print("tVOC: ");
    uView.print(tVOC);
    uView.display();

  }
  else if (checkForError())
  {
    printError();
  }

  delay(1000); //Wait for next reading
}

And what did we learn?

Well, the obvious, really. But before I show you the few readings that I took, there’s something I want to point out. You may have noticed in the comments of the code above that this sensor requires a 48-hour “burn in” period when it’s first installed. Beyond that, every time the sensor is powered on, it requires 20 minutes of “run-in” before the readings are considered usable. At the time that these pictures were taken, the sensor had only burned in for about 15 hours so the readings aren’t necessarily accurate. That said, the relationship of the readings to one another is still pretty telling.

Here’s the sensor sitting inside our office, actually in our production area. I found that readings within the building didn’t vary that widely, probably due to the ventilation system.

A picture of the sensor display in our production area

It may be hard to make out but we’re reading 532 ppb here. Again, that’s probably not accurate, so this number on its own isn’t that interesting until we compare it to the sensor outside just moments later:

A picture of the sensor display outdoors

Here you can see that we’re reading only 179 ppb just outside the building. That’s about a third of what we measured inside. Pretty cool! But what can we do to push the sensor in the other direction? Oh wait, I know a place chock full of VOCs…

A picture of the sensor display in a paint cabinet

What you’re looking at now is the sensor sitting inside the open door of the Flammable Materials cabinet under my desk. This cabinet has become a storage place for “smelly” materials, flammable or not, and contains things like paints, glues, stains, resins and cleaners… basically all of the household products that contain high concentrations of VOCs. What the sensor says is 1156 ppb, but it hit 1156 and stayed there, taking a minute to recover even after being removed from the cabinet. Referring to the datasheet, we can see that the sensor is supposed to measure concentrations up to around 1187, so it’s probably safe to assume that we saturated the heck out of this sensor. After all, the range of the CCS811 is calibrated to the typical VOC mixture of an indoor environment and my paint cabinet is not a typical indoor environment.

Conclusion

I really enjoyed playing with the CCS811 and I think it’s probably useful for a lot of applications from quantified living to home automation. It’s easy to use and takes very little power to operate. The only downside is the long run-in period, but that’s common for sensors of this type. If you’re interested in measuring indoor air quality, I definitely recommend picking up one of these breakouts, which you can do Friday, and playing with them. Thanks for reading and feel free to reach out in the comments with any questions or suggestions!

comments | comment feed

Introduction to Operational Amplifiers - Making a Case for Analog Electronics

$
0
0

What started out as an introduction to operational amplifiers using LTSpice ended up becoming a two-day expense redesigning the LM386 Audio Amplifier – on the transistor level – and designing a tool for busking (a mini portable guitar amp). I did have fun building LM741 projects, getting into what the electrical characteristics listed on data sheets mean and learning how to replicate them in LTSpice. There’s some information, a few projects, new tips for running simulations in LTSpice and a page full of fun resources to help you get started with op amps.

Busking for Op Amps

If you would like to see how easy it is to build a mini portable guitar amp, head over to the Introduction to Operational Amplifiers with LTSpice tutorial.

Introduction to Op Amps tutorial

comments | comment feed


Getting started with the micro:bit — Making a temperature gauge

$
0
0

As we continue with the micro:bit series, we look at another onboard feature: the temperature sensor. Interestingly, there is no separate chip for the temperature sensor. Instead, we read from the temperature sensor built into the main processor (nRF51822). While it was originally intended for detecting overheating, we can use it to get an idea of the ambient temperature (just make sure you’re not taxing the processor, as you’ll really start throwing off the readings with the extra heat).

In addition to reading temperatures, the micro:bit is capable of controlling small servos. We can use alligator clips to make connections to the pads or use #4–40 screws to more permanently attach wires. I say “small servos” because the sub-micro servos seem to function with the provided 3–3.3V from the micro:bit. If you need better torque (and actually want to operate the servo in the specified voltage range), you’ll need to find another power source that can provide 4.8–6V.

That being said, the small servos (even at 3V) seem to perform adequately for moving small loads, such as Popsicle sticks and cardboard. In the video, you can see that I glued a Popsicle stick to the servo’s arm and mounted it to a cardboard backing to create a more visually appealing temperature gauge.

Because I love the idea that I can share an interactive version of my code complete with simulator, here is the temperature gauge program from the video:

The micro:bit is still on pre-order, but you can click here to learn more about it.

For anyone who has used servos with students in the classroom, clubs, etc., what kinds of projects have worked well? What materials (e.g., cardboard) do they enjoy using with the servo? Please share your thoughts in the comments below.

comments | comment feed

Friday Product Post: A Breath of Fresh Air

$
0
0

Hello there! It’s Friday, and that means more brand new products! We are very happy to bring you two SparkFun originals that you are sure to love. We have developed a breakout surrounding the brand new CCS811 air quality sensor, as well as a more reliable passive infrared sensor that we have dubbed the OpenPIR! Let’s jump in and take a closer look.

What does the VOC say?! ~sigh~ We love 4-year-old references…

SparkFun Air Quality Breakout - CCS811

SEN-14193
29.95

The CCS811 Air Quality Breakout is a digital gas sensor solution that senses a wide range of Total Volatile Organic Compounds (TVOCs), including equivalent carbon dioxide (eCO2) and metal oxide (MOX) levels. VOCs are often categorized as pollutants and/or sensory irritants and can come from a variety of sources like construction materials (paint, carpet, etc.), machines (copiers, processors, etc.) and even people (breathing, smoking, etc.). This breakout is intended for indoor air quality monitoring in personal devices such as watches and phones, but we’ve put it on a breakout board so you can use it as a regular I2C device.

SparkFun OpenPIR

SEN-13968
14.95

The SparkFun OpenPIR is a highly customizable Passive Infrared (PIR) sensor based around the NCS36000 PIR controller. Passive Infrared (PIR) sensors are able to detect motion in a small/local area –– they’re the sensor of choice in security systems, home automation and proximity-sensing applications. The OpenPIR allows you to set the sensitivity, trigger time and pulse mode of the motion sensor so you can tailor-fit it to your application!

That’s it for this post! Be sure to check back with us next week, when we’ll have something big in store that we’re excited to finally reveal! See you then!

comments | comment feed

Getting Started with the micro:bit — Remote Sensor Alarm

$
0
0

Last time, we made a simple temperature gauge using the micro:bit and a servo. Now, we get a little more advanced as we examine two-way radio communication between micro:bits. The good news is that wireless communication is extremely simple using MakeCode.

To have two micro:bits talk to each other over the Bluetooth Low Energy (BLE) radio, you just need to assign a Group Number in code and then use the Radio Send String or Radio Send Value to transmit a message. The receiving micro:bit will call code under the On Radio Received block to do something with that message.

In the video, I first show how to create one program that gets uploaded to two different micro:bits. This simple app can be used to send the string “Yes” or “No” to the other micro:bit. In the second part of the episode, I show how to create a remote sensor that detects light before sending out a message on the BLE channel. The receiving micro:bit displays a static image and plays a simple tune on a tiny speaker whenever it receives that message.

Here is the messenger app. Upload it to two different micro:bits to try sending strings back and forth:


If you’re interested in the remote alarm system, the AlarmSensor can be found here and the AlarmNotifier can be found here.

That concludes my “Getting Started with the micro:bit” series (at least for now). Hopefully, these tips and examples have helped you get an idea of how block programming can work with the micro:bit. What other things would you like to do or see done with the micro:bit? Please share your thoughts in the comments below.

comments | comment feed

IoTuesday: April Project Roundup

$
0
0

I thought I would need to go further back than a month to find five interesting IoT projects. I was wrong. The creativity of all you maker, DIY and project builder types out there continually surprises me. For this week’s IoTuesday post, I’d like to share some slick projects that I stumbled upon. Perhaps they’ll inspire you to build something, too.

Got any other recent IoT projects or news? Share them in the comments!

Hajime: The Worm That’s Securing IoT Devices

Remember the Mirai botnet-based DDoS attack back in October that brought several major sites, including Twitter, to a crawl? The biggest security flaw that allowed Mirai to infect IoT devices (e.g., IP cameras and DVRs) was unsecured telnet ports with default usernames and passwords. Mirai would guess the username and password, implant itself on the device and begin searching for new devices to infect.

While Mirai was used to launch a large-scale denial-of-service attack, a new breed of IoT worm has entered the game. It seems that the worm, named Hajime, is intent on securing your IoT devices. According to Symantec, there is no code in Hajime to launch any sort of attack or denial of service; it just infects your device and closes some ports to make it more resilient to future attacks.

That being said, Hajime does seem to be more robust in that it accepts peer-to-peer commands and not from a single command and control address, which makes the botnet harder to take down. While it would appear the author is a vigilante trying to tackle the ever-growing hurdle of IoT security, will they remain on the side of good in the future? I guess we’ll have to wait and see.

Hackaday is following the Hajime development, so I recommend checking there if you want updates.

Non-Invasive Wireless Light Therapy Glasses for Alzheimer’s Patients

I can’t pass up an opportunity to share projects dealing with assistive technology or electronics used as a potential cure for something so life-altering and pervasive as Alzheimer’s disease.

Hackster user Adellar Irankunda created a set of Wireless Light Therapy glasses based on recent research from MIT that shows that specific light patterns (e.g., 40Hz) for extended periods can help increase memory functions in mice afflicted with Alzheimer’s disease. The article does point out that what works on mice may not work on humans, so we’ll have to see how far this light therapy gets with the FDA.

The glasses use an ESP8266 that allows the flickering light to be controlled over WiFi. In the video, you can see Adellar using a DIY remote control that uses another ESP8266 to access the glasses' interface.

According to Adellar’s blurb on Hackster, he’s 16, which is incredibly impressive. I know I wasn’t making stuff like this at his age.

Amazon Echo-Controlled IR Remote

Raspberry Pi and Alexa IR Remote

Image by MallocArray

There’s probably commercial gear out there already that does something like this, but I know that I’ve been wanting an infrared-blasting add-on to my Alexa ever since Cortana on my XBox really stopped listening to me.

Well, it’s a good thing that MallocArray has created a Raspberry Pi-controlled learning IR remote on Instructables. With a little bit of code, it can respond to Alexa commands, which means I can now change channels and volume (or bedroom fireplace) with my voice. Huzzah.

LoRa Range Testing

Google Earth image of LoRa test drive

Image by Moser

LoRa (short for “Long Range”) is a low-power wireless technology that’s gaining popularity in Europe. LoRa operates in the ISM bands (around 865MHz in Europe and the 900MHz band in the United States), and it promises to provide large areas of coverage (miles) with low data rate, which is perfect for things like weather stations and bus signs.

Hackaday shared a post by Moser, who put together a LoRa pager, combined it with a GPS logger and drove around with it. He compared the LoRa GPS remote logging (red line in image above, which corresponds to moments where the LoRa could report its location back to a base station) to his phone’s GPS (blue line) and found that the maximum range on the pager was around 4.3 miles. In his words: “Not bad for the pager’s 13mm! bad antenna.”

Linger

alt text

Obligatory Cat Photo by Jasper van Loenen

Another one from Hackaday. In this project, Jasper notes that devices like smartphones are constantly searching for WiFi networks they were previously connected to (unless you disable WiFi). Stores and other third parties could use this information to potentially identify you and track your location (some stores are already doing this with your phone’s MAC address).

Jasper’s device, lovingly called “Linger,” collects all the WiFi requests from everyone around you and then continually rebroadcasts their requests, even when they’ve left the vicinity. It’s a genius “noisy” anti-tracking device, assuming that a store or person is really trying to locate you based on your WiFi requests. You could also just turn off your phone’s WiFi, but where’s the fun in that?

comments | comment feed

Hardware Hump Day: One-Day Lightsaber Build

$
0
0

Tomorrow is May the fourth! Once a year, Star Wars fans around the world have set aside a pun day to celebrate their favorite galaxy far, far away, and although I was always more of a Trekkie myself, their enthusiasm is infectious! Besides, these movies are gorgeous in a very particular (and somewhat cheesy) way that makes their universe irresistible to a lot of makers, myself included. It was for this reason that I undertook the sacred task of building my own lightsaber, in the tradition of the Jedi. I gave myself just one day to put this project together, more than enough time (I thought) for a glorified flashlight, and although I managed to pull it off, I have to admit that it was no easy task. So without further delay, here’s how I built my lightsaber in one day:

Step 1: Mystery Electronics

It’s easy to imagine what electronics might go inside of a lightsaber: LEDs for the blade, a speaker to make the signature wooshing noises, some batteries, perhaps some kind of accelerometer if you want to get fancy… and my lightsaber does indeed have all of these things, but I was able to incorporate all of this functionality using a top-secret, brand new development platform that you’ll find out about tomorrow! Sorry, but I’m playing this one close to the chest for today and only giving you a sneak peek of what the platform can do without going into too much detail. What I can say is that wiring the circuit for my lightsaber took about a minute and I didn’t even have to turn on my soldering station. More on this later!

Step 2: A Suitable Handle

Day to day, in the modern world, we encounter a lot of cylinders. At least that’s what you think, until you go looking for something to make your lightsaber handle out of. A lightsaber handle should feel substantial in the hand, but skinny enough to provide a secure grip. It should be strong, but not so formidable that it’s a pain to cut, sand and paint. Eventually, my search for the perfect tube led me to the plumbing section of my local hardware store where I acquired this handsome specimen:

a picture of a plastic slip-joint extension for a sink

Image Credit: Lowes.com

A plastic slip-joint extension for a sink drain, just like the Jedi masters used probably! By cutting a few slots in the sides of the pipe, I was able to fit my electronics inside without resorting to building a 2.5"-diameter lightsaber handle. The bits of electronics that hung out of the sides of the handle could be easily covered up with greeblies later on. With the base of my project in hand, I was ready to move on to the most important bit…

Step 3: The Blade

Of course we all know that plasma blades are essentially Kyber crystal-based directed energy weapons. Unfortunately, Kyber crystals of a suitable size are few and far between in our universe, and I couldn’t risk reversing the emitter matrix… so my lightsaber blade is made from a piece of acrylic tubing. I bought a 3-foot length of rigid acrylic tube from my local hardware store and set about turning it into a plasma blade. I rounded the end of the hollow tube by filling the last inch of the tube with clear resin and then rounding it off with a band saw. Filling the end of the tube was as easy as filling a small mixing cup with casting resin, sinking the end of the tube into the cup, and allowing it to harden.

a photo of some acrylic tube

Image from www.watercoolinguk.co.uk

To get the lighting effects that I was after, I decided to make a triangular tube of addressable light strips by placing three strips face down and covering the backsides with tape to form a sort of hinge which then allowed me to roll them into a triangular prism and bind them together with shrink tube. This stick of LEDs would sit in the center of my acrylic tubing, but it required diffusion.

First, I rolled the LED strips up in some tissue paper, which helped both to diffuse the light and to protect the LEDs from rattling around in the tubing. Then, I coated the entire “blade” in a specialty spray-paint meant to mimic the look of frosted glass. In the end, I still wasn’t able to fully diffuse the individual “dots” of light at full brightness, but I was left with a satisfactory effect for a one day build.

Step 4: Greebling

After my blade and handle were attached with plastic epoxy, it was time to start pulling the whole look together. My first order of business was covering the protruding dev boards, which I did by building small boxes around them out of polystyrene sheet from the hobby shop. For processes like this, it helps to use CA glue and a glue accelerator so you’re not stuck holding a lot of finicky bits in place while they dry. After everything was enclosed, I had a sense of the overall shape of the thing. Luckily, lightsabers are built by their respective Jedi and, as such, are unique to their owner.

an assortment of lightsaber hilts

An assortment of lightsaber hilts (image from: www.quora.com)

This gave me a lot of leeway in the visual styling of my lightsaber, but it helps to stick to the overall feel of the Star Wars universe, which, it turns out, is largely comprised of fins, grids and rings. I cut a few shapes out of acrylic sheet on the laser cutter and artfully super-glued them in place on the plastic pipe. I used black acrylic sheet so that after I painted everything, I could sand through the paint to reveal shiny black underneath on some parts.

Step 5: Paint

Because of the nature of this build, I didn’t get too fancy with the paint. The whole paint job was accomplished using rattle-cans and sandpaper. I can give you a few tips for quick and dirty spray-paint jobs though! First, use a filler primer to hide some of the imperfections in your model. Filler primer, as the name suggests, is a thicker primer that helps fill in scratches and gaps in your model. Next, special effects paints like mirror chrome and gold are your friends, but they won’t do miracles on their own, so be sure to properly sand and prep your model after priming. Finally, you can shine up a dull paint job by sanding it with super-fine wet-dry sandpaper. It won’t remove much paint but it will buff the surface smooth.

Final Results

It’s at this point that I suggest you sit down (possibly for the first time in 10 hours) and admire your work… from a distance if it looks better that way. You’ve finally done it; your very own lightsaber. I gave mine a quick wipe-down with a rag to remove any errant shop-dirt and placed it in a makeshift stand of iron pipe. Is it perfect? Of course not, and there are a lot of things I would do differently on my second build. It won’t compete with the better pieces at a serious sci-fi convention, but it’s better quality than you might see in a seasonal Halloween shop.

picture of the finished project

another picture of the finished project

…I wonder if most Jedi have a drawer somewhere full of old, junk lightsabers that they built over the years. Probably not, but even Jedi can’t get it right on the first try, can they? Anyway, thanks for reading! If you have any questions, I’ll be watching the comments section. May the fourth be with you!

comments | comment feed

Making the SparkX Lab

$
0
0

SparkFun was founded on playing with technology. I was always learning the most when I was pushing the outer edges of what I knew and what I was comfortable with. That’s how SparkFun really started: I was teaching myself PIC programming in 2002 when I set my WARP-13A programmer down on some bits of wire, there was a spark, and $150 worth of gear smoked. It was a fabulous learning experience, and an event that set in motion the founding of an electronics company.

As SparkFun has grown over the past 14 years, my job as founder has been dedicated to running the business. Days were filled with the important stuff like planning, strategy, vision and professional development of the leadership team. However, I was constantly distracted by the new, shiny technology of the day. There are tons of new platforms and sensors to play with! And whenever I should have been working on business things, I found myself trolling through datasheets and searching out new suppliers and manufacturers to work with. So a few months ago I made two changes:

Step 1 - Hire a CEO to run the company. Glenn has been doing a smashing job of concentrating on SparkFun. He’s only been running SparkFun for nine months but it’s felt like the time has zipped by. Under his purview and with his hand on the rudder SparkFun is doing quite well. And I’m ecstatic because…

Step 2 - Get back to engineering.

In February we started the SparkX lab to serve as a focused, experimental product development project. Anyone at SparkFun could apply, and I picked two people to work with me for three months. No email, no meetings, just three people working closely on whatever catches our interest. Sometimes it’s a new quad PIR sensor that we’ve never seen the likes of before. Sometimes we feel like cracking a safe (broadcasting it on YouTube was one of the scariest and dumbest things I’ve done in awhile!). Sometimes we want to experiment with new materials like the encapsulant on the Robotic Finger Sensor. We’ve got the freedom to jump on anything, and we’re having a hoot doing it.

Machines of SparkX

TAZ 6, vacuum oven, vacuum chamber

We move as fast as we can. I think the record for the first SparkX group was nine days from idea to live product. Not bad! We’ve got a few machines to help us including a Taz 6, an OtherMill Pro, a mini vacuum chamber, an oven (for curing silicone encapsulant) and the standard iron/hot-air rework tools.

SparkX OthermillPro

Othermill Pro with various tools of the trade

The OtherMill allows us to quickly proto a PCB and hand solder a rough proto together. It also allows us to explore molding and alternative testing jigs. It’s a really handy little machine that has seen a ton of use.

MLX90393 Magnetometer Breakout

Rough proto of the MLX90393 Breakout

Being able to proto a PCB is a huge advantage and allows us to wrap our heads around a given technology or sensor before we start laying out a production PCB. We can also start on example sketches and libraries using the proto while the parts are inbound.

Tape and reel cart

Tape and reels of common parts. Wheels are the key!

We’ve set up the lab so that it designs, procures and manufactures everything on its own. We don’t get the benefit of the larger SparkFun machines (like pick-and-place and optically-aligned solder paste stencils), but it does mean we can operate on our own schedule. It’s fantastic to be able to focus in on one project from start to finish.

alt text

Qwiic Mux Shield for Arduino getting populated by hand

We’re ordering parts, stencils, PCBs – the whole shebang. We hand stencil the boards (just like in the basement many years ago) and place the parts. Boards take a trip through the SparkFun reflow oven, then are inspected, tested, bagged, tagged and moved over to the SparkFun storefront for shipment.

alt text

The Spectral Sensor from AMS was pretty amazing to work with

Just like the bad old days we’re even taking our own photos, so our apologies if they are subpar compared to SparkFun product photos. Check out the SparkX category to see the current wares.

alt text

Qwiic connectors on the MLX90393 product

As an example of how this type of innovation environment leads to great things, let’s look at the Qwiic system’s origins. After testing a few hundred I2C-based devices, we got really tired of sorting out which wire was SDA or SCL and whether we had the correct voltages. At the same time, we were using the 1mm JST connector on the Robotic Finger Sensor (also an I2C device). It was a moment less Eureka and more head-smacking - why haven’t we done this in the past!? The Qwiic system was born.

You’ll find these four pin connectors on most of the boards SparkX produces from now on, and you’ll start to see them on I2C-enabled SparkFun boards. There are design tradeoffs (no INT pin, but cheaper cables and connectors), but we’ve found the ability to plug in and quickly get a device talking to be a great advantage.

The goal of SparkX is to play and experiment with new things. For the first class of SparkX folks, three months included new materials, processes, suppliers, technologies, working with the local authorities, new music, video production, even the way we check in every day. Whatever comes of SparkX (good, bad or ugly) gets transplanted to SparkFun to make it even better – design review, tech support, documentation, etc. Sometimes it’s a good idea and SparkFun decides to carry it as a normal product (holy smokes the Radiation Sensor was a good find), and sometimes it’s an idea SparkFun should steer clear of (reflowing coin cells makes them explode!). It’s like I get to start SparkFun over and over again, and I’m thrilled!

Last 3 bags from box of 1,000

Last three bags from a box of 1,000

This may look like just a couple poly bags in front of an empty box, but it’s waaay more significant to us. That’s what’s left over from the box of 1,000. Over the past 12 weeks we’ve designed, built and packaged nearly a thousand products. For SparkFun as a whole, this is a drop in the bucket. For me, it’s an incredibly wonderful return to hacking, building and making things.

If you’re into weird, new technologies and products checkout the SparkX products and blog. It’s not for the faint of heart, but it is a sandbox for creative souls. The next SparkX group will be starting soon. If you’ve got an idea for a product or arena we should play in, please let us know.

comments | comment feed

Friday Product Post: Spectacle

$
0
0

Hello, everyone! You are joining us on a momentous day this week. Today we are happy to announce our brand-new product line, Spectacle! Spectacle is a product ecosystem centered around a simple idea: creative people shouldn’t have to learn new skills to use electronics in their projects. You’ve spent years developing the skills you use, and SparkFun wants to recognize that and help you expand your creations to include electronics without requiring you to spend years learning about electronics and programming. If you want even more information about our product line, follow the link below to the Spectacle central hub:

Spectacle Home Page

Without further ado, let’s dive in and take a look at the whole line!

Make a Spectacle out of your next project!

Spectacle Director Board

DEV-13912
24.95

The Spectacle Director Board controls all the actions in a Spectacle project. Though the Director Board doesn’t do too much on its own, it is what communicates directly with SparkFun’s Spectacle programmer and is the primary distribution channel for power and data in the system. To fully utilize the Director Board make sure to pick up one of the Spectacle daughter boards. This is your Spectacle’s connection to the outside world! Needless to say, the Director Board is the must-have part for your Spectacle project and is included in all Spectacle kits (see below).

Spectacle Inertia Board

DEV-13992
19.95

The Spectacle Inertia Board makes it easy to sense motion or orientation with a Spectacle project. The Spectacle Inertia Board is designed to allow your Spectacle to detect whether it is moving or stationary, or whether it is under acceleration. At the heart of each Inertia Board is the trustworthy ADXL345 triple-axis MEMS accelerometer. The ADXL345 is a perfect fit for your Spectacle project when it comes to all things Inertia!

Spectacle Motion Board

DEV-13993
14.95

The Spectacle Motion Board makes it easy to add movement to your Spectacle projects. Each Motion Board can control up to five servo motors, regardless of whether they are standard or continuous rotation type. Designed to make it easy to add simple motions to your Spectacle projects, the Spectacle Motion Board integrates with the rest of the Spectacle ecosystem to make adding motion effects a breeze!

Unlike other Spectacle modules, the Motion Board has a microUSB connector to allow it to be directly powered by an external power supply. This is due to the fact that the relatively slender cables the Spectacle data travels over are not adequate for the large amount of current drawn by larger servo motors or by multiple motors. This board is included in the Spectacle Motion Kit (see below).

Spectacle Audio Board

DEV-14034
14.95

The Spectacle Audio Board allows you to add sound from a microSD card to your Spectacle projects. Each board accepts a microSD card with sounds in .ogg format, and has a 1/8" (3.5mm) audio jack line-level output ready to be amplified. It is important to know that the files used by the Spectacle Audio Board must be in OGG Vorbis format. This free codec has a higher compression ratio than MP3 and, more importantly, can be used without paying a licensing fee to any third-party organization. We use the free, open source program Audacity to convert from whatever the file’s current format is to OGG Vorbis. This board is included in the Spectacle Sound Kit and Spectacle Light and Sound Kit (see below).

Since this board requires an amplified speaker, we recommend the previously released Hamburger Mini Speaker.

Spectacle Button Board

DEV-14044
14.95

The Spectacle Button Board allows you to add input from buttons, switches or other contact-type sensing devices to your Spectacle projects. This is the largest board in the Spectacle line due to its total of nine signal inputs, allowing for a large number of connections to a single module. Designed to bring simple signals from the world into your Spectacle projects, the Button Board provides input for any of your Spectacle projects! This board is included in all four Spectacle kits (see below).

Spectacle Light Board

DEV-14052
14.95

The Spectacle Light Board allows you to add some fairly complex lighting effects to your Spectacle projects in a streamlined manner. Each has connections for you to add addressable LEDs as well as an external power connector. Designed to make it easy to add relatively complex lighting effects to your Spectacle projects, the Spectacle Light Board integrates with the rest of the Spectacle ecosystem to allow you to control lighting effects with ease and comfort. This board is included in the Spectacle Light Kit and the Spectacle Light and Sound Kit (see below).


In addition to the six stand-alone boards, we have developed four kits that include everything you need to get set up!

Spectacle Light Kit

KIT-14170
99.95

The Spectacle Light Kit makes it easy to illuminate your next project at the push of a button!

Spectacle Motion Kit

KIT-14171
89.95

The Spectacle Motion Kit enables you to move and manipulate parts and provides perhaps the easiest possible way to control servos out there.

Spectacle Sound Kit

KIT-14172
99.95

The Spectacle Sound Kit allows you to incorporate sounds, tunes and other effects with very little setup!

Spectacle Light and Sound Kit

KIT-14173
149.95

Finally, the Spectacle Light and Sound Kit combines two of the previous at a discounted price to provide all of the tools you need to make a fantastic array of lights and sounds in whatever fashion you can dream up!

Don’t forget about the programmer!

Spectacle Web Application

You can reconfigure your Spectacle project from any device with a web browser and a headphone jack via the online Spectacle Web Programmer, so making last-second changes is never a problem! Also, no soldering is required to connect Spectacle boards or accessories, so swapping out parts is a breeze.


If you buy individual boards in the Spectacle line, you’ll need some way to hook them up and power your project:

Lithium Ion Battery Pack - 2.2Ah (USB)

TOL-14169
6.95

Power on the go? Why didn’t you ask? We’ve got plenty! These portable, rechargeable 2.2Ah lithium ion battery packs are simple, compact and make for a great way to power your widgets in the field. Best of all, they’re dead simple to operate: just connect your device to the USB-A port on the battery pack and press the power button. A 7-segment LED will alert you to the charge level of the battery and start powering your device. To recharge the battery pack, just plug it into your computer or phone charger using the included USB micro-B cable.

Lithium Ion Battery Pack - 5Ah (USB)

TOL-14167
9.95

This particular battery pack has a 5,000mAh capacity and will source 1,000mA at 5VDC. Additionally, it has a built-in charging cable to charge (or power) whatever device you jack it into.

Audio Cable TRRS - 1ft

CAB-14163
1.5

This is a foot-long white audio cable that has been terminated with two TRRS connectors at each end. TRRS connectors are the 3.5mm audio-style connectors that you see on some phones, MP3 players and development boards (like Spectacle). This common cable will be the major connector you use to hook up your Spectacle project.

Audio Cable TRRS - 3ft

CAB-14164
2.5

If a foot isn’t long enough, we also offer a 3-foot-long audio cable. It is the exact same cable as its sibling above, just two feet longer.

Spade Connector Wire - 3ft, Female (2 Pack)

CAB-14166
1.95

These simple 24AWG wires are terminated with a female insulated spade connector at one end and a braided wire lead at the other. Each wire is 3 feet long and is capable of supporting a high voltage of 300VDC. Each order comes in a pack of two.

These wires are great when used in conjunction with the Spectacle Button Board and our concave arcade buttons!

JST to JST-SM Wire - 1ft

CAB-14165
1.95

Lastly, these JST to JST-SW wires are perfect for hooking up addressable LED strips to our Spectacle Light Board!

Alright, folks, that’s it for this week. We really hope you enjoy the new Spectacle product line; it certainly has been a labor of love for us. Remember, if you have any questions about the line be sure to check out the Spectacle Home Page for more information.

Make something cool? Shoot us a tweet @sparkfun, or let us know on Instagram or Facebook. We’d love to see what project you’ve turned into a Spectacle! See you next Friday with even more new products!

comments | comment feed


Adventures in Science: Arduino Conditional Statements

$
0
0

A few weeks ago, we talked about arithmetic operators in Arduino/C. We’re back with another riveting round of programming basics, and now we’re talking about conditional statements. They’re super important in most programming languages, as they allow you to change how the program flows.

To use conditional statements (and later, loops), we first look at relational operators, which, in their basic form, compare two numbers. For example, does 5 equal 7? Here are the six basic relational operators in C:

OperatorDescription
==Is equals?
!=Is not equals?
>Greater than?
Less than?
>=Greater than or equal to?
Less than or equal to?

In C, these operators return an integer: 1 for true and 0 for false. We can feed these into the conditional statements in order to change the flow of the program:

if ( some relational operation ) {
    if above is true, execute this
} else if ( another relational operation ) {
    if first relational operation is false but second is true, execute this
} else {
    otherwise (both are false), execute this
}

While this is old news for many of you, how would you recommend wrapping these programming basics videos up for someone who might be new to it? Would you prefer to see it in a playlist? As part of a class with homework problems and answers? I’m trying to figure out how to package these into something that could be useful for a beginner, so ideas are welcome! Please share in the comments below.

comments | comment feed

IoTuesday: Using Yahoo's Weather API

$
0
0

Using current weather or forecast data to change a display or provide information to a user in a seamless fashion seems to be popular among IoT projects. I know I’m guilty of it, because, well, they’re nifty.

Most of these rely on API calls to OpenWeatherMap or Weather Underground (Wunderground), and both are great. OpenWeatherMap allows users to build their own weather stations and push data to their servers to be accessed by anyone. Wunderground is owned by The Weather Company and also lets users connect weather stations and contribute to weather/forecast data.

The one downside to pulling data from those two is that you are forced to create an account and use API keys. While I recommend using OpenWeatherMap or Wunderground for most of your needs (they support citizen science contributions!), if you need to obtain weather information without API keys (e.g., classroom), then another alternative exists: Yahoo Weather API.

There are limitations on its use, like noncommercial and 2,000 calls per day, but it still works well for an open API to get weather information. If you click on the link below, you can check out how to craft HTTP calls to the API:

Yahoo Weather API

It relies on a query language called “Yahoo Query Language (YQL)” that works similarly to SQL. If I enter the following into the query box, I can get a 10-day forecast for Boulder:

select item.forecast from weather.forecast where woeid in (select woeid from geo.places(1) where text="boulder, co")

The Endpoint also changes (see screenshot), which gives me an HTTP GET request that I can just paste into my code. Note that you might have to click “Test” a few times to get the correct response to show up instead of a "results": null. The YQL test page seems to be slow as of late.

Yahoo Weather API

Yahoo’s Weather API seems to pull its information from weather.com, which is owned by The Weather Channel, so it’s a fairly reliable source.

It would seem that the Yahoo Weather API was originally intended for website-embedded content, but we’re going to use it for a different kind of embedded content: microcontrollers!

For this demo, you’ll just need a SparkFun ESP8266 Thing Dev Board. Follow the hookup guide to install the Arduino library and copy in the following code (changing ssid and password to your WiFi’s SSID and password, respectively):

#include <ESP8266WiFi.h>

// WiFi config
const char ssid[] = "<SSID>";
const char password[] = "<PASSWORD>";

// Server, file, port
const char hostname[] = "query.yahooapis.com";
const String url = "/v1/public/yql?q=select%20item.condition.temp%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22boulder%2C%20co%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&diagnostics=true";
const int port = 80;

// Timeout
unsigned long timeout = 10000;  // ms

// WiFi Client
WiFiClient client;

void setup() {

  // Init Serial
  Serial.begin(9600);
  delay(100);

  // Connect to WiFi
  Serial.print("Connecting to ");
  Serial.print(ssid);
  WiFi.begin(ssid, password);
  while ( WiFi.status() != WL_CONNECTED ) {
    delay(500);
    Serial.print(".");
  }
  Serial.println();

  // Show we are connected
  Serial.println("Connected!");
}

void loop() {

  unsigned long timestamp;
  int temp;

  // Establish TCP connection
  Serial.print("Connecting to ");
  Serial.println(hostname);
  if ( !client.connect(hostname, port) ) {
    Serial.println("Connection failed");
  }

  // Send GET request
  String req = "GET " + url + " HTTP/1.1\r\n" +"Host: " + hostname + "\r\n" +"Connection: close\r\n" +"\r\n";
  client.print(req);

  // Wait for response from server
  delay(500);
  timestamp = millis();
  while ( !client.available() && (millis() < timestamp + timeout) ) {
    delay(1);
  }

  // Parse temperature
  if ( client.find("temp\":") ) {
    temp = client.parseInt();
    Serial.print("Local temperature: ");
    Serial.print(temp);
    Serial.println(" F");
  }

  // Flush receive buffer
  while ( client.available() ) {
    client.readStringUntil('\r');
  }

  // Close TCP connection
  client.stop();
  Serial.println();
  Serial.println("Connection closed");

  delay(30000);
}

You can change the URL to whatever you’d like from the Yahoo Weather API page in order to, for example, find the temperature in a different city. Here, I’m fetching the current temperature in Boulder, CO. Open a Serial monitor to get the parsed temperature:

Fetching local weather from Yahoo Weather API

What other cool weather-based projects have you seen or would you like to do? Please share your thoughts in the comments below.

comments | comment feed

Hardware Humpday: Be a Spectacle at Graduation!

$
0
0

‘Tis the season to graduate, and we have a great project for grads of all ages! Decorating grad caps has been a trend for years. It helps the graduating individual stand out for their friends and family amongst a sea of identically dressed classmates. I’ve always been a big fan of rhinestones and glitter, but nothing says “LOOK AT ME!” like lights and movement. That’s why I decided to use the new Spectacle ecosystem to build a grad cap that lights up and moves the tassel for me!

alt text

To make your own Spectacle Grad Cap, you will need the following supplies:

Servo - Generic (Sub-Micro Size)

ROB-09065
8.95
7
Spectacle Director Board

DEV-13912
24.95
Spectacle Motion Board

DEV-13993
14.95
LED RGB Strip - Addressable, Bare (1m)

COM-12025
19.95
7
Spectacle Light Board

DEV-14052
14.95
Spectacle Button Board

DEV-14044
14.95
Lithium Ion Battery Pack - 2.2Ah (USB)

TOL-14169
6.95
Concave Button - White

COM-09340
1.95
1
JST to JST-SM Wire - 1ft

CAB-14165
1.95
Audio Cable TRRS - 1ft

CAB-14163
1.5
Spade Connector Wire - 3ft, Female (2 Pack)

CAB-14166
1.95

alt text

Our first step is to build our circuit. One of the most exciting features of the Spectacle ecosystem is that zero soldering is required to put a project together. You can use the audio cables to chain the boards together. One thing we need to pay attention to when building a Spectacle circuit is the order in which we daisy chain the boards. The order of boards in this project is illustrated in the image below.

alt text

Director -> Button -> Motion -> Lights

To put everything together, we will need four individual audio cables. The first will go into your computer or phone’s headphone jack and connect to the Spectacle Director Board’s‘Program’ jack for programming. The second audio cable goes from the ‘Direct’ jack on the Spectacle Director Board to the ‘In’ jack on the Spectacle Button Board. The third goes from ‘Out’ on the Spectacle Button Board to ‘In’ on the Spectacle Motion Board. And the last goes from ‘Out’ on the Spectacle Motion Board to ‘In’ on the Spectacle Light Board.

Now we need to add our parts. Use the Spade Connector Wires to connect two buttons to the Spectacle Button Board (terminals 1 and 3), the JST to JST-SM Wire to connect the LED Strip to the Spectacle Light Board (terminal 2) and the existing servo motor connector to attach to the Spectacle Motion Board (terminal 0).

Programming the Spectacle Ecosystem is a breeze, and you don’t need to have any programming experience to make your project work! Let’s walk through the steps of programming this cap. The one thing to keep in mind is the order in which we daisy chained our boards. The program that we build will call the boards in the same order.

First we need to go to the Spectacle Web App on your browser — mobile or desktop — and press ‘ADD A BOARD.’

alt text

Select ‘BUTTON’.

alt text

Click the ‘ACTION’ button.

alt text

Click ‘ADD AN ACTION’.

alt text

Select ‘Action while Holding,’ hit ‘ADD AN ACTION’ again, and then select ‘Latch on / Latch off.’

alt text

alt text

Fill in the fields accordingly and hit ‘GO BACK.’

alt text

Select ‘ADD A BOARD’ again.

alt text

Select the ‘MOTION BOARD’.

alt text

Select this ‘action’ button.

alt text

Click ‘ADD AN ACTION’.

alt text

Select ‘Toggle Position’.

alt text

Fill in the fields as follows and then select ‘GO BACK’.

alt text

Select ‘ADD A BOARD’ again.

alt text

Choose the ‘LIGHTS’ board.

alt text

Hit the ‘action’ button.

alt text

Select ‘ADD AN ACTION’.

alt text

Choose the ‘Theater Chase’ option.

alt text

Fill out the fields as illustrated below. Choose your school color in the color field and count out the LEDs on your strip for the pixels field. Then hit ‘GO BACK’.

alt text

The program is complete, and you are ready to upload to your Spectacle Director Board. Select ‘INSTALL SCRIPT’.

alt text

Follow the steps to upload your program.

alt text

The last part of building this project is fabrication. In order to fit the parts, you will likely need to build an enclosure. I used laser-cut acrylic for mine, with matte black on top to imitate the look and feel of a grad cap, and translucent on the sides so that the LEDs could emit light without being seen.

alt text

Finally, I arranged the parts inside the enclosure, threading the buttons down to my pockets so I could trigger the actions whenever I wanted without anyone being able to see.

alt text

alt text

alt text

And easy as that, I have a functioning project!

alt text

Congratulations to everyone who is graduating this spring and to their families! Share how you are making a Spectacle of yourself with the Spectacle ecosystem on Facebook, Twitter, Instagram and in the comments below!

comments | comment feed

SparkFun AVC 2017 Updates!

$
0
0

Good nerdly-day to you! We’ve been fielding a lot of AVC questions, so I’ve got an AVC update to share that might clear some of them up. First up, let’s talk about the schedule of events.

For Friday, October 13, there are two things to note. First, the course will be open some number of hours for testing out your gear, calibrating your loops and your GPS, all that stuff. As to the specific hours of availability, we’re not sure yet; we’ll have to let you know a bit closer to the competition. The second thing is that early check-in will be available so you don’t have to sacrifice that tasty continental breakfast and instant coffee day-of at the Days Inn (or wherever). Hey, we’re here for you.

Saturday and Sunday are the main event days. The way this is going to work is a bit different from previous years since we’re going to have two days of competition instead of one. In a nutshell, combat bots and AVC vehicles will be running both days, but you can request which day you want to compete so you don’t necessarily have to be there both days. That frees you up to go check out the rest of the Faire, eat some funnel cake, etc. By the way, registration for AVC does include tickets to Maker Faire for all team members.

OK, let’s talk about the weather for a sec. I know I promised rainbows and unicorns in my last post about this, but let’s be serious. There is a non-zero probability that something will go awry one of the two days, and we need to be ready in case something does. Combat bots are indoors, so they’re fine, but everything else is outside. So, what happens? If it rains, we keep running. If it snows, we keep running (just pretend it’s 2011). If there’s lightning or tornadoes… alright, you got me. We’ll stop for those. But I’m telling you now: Be ready for anything.

As for prizes… we’re still working these out. At the very least we’ll be giving away SFE gear. Cash prizes? Unknown at this time; stay tuned for that.

Lastly, here are some rule changes/clarifications.

For the Speed Demon Class, we have a few:

  • A clearance gap of 36 inches is guaranteed between barrels, but not from the barrels to the wall.
  • The horizontal climbing wall will be constructed from two panels of 4x8-foot OSB, plywood or similar. Panels will be mounted on opposing inclines, meeting at a peak line perpendicular to the track with a rise no greater than 6 inches. No wall element will exceed a 3.75-inch protrusion from the board.

For the Logistics Class, operators may stand no closer than 1 foot from their robot.

For the Rider Class (Autonomous Car Wars), we have a clarification on vehicle dimensions. Vehicles must be less than or equal to 36 inches wide and 62 inches long, but can be any configuration (three wheels, four wheels, etc.). There is no weight restriction.

That’s all for today. Keep checking back for future updates.

comments | comment feed

Hardware Hump Day: Be a Spectacle at Graduation!

$
0
0

‘Tis the season to graduate, and we have a great project for grads of all ages! Decorating grad caps has been a trend for years. It helps the graduating individual stand out for their friends and family amongst a sea of identically dressed classmates. I’ve always been a big fan of rhinestones and glitter, but nothing says “LOOK AT ME!” like lights and movement. That’s why I decided to use the new Spectacle ecosystem to build a grad cap that lights up and moves the tassel for me!

alt text

To make your own Spectacle Grad Cap, you will need the following supplies:

Servo - Generic (Sub-Micro Size)

ROB-09065
8.95
7
Spectacle Director Board

DEV-13912
24.95
Spectacle Motion Board

DEV-13993
14.95
LED RGB Strip - Addressable, Bare (1m)

COM-12025
19.95
7
Spectacle Light Board

DEV-14052
14.95
Spectacle Button Board

DEV-14044
14.95
Lithium Ion Battery Pack - 2.2Ah (USB)

TOL-14169
6.95
Concave Button - White

COM-09340
1.95
1
JST to JST-SM Wire - 1ft

CAB-14165
1.95
Audio Cable TRRS - 1ft

CAB-14163
1.5
Spade Connector Wire - 3ft, Female (2 Pack)

CAB-14166
1.95

alt text

Our first step is to build our circuit. One of the most exciting features of the Spectacle ecosystem is that zero soldering is required to put a project together. You can use the audio cables to chain the boards together. One thing we need to pay attention to when building a Spectacle circuit is the order in which we daisy chain the boards. The order of boards in this project is illustrated in the image below.

alt text

Director -> Button -> Motion -> Lights

To put everything together, we will need four individual audio cables. The first will go into your computer or phone’s headphone jack and connect to the Spectacle Director Board’s‘Program’ jack for programming. The second audio cable goes from the ‘Direct’ jack on the Spectacle Director Board to the ‘In’ jack on the Spectacle Button Board. The third goes from ‘Out’ on the Spectacle Button Board to ‘In’ on the Spectacle Motion Board. And the last goes from ‘Out’ on the Spectacle Motion Board to ‘In’ on the Spectacle Light Board.

Now we need to add our parts. Use the Spade Connector Wires to connect two buttons to the Spectacle Button Board (terminals 1 and 3), the JST to JST-SM Wire to connect the LED Strip to the Spectacle Light Board (terminal 2) and the existing servo motor connector to attach to the Spectacle Motion Board (terminal 0).

Programming the Spectacle Ecosystem is a breeze, and you don’t need to have any programming experience to make your project work! Let’s walk through the steps of programming this cap. The one thing to keep in mind is the order in which we daisy chained our boards. The program that we build will call the boards in the same order.

First we need to go to the Spectacle Web App on your browser — mobile or desktop — and press ‘ADD A BOARD.’

alt text

Select ‘BUTTON’.

alt text

Click the ‘ACTION’ button.

alt text

Click ‘ADD AN ACTION’.

alt text

Select ‘Action while Holding,’ hit ‘ADD AN ACTION’ again, and then select ‘Latch on / Latch off.’

alt text

alt text

Fill in the fields accordingly and hit ‘GO BACK.’

alt text

Select ‘ADD A BOARD’ again.

alt text

Select the ‘MOTION BOARD’.

alt text

Select this ‘action’ button.

alt text

Click ‘ADD AN ACTION’.

alt text

Select ‘Toggle Position’.

alt text

Fill in the fields as follows and then select ‘GO BACK’.

alt text

Select ‘ADD A BOARD’ again.

alt text

Choose the ‘LIGHTS’ board.

alt text

Hit the ‘action’ button.

alt text

Select ‘ADD AN ACTION’.

alt text

Choose the ‘Theater Chase’ option.

alt text

Fill out the fields as illustrated below. Choose your school color in the color field and count out the LEDs on your strip for the pixels field. Then hit ‘GO BACK’.

alt text

The program is complete, and you are ready to upload to your Spectacle Director Board. Select ‘INSTALL SCRIPT’.

alt text

Follow the steps to upload your program.

alt text

The last part of building this project is fabrication. In order to fit the parts, you will likely need to build an enclosure. I used laser-cut acrylic for mine, with matte black on top to imitate the look and feel of a grad cap, and translucent on the sides so that the LEDs could emit light without being seen.

alt text

Finally, I arranged the parts inside the enclosure, threading the buttons down to my pockets so I could trigger the actions whenever I wanted without anyone being able to see.

alt text

alt text

alt text

And easy as that, I have a functioning project!

alt text

Congratulations to everyone who is graduating this spring and to their families! Share how you are making a Spectacle of yourself with the Spectacle ecosystem on Facebook, Twitter, Instagram and in the comments below!

comments | comment feed

Viewing all 2614 articles
Browse latest View live




Latest Images