Author Archives: Rob Reynolds

Simple Wireless Notifier Project

via SparkFun: Commerce Blog

With many families working and schooling from home, letting everyone know when you’re in a video meeting, Zoom conference, or anything that might require a little quiet time, has become a new reality (it certainly is in my home).

I knew I could have spent a little time in Gimp or Photoshop and printed out a sign to simply hang on the door when I was shooting a video. I could have gone really old school and just hung a tie on the doorknob every time I went into a meeting. But both of those would require me to walk all the way up the stairs, and neither would allow me to work on a sweet electronics project. So I dug through my parts drawer to see what I had available, and came up with this notifier.

Rogue video shot by me in my workshop

It’s simple and straightforward. As long as I’m not in a meeting, the LED on the receiving unit remains green, and a small wheel shows Madeline Kahn being very welcoming. When it’s time for me to head into a video meeting I press the red button, and the LED upstairs goes to red, while the graphics wheel spins 180° to show John Candy letting everyone know that they shouldn’t come downstairs.

Everything You Need

Chances are, you may have some or even all of these parts, so pick and choose what you need. Or if you’re like me, get the entire parts list because even if you already have some of them, you can never have too many components in your workshop.

alt text
Didn't bother attaching the blue line from the RGB LED since I'm only using red & green

Both circuits are pretty straightforward. I did do a little soldering to wire up the RGB LED on the receiver, but I made everything else plug and play with jumper wires. I kept the code simple and straightforward, too.

Transmitter Sketch

/*
 * I'm In A Meeting Notifier
 * by Rob Reynolds
 * rob.reynolds@sparkfun.com
 * March 27, 2020
 * I slapped this together during the Covid-19 pandemic as
 * a response to the Shelter In Place rules. I found myself WFH
 * down in my workshop, while my wife was WFH upstairs, and
 * our kids were online schooling at their desks. I put a small
 * transmitter downstairs with me, with a receiver
 * upstairs that would alert everyone, using LEDs and a graphic
 * controlled by a servo, to let them know when I was in an
 * online meeting.
 * 
 * Want to help support open source? Consider purchasing these
 * parts from SparkFun www.sparkfun.com
 * 
 * This code is free, released under the beerware license. If you
 * find it useful, and see me (or any SparkFun employees) at the
 * local, you buy us a round.
 */

 // We use Software Serial to communicate with XBee
 #include <SoftwareSerial.h>

//For Atmega328P's
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2, 3); // RX, TX

// Define pinouts for buttons and LEDs
const int greenButtonPin = 6;
const int redButtonPin = 7;

const int greenLED = 8;
const int redLED = 10;

int greenButtonState, redButtonState;         // variable for reading the pushbuttons


void setup() {

  pinMode(greenButtonPin, INPUT);
  pinMode(redButtonPin, INPUT);

  pinMode(greenLED, OUTPUT);
  pinMode(redLED, OUTPUT);

  Serial.begin(9600);
  XBee.begin(9600);

  digitalWrite(greenLED, HIGH);

}

void loop() {
  // read the state of the pushbutton value:
  greenButtonState = digitalRead(greenButtonPin);
  redButtonState = digitalRead(redButtonPin);

  // check if the pushbutton is pressed. If it is, the buttonState     is HIGH
if (greenButtonState == LOW) {
    XBee.write('O');
    Serial.println("O");
    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, LOW);
    delay(5000);
  }
  else if (redButtonState == LOW) {
    XBee.write('C');
    Serial.println("C");
    digitalWrite(greenLED, LOW);
    digitalWrite(redLED, HIGH);
    delay(5000);
  }

  delay(50);  //

}

Receiver Sketch

/*
 * I'm In A Meeting Notifyer
 * by Rob Reynolds
 * rob.reynolds@sparkfun.com
 * March 27, 2020
 * I slapped this together during the Covid-19 pandemic as
 * a response to the Shelter In Place rules. I found myself WFH
 * down in my workshop, while my wife was WFH upstairs, and
 * our kids were online schooling at their desks. I had a     small transmitter
 * downstairs with me, while there was a receiver upstairs that
 * would alert everyone, using LEDs and a graphic controlled by
 * a servo, to let them know when I was in an online meeting.
 *
 * Want to help support open source? Consider purchasing these
 * parts from SparkFun www.sparkfun.com
 *
 * This code is free, released under the beerware license. If you
 * find it useful, and see me (or any SparkFun employees) at     the
* local, you buy us a round.
 */

 // We use Software Serial to communicate with XBee
 #include <SoftwareSerial.h>

 #include <Servo.h>
 Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0;    // variable to store the servo position

//For Atmega328P's
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2, 3); // RX, TX

//const int greenButtonPin = 6; // Used only on Transmitter
//const int redButtonPin = 7;  // Used only on Transmitter

const int greenLED = 8;
const int redLED = 10;

char msg;

void setup() {

  pinMode(greenLED, OUTPUT);
  pinMode(redLED, OUTPUT);

  myservo.attach(9);  // attaches the servo on pin 9 to the servo object

  XBee.begin(9600);
  Serial.begin(9600);
  digitalWrite(greenLED, HIGH);
  myservo.write(pos);

}

void loop() {
  if (XBee.available() || Serial.available()) {
    if (XBee.available()) {
      msg = XBee.read();
    }

    else if (Serial.available()) {
      msg = Serial.read();
    }
    Serial.write(msg);
   if(msg == 'C')
         {
          for (pos = 0; pos <= 180; pos += 1) { // goes from 0     degrees to 180 degrees
 // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(20);                       // waits 15ms for the     servo to reach the position
  }
  digitalWrite(greenLED, LOW);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(redLED, HIGH);    // turn the LED off by making the voltage LOW
  delay(5000);                       // wait for a second
         }

   else if(msg == 'O'){
     for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
          myservo.write(pos);              // tell servo to go to position in variable 'pos'
          delay(20);                       // waits 15ms for the servo to reach the position
        }
  digitalWrite(greenLED, HIGH);    // turn the LED off by making the voltage LOW
  digitalWrite(redLED, LOW);   // turn the LED on (HIGH is the voltage level)
  delay(5000);                       // wait for a second

   }

  }

  delay(1000);
}

Putting It All Together

I didn’t create any kind of housing for the transmitter. It just sits on my workbench, and I plug it in with a simple power supply. For the receiver, which sits upstairs in plain view of people who aren’t me, I put in a little more effort.

I didn’t go crazy, especially with the housing (note the fine, high quality enclosure!), but I did put in a bit of time on the graphics wheel. I knew straight away that I would be using Madeline Kahn and John Candy, but of course I had to find just the right still and font, and decide which style of drop shadow to use and, well, you get the idea. I used a battery pack for the receiver so I could set it up anywhere without proximity to an outlet. Be aware that a battery pack with a barrel jack won’t give you the power you need, as it wants 7-12 volts. However, the 6 volts from four AA batteries will work just fine if you run it directly into Vin on your RedBoard.

Notifier bouncing back and forth
I could have simply used an LED, but John Candy and Madeline Kahn make everything better!

There are, of course, other ways to build a similar unit, depending what you have in your parts drawer. Perhaps you have a SparkFun ESP32 Thing, or a couple of SparkFun Bluetooth Mates, or maybe even a couple of micro:bits on your workbench. Have you build a project to let others in your home know when you're busy? We want to see it! Tell us your idea or drop us a link in the comments. In the meantime, stay safe, be kind to each other, and Happy Hacking!

comments | comment feed

Making Motion Simple with Servos

via SparkFun: Commerce Blog

I have always been a fan of physical computing. Write some code, upload it to your board, and you can make things move. I particularly enjoy controlled precision movements, and one of the best ways to achieve that is with a servo motor. ( I know, technically it’s a servomechanism, so let’s just call it a servo). We’ve been revisiting servos here at Sparkfun, with things like our Basic Servo Control for Beginners Guide and our Servos Explained page. Servos have been used for steering RC cars and planes, controlling small mechanical arms, and are great for creating animatronic eyes and faces, like these examples by Gary Eillett and Will Cogley.

If you're new to servos, this video will give you a (very) brief overview, and offer a couple of project ideas. From there, think as broadly as you can, and see what projects you can come up with. Perhaps a bipedal robot? How many degrees of freedom can you give it? Perhaps you want an olde-timey looking elevator dial to give you temperature readings. Whatever precision motion your project needs, a good servo will lift your project from good to great!


Start learning all about servos!

A servo is any motor-driven system with a feedback element built in. Servos are found everywhere from heavy machinery, to power steering in vehicles, to robotics and a wide variety of electronics.Check out our Servos Explained page! Learn how servos work, how to control and power them, learn their different types, and more.

Take me there!

comments | comment feed

Don’t Pirate Music, Pirate Audio!

via SparkFun: Commerce Blog

Raspberry Pi boards are amazing and have, since their inception almost a decade ago, always offered an amazing host of features. Audio output from the 3.5mm TRS jack, however, has not been one of them.

Of course, since the current crop of Raspberry Pi models all use HDMI, sound output is great. But what if you’re not using HDMI? Perhaps you’re using a DSI display port with a smaller screen, or you’re running a headless setup with no monitor, but you still want your project to sound great.

The engineers over at Pimoroni have stepped up to fill that void. Using either a PCM5100A DAC (Line Out and Headphone boards) or a MAX98357A DAC (3W Stereo Amp and Small Speaker boards), the Pirate Audio boards use the Raspberry Pi’s I2S output to greatly improve the sound quality coming out of your Pi. All four have a 1.3” LCD to display album art, as well as track and artist info. Just choose the output you want and start pumping out the soundtrack to your life!

comments | comment feed

Badges? We Don’t Need no Stinking – Wait, We Definitely Need this Badge

via SparkFun: Commerce Blog

If you made it to the 2019 Hackaday Superconference, then you’ve already gotten your hands on this year’s amazing badge. If you weren’t able to attend the Supercon this year, then you’ve probably been relegated to staring at it longingly from afar, and this year’s badge is definitely worthy of our admiration.

IndianaJonesSUperConBadge

Gaze at it in wide-eyed wonder! (Original image ©Lucasfilm Ltd)

The brainchild of Jeroen Domburg (Sprite_TM), this year’s badge is in a Gameboy form factor and packs quite a punch. It holds an ECP5 45K LUT FPGA - a huge chip, especially for a badge; 16MiB SPI RAM and 16MiB flash memory; a 480x 320 LCD display;a mono audio output (you’ll need to solder a speaker to J3 to hear anything); IrDA, to allow for a little wireless communication; a PMOD connectors, the standard for peripherals used with FPGAs; a pair of upgraded SAO connectors; a micro-USB connector and an HDMI-compatible connector, in case you want your badge to have an enormous screen; and finally, there’s a 40-pin 2.54 mm female breakout header, and every person who gets a badge will also get a protoboard cartridge that includes a flash memory chip and plugs right in. Oh, and if you really bork your badge, you've got JTAG access as well!

alt text

Each badge includes a protoboard cartridge with an on-board flash memory chip

The FPGA chip has 381 connections, over 200 of which are IO. With this many possible connections, and the speed at which the deadline arrived, typos on the silkscreen were possible. Probable. Inevitable. For example, on the PMOD connector, the pin numbers are in fact upside-down from what the silkscreen indicates. Additionally, on the SAO header, SDA and SDL are flipped as are the GPIO 1 and GPIO 2. Luckily, according to Jereon, all of the lines are just IOs to the FPGA, so you can fix the issue by just picking a different IO line. He also suggests that if you do use any of these lines, you just throw a multimeter on them to make sure that information is being sent where you want it.

alt text

With the rush to production, a few errors were made in the silkscreen. (Image from Jeroen Domburg)

Many people may be hesitant to jump into the FPGA pool because generally you are forced to work in Verilog or VHDL. As a way to make the badge more accessible to those not completely comfortable writing in hardware description language, Domburg basically wrote a microcontroller into the fabric of the FPGA. This makes it possible to program the microcontroller in the soft-core, as if you were programming an ARM, PIC or AVR-based board.

alt text

Nyan cat demos the graphics display, but there is so much more that can be done with it.

The idea behind the Hackaday Supercon Badge is, of course, to hack it. You can find everything you need to get started over on Hackaday's site, and at Sprite_TM's GitHub repo. That will help you set up your gateway, SDK, and show you how to start hacking your badge, but what if you need some ideas as to what to hack? Take a look at the Badge Hacking Ceremony, and get inspiration from some amazing coders developers, and engineers who were there.

comments | comment feed

Getting more from your SparkFun Edge Development Board

via SparkFun: Commerce Blog

Don't forget, we've got new deals live today for our Week of Deals sale. Stock up for 2020 projects and find your last-minute gifts, all in one place!


Last week, SparkFun CTO Kirk and I headed out to the Computer History Museum in Mountain View, CA, to take part in the first ARM AIoT Dev Summit. If you’re not yet familiar with the term, AIoT, or Artificial Intelligence of Things, is a combination of AI and IoT in order to achieve more efficient and smarter connected technologies. The conference included a great array of keynote speakers, including Simon Segars, CEO of ARM; Massimo Banzi, co-founder and CTO of Arduino; and Pete Warden, Google’s Lead Engineer for the TensorFlow AI and TinyML projects. Workshops and tech sessions included things like "Privacy-Focused Voice AI in Intelligent Robotics," "Getting Started with a Self-Driving RC Car" (using only computer vision and deep learning), and "AI Workflow for Large Scale Deployment of Far-Edge ML devices."

alt text

Quick age test - how many items on display here have you owned?

We met some great people and learned a lot, but the main reason we were there was to lead a workshop on "Low-Power AI and Machine Learning," where we showed attendees how to create a magic wand. Working with Pete Warden we made some advances with the SparkFun Edge Board, and simplified the process by building an Arduino core for the board. We lead a full class of fifty-five participants, and while almost everyone was able to finish all of the examples before class ended, even the few who weren’t claimed to have had a great time learning and said they were looking forward to working more with the board when they got home.

alt text

It was standing room only for our Build Your Own Harry Potter Wand with TensorFlow workshop.

If you have an Edge board, or are thinking of picking one up to start dabbling in machine learning and AI, I’ve put together some steps and some links to help you get more from your board using the Arduino IDE, and to teach you how to start training the board on your own.

comments | comment feed

Illuminate your world!

via SparkFun: Commerce Blog

Everyone loves things that blink, flash or light up, and LEDs are a quick and simple way to make that happen. From a simple "power on" indicator to fully animated billboards, the applications for LEDs are seemingly endless. They're also the ideal starting point for physical computing -- a basic blink sketch functions serves the same purpose as "Hello World." If you're just getting into electronics or want to up your LED game, we have some great LED resources, like our Guide to Light-Emitting Diodes, tons of project and design ideas for LEDs, and the video below.

Whether you're looking to beautify your home this winter with some simple luminaries, or you want to make a full album art display to enhance the visuals of your party playlist, LEDs will help you light up your life!

comments | comment feed