Author Archives: Wesley Furuya

Project Canary: Atmospheric Research Takes Flight

via SparkFun: Commerce Blog

Over the last two years, a few SparkFun employees and I have been gathering, every Thursday afternoon, at the St. Vrain Innovation Center up in Longmont, CO. There, we volunteer with the Innovation Center Aquatic Robotics Team (ICART). Recently, with the help of one of my coworkers, QCPETE, the students involved with Project Canary assembled their first custom PCB design. This is the story behind their project and their experience with the design and assembly process.

Project Canary: Atmospheric Research Takes Flight

Written by Davita Bird

In 2017, Janine Aquino and Kate Young of the University Center for Atmospheric Research (UCAR) contracted with the St. Vrain School District Innovation Center to outfit a quadcopter with sensors so that they could conduct low-altitude atmospheric research. From this, the Canary Drone Team was born. For this project, six Innovation Center students (Michelle, Davita, Aidan, Ben, Pi and Morgan), together with team mentor Craig Rahenkamp, were tasked with recommending a quadcopter to purchase, designing and constructing a sensing array that could be attached to the drone and relay data to a ground station, and developing a method for transmitting this data to an on-line database.

alt text

The team ended up choosing a DJI Phantom drone because of its flight time and high load capacity. They then designed the circuitry and created code for an Atmel chip (1284 PA if anyone’s interested) to communicate with five gas sensors (NH3, CO2, O3, H2 and CH4), a LiDAR sensor, a GPS sensor and a BME280 sensor (measures temperature, pressure and humidity), which then transmits all of that data through an XBee radio. The data package is received by a second radio attached to a phone, which then transfers the data to a CHORDS database in the cloud.

In order to attach this sensor suite to the drone, the team had to design its own circuit board for the sensors. This process took about a year, during which one of our circuit board team members graduated (as did most of the rest of the team, darn them all!), leaving a three-and-a-half member team to finish the project. One of the graduates, Michelle, worked remotely to finished the cell phone code during her first year of college, with help from Jim Foltz, a team mentor. The project is nearly done, with the airborne code essentially finished and only testing remaining. The students were very lucky to have Pete, a SparkFun mentor, to help with the process of creating the circuit board and helping Caitlyn and Davita mount the components. Through all the phases of the circuit board creation, SparkFun was instrumental in helping the team have some idea of what to do, not to mention providing the opportunity to see the manufacturing tools in action in the warehouse.

PCB design
Final PCB Design. (Click to enlarge)

in February, Caitlyn and Davita, and their mentor Craig Rahenkamp, went to SparkFun headquarters to surface mount components on our newly designed and printed circuit boards. The first generation of boards ended up getting the guidelines printed as signal traces (oops), so this time the team had a SparkFun mentor check and recheck our student design made by Manas. SparkFun then helped the team get the boards manufactured by sending the design out to JLCPCB. Once delivered, these new boards were taken to SparkX, the R&D/rapid prototyping side of SparkFun.

Student applying soldering paste for the layout process
Caitlyn applying solder paste to one of the boards for the layout process.

At one of their available desks, Caitlyn and Davita put solder paste on them with the help of stencils that were specifically created for the board, and got them ready for the next step: surface mounting the components. For this part, Caitlyn and Davita carefully transported the boards downstairs, where SparkFun does their board assembly. Using tweezers, Caitlyn and Davita placed five LEDs, 19 capacitors, 12 resistors, one inductor and the microchip onto the three boards. Most of these parts were smaller than ants, measuring just 0.3 mm by 0.6 mm. From there, the students were able to use the huge oven to heat our boards and finish the soldering process. While the boards were being heated, the students and mentors were able to watch a pick-and-place machine mount the parts for a panel of SparkFun boards. This machine is used to quickly and accurately mount parts on larger batches of circuit boards.

Assembly Completed
Caitlyn, Davita, Pete and Craig with the completed boards.

Project Canary was able to take a large step forward with the help of SparkFun and the opportunities it offered the team. Going to SparkFun helped enhance students' and the mentor's knowledge on circuit boards, the art and science of soldering, and surface mounting smaller components. It was a really fun, hands-on activity, and it helped give the students ideas for future careers and jobs.

Team Bio:

Our current team is three full-time students (Davita Bird, Caitlyn Fong and Manas Saini), one half-time student (Michelle Tran) and our mentor Craig Rahenkamp. The team has been in existence for two years.

If you are a technical professional and are interested in volunteering, you can reach out to Axel Reitzig, the Robotics and Computer Science Coordinator at the St. Vrain Innovation Center. Additionally, you can visit the St. Vrain Valley School District's Community Strong platform to learn about other opportunities to get involved.

Students in the St. Vrain Valley School District who are interested in working (possibly paid) on projects like this can apply for positions through the St. Vrain Innovation Center.

comments | comment feed

Having Fun and VR Gaming with the Razor IMU

via SparkFun: Commerce Blog

A few years back, just after I first started at SparkFun, Jim released the SparkFun 9DoF Razor IMU M0. Like most products, this wonderful board had its own little quirks, but it got me digging into the example firmware and datasheet for the IMU. If you have never played around or used an IMU before, you should check out this According to Pete video on IMUs, and some extra research online never hurts. Since the release of the SparkFun 9DoF Razor, I have found some really cool applications for the board. I will go over my recent project and a commonly requested task from when I was in technical support.

Serial Output over TX pin and Bluetooth

These are some of the more commonly requested items for this board from technical support. Since the two can be tied together, I decided to provide an example that applies to both.

Serial Output over TX pin

If you haven't done so already, you should start with the 9DoF Razor IMU M0 Hookup Guide. Specifically, the comment in the hookup guide where my coworker Bobby has already detailed the changes needed to output serial data over the TX pin. Otherwise, you should to look over the example firmware and configuration file, and you will notice the changes that need to be made. I have also provided a modified code below for you to download. The baudrate for the serial output is set to 115200bps; this can be changed, but I am using it for the Bluetooth module in the next section.

Adding Bluetooth

To add Bluetooth capability to the SparkFun 9DoF Razor IMU, I am using the BlueSMiRF Silver, a few jumper cables and the Bluetooth USB Module Mini on my PC. Again, if you haven't done so already, you should start with the Using the BlueSMiRF hookup guide. (*I used the BlueSMiRF because we had one lying around, but all modules listed in the BlueSMiRF hookup guide are essentially the same except for the pin layout and range.)

Troubleshooting Tip: Not all computers will be compatible with the BlueSMiRF modules. Mac computers can have issues with them due to the licensing required by Apple for Bluetooth devices.

With the modified code linked above, this is how I setup the hardware connections. There is no need to modify the code, because the default baudrate of the Bluetooth module is the 115200bps already. Additionally, the default password for paring the Bluetooth module is already known to be 1234.

Hardware pin connections
Hardware pin connections between the BlueSMiRF Silver and the SparkFun 9DoF Razor IMU.

Once you have paired your Bluetooth module to your computer and opened a serial terminal for the COM port of that connection, you should see a green light on the Bluetooth module. Double check that the baudrate is set to 115200bps and you should see the output from the SparkFun 9DoF Razor IMU.

Starting on a VR Headset

If you've been part of the recent first-person shooter gaming craze, then you are already familiar with the titles PUBG or Fortnite. What if I told you there was a program that allowed you to VNC to your desktop with minimal lag... and what if that program also allowed you to connect from a Raspberry Pi?

Well, Parsec, a gaming streaming company that came onto the scene a few years ago, has done just that. How does this all work? Well, the short version is that Parsec takes advantage of UDP to reduce lag or traffic needed to verify each frame in a TCP-based connection. From a gaming perspective, each frame marks only a split second on your screen – who cares if it isn't perfect, you will have a new frame in a few milliseconds anyways.

That's right... I have been playing Fortnite remotely using a Raspberry Pi! Well, at least when I don't want to drag my desktop with me. There are a few caveats to this setup: Parsec does have minimum requirements to run, the graphics settings in the game need to be on low, and the frame rates drop to about 30 fps on the Raspberry Pi. However, the game is still playable and if you are up to tweaking the settings, you can get slightly better graphic renderings and frame counts.

You can also use Parsec for other things like streaming your XBox games to your PC and over to a Raspberry Pi!!!

Mic Drop
Mic Drop!

How does this all tie into a VR headset? Well, if you are familiar with the mouse library in Arduino, then you can start to see the light at the end of the tunnel. If you aren't familiar with this library, you can the find details on the Arduino website. However, the quick and fast detail is that the SAMD21 microcontroller on the SparkFun 9DoF Razor IMU M0 can be used to emulate a mouse. Together with the IMU, this means that you can take rotational movements from your head to look around in the game.

Now this is just part of the interface you need to control your character, but it does demonstrate that it can be done with hobbyist electronics. Again, you will want to start with the example firmware code, the 9DoF Razor IMU M0 Hookup Guide and the mouse library. Unfortunately, this is about as far as I have taken this project but if you have anything you'd like to add, please let me know in the comments below; I have also made my code available below for you to continue without me. It is a modified version of Jim's original example firmware adapted to work with the mouse library.

I do have a few things to add:

  • I have only gotten Parsec to run on larger screens. I have had issues trying to run Parsec on smaller 3.5" or 5" screens with lower resolutions. However, I haven't really dug into the issue or reached out to Parsec for help yet.
  • You do need to manually adjust the mouse sensitivity in the Arduino code. I thought of using a potentiometer to possibly dial that in without constant reprogramming.
  • The code takes movements from the gyroscope to create mouse movements. I envisioned using the Euler angles to get more accurate readings without having to home the mouse position, but I would need to dig into how to define an exact mouse position on the screen and adjust for scaling.
  • Once programmed, the SparkFun 9DoF Razor IMU will move to its secondary COM port and will be unavailable for programming. To reprogram the board, you need to force it into the bootloader mode by holding the SCL pin LOW on start up. Then, you can upload new code to it using the available COM port.

To setup Parsec on your Raspberry Pi head over to their web page, or you can follow their instructional Youtube video:

They also have setup guides online:

Once you have Parsec running on your Raspberry Pi and your SparkFun 9DoF Razor IMU coded, all you need to do is plug your Razor into the Pi with a USB cable. You should start seeing the Razor act as a mouse once it is recognized as a device. I usually turn off the Razor until I am logged on to the host computer and up and running on the game. Have fun and enjoy!

comments | comment feed