A First Look at Sony’s Spresense

Arduino Maker News Other Boards Technology
A First Look at Sony’s Spresense

The Spresense development board is Sony’s debut into the Maker market for microcontrollers, and it’s an impressive one.

Features

Sony’s Spresense brings an eclectic raft of features to the table. One we haven’t seen before in a Maker-ready board: it supports GNSS right out of the box. That’s GPS, the Global Positioning System your phone uses to find its location in the world, plus additional geopositioning networks. If Spresense can get a better read on its position by using QZSS (Japan’s system), WAAS (the FAA’s system) or GLONASS (Russia’s system), it’s just as capable of pulling a reading from those satellite networks as the original GPS network.

Its raw computing power leaves most similar boards in the shade, with 6 cores running at 156 MHz. If that weren’t enough, it’s quite the capable audio board, with 8 mic channels and hi-resolution stereo output. Despite all of these features and horsepower, this board sips power.

Recommended Uses

Spresense is built around the chip Sony designed for their smart headphone products. It offers high res audio codecs to play your MP3s, audio input so it can hear voice commands in reply, and AI smarts to understand what it just heard. All with low enough power consumption to run for hours on a battery small enough to tuck behind your ear. With a GPS receiver it knows how far you took it on your morning jog. Those same features make it a fine choice for any invention that needs to take voice commands, play music, or know its changing place in the world.

What jumped out at me most about the Spresense was how much computing power it brought for how little wattage it consumed. With six cores running at 156MHz, Spresense has computing power that almost puts it in the range of single board computers, not microcontrollers. Its multicore design makes Spresense a good fit for running a small neural net for voice recognition or looking for patterns in a camera feed. And since it draws a measly 30mA of power during normal operation, it can run those AI tasks for hours off the smallest of lithium batteries, or a simple pair of AAs.

Spresense+Camera+Screen watches for players to make the gestures “rock, paper, scissors” using a neural net. That’s an impressive level of AI to power off a pair of double-A batteries.

Arduino Compatibility

From the start, Spresense can be programmed using the Arduino editor. (Need a more full-featured OS? You can also program Spresense as a NuttX computer.) There’s a pile of example programs that come along when you download the board files to your Arduino editor, showing how to access the advanced features of the board, with examples for geopositioning, MP3 playback, a sample Deep Neural Network, and more.

For hardware compatibility, look to the Spresense Extension Board. The wee Spresense Main board snaps atop this larger board to offer even more IO pins, in the standard Arduino layout, allowing Spresense to use most of the thousands of Shields created for adding features to Arduinos.

There are more thoughtful features on the Extension board: a micro-SD card slot, a headphone jack, and almost a dozen configuration jumpers allowing you to tweak how the hardware runs. One that caught my eye was the selector for running the extension board in 3.3V or 5V mode. Set to 5V power will maximize the board’s Arduino compatibility, and let it run microservos and other small motors without needing to step up its power. The 3.3V option offers better compatibility with many modern chips you might connect the Spresense to, skipping the need for a level shifter and saving power.

Getting Started With Spresense

Sony’s own documentation covers each step in detail, and will be best for new makers. For experienced Makers who want the turbo version, we offer this guide:

Hardware Setup

    1. As usual before handling circuitboards, touch the nearest grounded thing or uncarpeted floor, to discharge static buildup from your body.
    2. Apply the shade guard to the Spresense’s processor. That is, put the tiny black sticker that came in the Main Board box on the shiny chip on the main board. You could skip this step if you’re going to put your Spresense in an enclosure, but why? Without the shade guard bright lights, such as flash photography, can reboot the board.
    3. If you’re using the Extension Board, find the baggie of four standoffs and gently-but-firmly snap them into the Extension board. Then, with similar care, snap the main board onto these four standoffs. The standoffs line up the slot that connects the two boards.
    4. Plug the Spresense into your computer using its USB micro port. Prefer the port on the Main board to the port on the Extension board.

Software Setup

There are a few extra steps the first time you use your Spresense board with the Arduino editor. After you’ve done these once, the computer will treat the Spresense board as just another model of Arduino.

  1. If you don’t already have the Arduino software installed, download a copy from arduino.cc and install it.
    • Bonus Step for Ubuntu users (OSX and Windows users skip this step): give yourself permission to use the USB connection. At a terminal prompt, enter:
      sudo usermod -a -G dialout $USER
      …then log out and log back in.
  2. Within the Arduino software, download the extra files Spresense needs.
    • Launch the Arduino editor and open the permissions window. (File->Permissions for Windows or Linux users, Arduino->Permissions under OSX.)
    • Copy this, as a single line, into the “Additional Board Manager URLs” field:
      https://github.com/sonydevworld/spresense-arduino-compatible/releases/download/generic/package_spresense_index.json
      Now your Arduino editor knows where to find the files that will tell it how to use the Spresense board.
    • Click “OK” to exit the permissions window.
    • Tell the Arduino software to download those files:
      • In the “Tools” menu, hover over “Board”.
      • Click the top link, “Board Manager…
      • In the Board Manager Window that just opened, type “spresense” in the Search bar at the top right.
      • The list of boards in the window below should narrow to just one, “Spresense”.
      • Click it. An “Install” button appears. Click it. Wait a bit.
      • Congratulations. Your Arduino software now knows how to program a Spresense board.
  3. Tell your Arduino software that it is indeed about to program a “Spresense” model board, and where to send the programs you write to get them onto that board. This is the only step you’ll need to repeat in later sessions, the same as you would before programming any other model of Arduino.
    • Under the “Tools” menu, hover over “Board” and select “Spresense” from the options that appear.
    • Under the “Tools” menu, select the port to send programs to. Hovering over “Port” will give you a list of options. How do you know which one is right? It depends on if you’re on a Windows, OSX, or Ubuntu computer:
      • Windows: unplug the board from your computer, check the Ports list, and close the ports list without selecting one. Then plug the board back in and re-open the Ports list. The Spresense is the new port that wasn’t there the last time you looked.
      • OSX: the port is named “dev/cu.SLAB_USBtoUART”.
      • Ubuntu: with the Spresense plugged in, open a terminal window and enter:
        dmesg | grep “cp21.*attached”
        …the last word of the line the terminal replies with is the name to look for in the “Tools->Port” menu.
    • One last first-time-only step: unlock the Firmware on the Spresense board.
    • Under “Tools->Programmer” select “Spresense Firmware Updater”.
    • Under “Tools” select “Burn Bootloader”. Instructions appear. Follow them.

All done! You shouldn’t need to repeat these steps again so long as you use the same Spresense on the same computer. Repeat the last step if you get a new Spresense, or repeat the first two steps to ready a new computer for Spresense programming.

Trying Out The Board

Now that we’ve got the Spresense ready to program, let’s check out some of those examples we downloaded when we got the board files. Look for the example programs in the Arduino editor’s menus under “File->Examples”. The Spresense-specific examples will show when the editor’s “Tool->Board” setting is set to “Spresense”. You did that a moment ago when you were setting up the board.

One example you can fire up with the main board and no additional hardware is the “GNSS” example. Open it by clicking “File->Examples->GNSS->gnss”. Then load it onto the Spresense by clicking the Upload button, topside of the Arduino editor, second from the left.

You should see messages roll by at the bottom of the Arduino window as it gets ready and then pushes the program over to the board. When it says “reboot” after a few seconds, the program has finished loading onto the Spresense!

GPS readings are now being fed back to your computer, showing your position on the globe in latitude and longitude. You’ll need to open the Serial Monitor window to see them: click “Ctrl-M”. (Command-M on a Mac.) Or just click on the magnifying glass icon in the upper-right of the Arduino window.

The MP3 player example is a good second program to try out. It’s a bit more involved: you’ll want the Extension Board so you can plug in a microSD card loaded with your MP3s, and headphones or a mini speaker to hear the results. Full instructions are at:

http://bit.ly/SpresenseMP3        <——Psst: Capitalization matters!

Next Steps

Given that Sony makes the sensors at the heart of many professional cameras, it should come as no surprise that a camera was among the earliest add-ons offered after launch. It’s none too shabby: 5MP may be more resolution than you’re going to want to keep if you’re feeding the camera data into a neural net, as demonstrated in the included “DNNRT” example program. Other expansion board options available after launch include a tiny Bluetooth Low Energy attachment, and a combination Accelerometer/Compass/Altimeter, in case GPS doesn’t give you enough info on where you are in the world.

For hardware designers, Sony has published the schematics, engineering drawings, and BOM for the Spresense to their public GitHub. It’s a strong indicator of Sony’s intentions for Spresense: they want to make it as easy as possible for you to try out their chips and be impressed. Arduino compatibility in hardware and programming makes using their chips with all the other hardware in circulation as easy as it could be. Open-source hardware files give you a head start taking your invention from a hand-made prototype to a production run of 10 or 10,000.

Discuss this article with the rest of the community on our Discord server!
Tagged

I’m driven by the need to create, travel, and learn new things. I have a history of making clever wooden things, board games, and circuits, and look forward to doing stranger things yet.

View more articles by Sam Brown

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK