Author Archives: Rob Reynolds

Get a Better Night’s Sleep with Technology

via SparkFun: Commerce Blog

Sleep (slēp, sliːp) noun The resting state in which the body is not active and the mind is unconscious.

I start this blog with a definition of sleep because it can tend to be somewhat of a foreign concept to engineers and makers (and of course, students). For those of us with a delayed sleep-wake phase who still have to wake up early, sleep can be particularly decurtate.

One of the biggest influences on sleep is the sleep environment, with sound being a major factor. Travelling will naturally create variations in one’s sleep environment, and can wreak havoc on a person’s quantity and quality of sleep. In my house, we have a sound machine in the bedroom to help block out the external sounds around our house. However, as we recently found ourselves traveling to take our daughter off to school, I knew that our 110 V sound machine wasn’t going to be of any use where we were going. Nevertheless, I knew that my wife would sleep better in a strange hotel room with the comfortable and familiar sound to which she had grown accustomed. This seemed like a golden opportunity for a quick and simple project.

Sound-based projects are one of my favorite project categories, so this was really a no-brainer. The only issue I had was this - the idea came to me on Saturday morning, and we would be leaving on Tuesday morning. I wasn’t going to be back at SparkFun HQ before our flight, so I was relegated to only using parts that I had on hand. I was quite certain that I had some sound components, I just wasn’t sure which ones. After a little digging, I found the parts necessary to create an easy, battery powered sound machine.

alt text
There is no way that this was going to make it through airport security looking like this.

The build for this was really straightforward and simple. I just needed something that would play a sound file (WAV, mp3 or OGG, depending on which board I would be using) when it’s powered up. I also figured I should have some way to control the volume. I needed power and an output, namely a speaker, and figured that should be everything.

I first found a SparkFun MP3 Player Shield, but I knew that would require a microcontroller as well, and I didn’t want to use that much space. Luckily right underneath that was a WAV Trigger. This board is capable of playing sounds without the need for a separate microcontroller, so I went with this. As this board requires between 6 V and 15 V to operate, I grabbed a 4xAA Battery Holder and added an inline power switch. I pulled a random speaker out of my drawer of small speakers, and a pair of multicolor buttons for volume control.

I knew that a random assemblage of electronics parts, no matter how scientifically or passionately my explanation of them, would only end with me in that windowless FAA holding room at the airport. To avoid that experience, I designed a quick housing that I could 3D print.

alt text
A lengthy print due to its size, but the design was fast, simple, and effective.

I took measurements of all the components I would be using, tried a few different configurations, and came up with a workable design. It wasn’t perfect, but it was done, and functional - and with my departure fast approaching, done was the goal. The speaker, WAV Trigger, and volume buttons would be built into the top half, the battery holder and power switch built into the bottom half, and a simple pair of headers connecting power to the board. A couple of through mortises and tenons plus a pair of screws would hold the entire thing together.

alt text
The unit traveled well and worked fine, but was larger than I would have liked (1,441-room Rococo palace for scale).

In the end, the traveling sound machine worked just as it should. When I turned it on, the sound of a babbling brook emanated from it. I was able to adjust the volume up and down, outside noise was canceled out, and sound sleep was had by everyone.

However, there are a number of things that I will change, should I decide to make a v2. The first is the size. Since I was relying only on parts I had at home and time was limited, I used much larger parts than I would have chosen given more time and product availability. The WAV Trigger required at least 6 V to operate, sticking me with four AA batteries for my power source. The four AA battery holder shares a similar footprint with the WAV Trigger, but adds a tremendous amount of depth to the project. I also could have gone with a smaller speaker, but again, I was playing “What’s available here in my salvaged parts drawer?”

Secondly, I would spend more than fifteen minutes designing the housing. While this was practical enough, I just left the speaker in a wide open cavern, so the sound output was very echo-y. Since this was meant to be designed for travel - something small that you could just throw into a carry-on bag - the next incarnation will probably use something like the SparkFun Little Soundie Audio Player with a SparkFun Noisy Cricket Stereo Amp and a smaller speaker, powered by a 2Ah Lithium Ion Battery. This would all make for a much smaller build.

Additionally, I would spend a bit more time designing the housing, particularly around the speaker, to create a cleaner output. Of course, if I stay up late working on this, doesn’t that sort of defeat the purpose of a project designed to aid in a good night’s sleep?

comments | comment feed

Combining Art and Technology for Interactive Learning, pt. II

via SparkFun: Commerce Blog

The Hong Kong Heritage Museum, known as one of Hong Kong’s best “lesser known” attractions, houses a number of permanent exhibits as well as ever changing special and touring exhibits, plus an interactive Children’s Discovery Gallery, all covering art, culture and history. One of the museum’s permanent exhibits, titled “Hong Kong Pop 60+,” is where this new installation is housed. If you recall, Alexson was using using the SparkFun Simultaneous RFID Reader, along with three Bare Conductive Touch Boards, to create an interactive book using projection mapping to bring the pages to life. Take a look at a little bit of the project in action on Alexson's Twitter page.

alt text

The book as it is now displayed in the “Hong Kong Pop 60+” exhibit in the Hong Kong Heritage Museum.

In the original design, each page had an embedded RFID tag, shielded on one side with aluminum foil to prevent false reads. However, concerned not only for false positives but false negatives as well - that is, the reader not picking up the tag on a page turn - Alexson decided to double up, using two RFID tags on each page for redundancy.

alt text
Alexson doubled up on RFID tags to eliminate missed events. (Photo credit: Alexson Chu)

Another adaptation from the initial design came about due to concerns over wear and tear. As an interactive part of a permanent exhibit, Alexson knew that this book would be subjected to possibly thousands of page turns, some of them perhaps not as gentle as one would hope. For this reason, the copper tape used for prototyping was replaced with flexible PCBs.

“[For] the ‘touch’ part at the end we switched from using copper tape and conductive ink to flexible PCB for extra robustness,” Alexson told me.

For a project that is going to be handled six days a week with no end date in sight, this is a smart move, and a great example of a designer making adjustments based on the needs of a project and its environment.

alt text
Needing both flexibility and strength, the move was made from copper tape and conductive ink to flexible PCBs. (Photo credit: Alexson Chu)

One thing that Alexson noticed and shared with me was the fact that the Simultaneous RFID Reader would get exceedingly hot when running for long periods of time. As this project will be running for at least eight hours a day, six days a week, this could eventually lead to thermal shutdown, a disappointing museum exhibit, and a curator who’ll think twice when it comes time to find someone to create their next installation. To help keep things (relatively) cool, a heat sink was added, along with a high cfm fan. This is also a good time to emphasize the importance of considering your project’s enclosure. Some chips, while able to run a multitude of high-level tasks, do so with the cost being extremely high operating temperatures. Always make sure that you have sufficient air flow across your project, even if it means creating the space for a heat sink, fan, or as is the case with this project, both.

alt text

”Any sufficiently advanced technology is indistinguishable from magic.” ~ Arthur C. Clarke

While most of us probably won’t get the chance to visit this exhibit in person, just seeing this project, its seamless integration of multiple input and display technologies, and the final product, should be inspiration enough to get the creativity flowing in most of us. If by chance you do find yourself in Hong Kong, you can enjoy this project and many other historical, artistic, cultural and educational experiences at the Hong Kong Heritage Museum.

comments | comment feed

There’s Something About LoRa

via SparkFun: Commerce Blog

In the current age of social distancing and outdoor-only events, a big takeaway for me has been this - for a lot of things, the further away they can be, the better! Of course, that’s because I’ve been dipping my toes into the LoRa pool. LoRa is a wireless technology offering Long Range (see what they did there?), low power, secure data transmission. It’s based on chirp spread spectrum modulation, allowing for communication over long distances without using a lot of power. LoRa fills a big void that existed between the short range communication of wireless local area networks, such as Bluetooth and WiFi, and the much longer range of cellular networks. Originally developed by Cycleo and acquired by Samtech, LoRa and LoRaWAN are now overseen by the LoRa Alliance, a non-profit association that has become one of the largest alliances in the technology sector. The LoRa Alliance supports LoRaWAN (long range wide-area network) protocol as well as ensuring interoperability of all LoRaWAN products and technologies.

alt text
The nonprofit LoRa Alliance is made up of over 500 companies from across the tech spectrum. (Image credit: LoRa Alliance)

Comparing the Two

We see LoRa and LoRaWAN a lot, but are they the same thing? Are they interchangeable? The short answer is no. But for the longer, more technical answer, let’s dig in a bit.

LoRa

LoRa is the network protocol that resides at layer one of the Open Systems Interconnection Model (or OSI model) of computer networking. This layer defines the means of transmitting raw bits over a physical data link between network nodes. LoRa utilizes sub-gigahertz RF bands, including 433MHz, 868MHz (for Europe), 915MHz (for Australia and North America), and 923MHz (for Asia). These radio frequency bands are license-free, falling into the ISM band - Industrial, Scientific and Medical - and are therefore accessible to all of us for things like IoT applications.

LoRaWAN

LoRaWAN, developed and maintained by the LoRa Alliance, is the low-power, cloud-based, medium access control sublayer protocol, acting mainly as a network layer protocol (at layer three of the OSI model) for managing communication between end devices and a central network server. It targets key Internet of Things (IoT) requirements such as bi-directional communication, end-to-end security, mobility and localization services.

How far is far?

The beauty of the LoRa protocol is its range. Practical range for LoRa devices is usually listed at somewhere in the neighborhood of 10 km, with achievable range put somewhere between 15 and 20 km. However, there are a number of factors that can increase or decrease that distance. Things that will play heavily into the performance you get with your LoRaWAN or LoRa peer-to-peer project include things like transmission power mode, network and node-gateway positioning, antenna performance, and probably the most important factor of all - the surrounding environment, or the presence of physical obstructions. LoRaWAN is designed primarily for use outdoors, or in extremely large structures. In an urban setting, you might be lucky to get any more than 2-3 km. In a rural setting, however, range increases dramatically. LoRa’s range is heavily dependent on line-of-sight, so the more wide open your spaces, the better. Here at SFE HQ, we have a great line-of-sight out to the foothills, and we’ve gotten results a bit over 19 km. Of course, we’re using a fairly impressive antenna.

alt text
The right tool for the job. In this case, a very tall, very powerful tool is the right tool.

LoRaWAN global network coverage currently includes 167 countries and stretches across a wide spectrum of markets. In agriculture it’s being used for things like herd monitoring, irrigation control, and soil health monitoring. Utility companies are using LoRa for capacitor bank control, asset visibility, and transformer temperature monitoring, among countless other applications. And cities are finding myriad uses for LoRa networks, such as street lighting, waste management, and parking management. I got to see an early implementation of that last use case when I was in Las Vegas for Defcon several years ago. The Bellagio has, as you can imagine, an enormous parking structure. I’m sure that most of us know the frustration of driving around a parking garage, peering down every aisle hoping to spot an empty space. The Bellagio had installed a system wherein a proximity sensor was placed over each parking spot, along with a red and green LED. Any open spaces were easy to spot thanks to an illuminated green LED over each one, while occupied spaces had a red LED overhead. And perhaps the best part - at the end of each row was a large LED matrix indicating how many open spaces were available in that row. It was such a simple idea, but LoRaWAN made it possible.

As great as this type of application is, it is at its core an application of convenience. But LoRa has the potential to save lives. Consider this as an environmental project: According to research by geographer David Petley of the International Landslide Centre at Durham University, UK, between 2004 and 2010, over 32,000 people were killed in landslides, a figure that Mr. Petley believes is grossly underestimated, and it excludes landslides triggered by earthquakes. Residents of low-lying towns and villages could benefit greatly from an early warning system, and a LoRaWAN system could fit that bill beautifully. By placing sensors in areas around and above the landslide zone and sending information to a central hub, residents could be warned when conditions became unstable a dozen or more kilometers away, allowing them the time to escape lethal danger, saving lives.

alt text
The white dots represent fatal landslides from 2004-2010. LoRaWAN could be a simple and inexpensive way to greatly reduce this number. (Image Credit: David Petley)

I’m planning on putting together a LoRa project or two over the summer, and while they may not be as grand as a lifesaving landslide detection network, they should definitely be worth a look when I’m done. I would encourage you to take a look a LoRa as well, and think of its possibilities. So keep an eye out for my net LoRa project, and until then, Happy Hacking!

comments | comment feed

Combining Art and Technology for Interactive Learning

via SparkFun: Commerce Blog

Here at SparkFun, we have turned out thousands of different boards and components over the years. We’ll see a need in the market, or find a new chip that looks like it may have great potential for our users, and set to work. We’ll design a board for it, create a few simple examples, and release it into the wild. The following week, we’re at it again, and often we don’t get to see what our users do with the products we create. That’s why it’s always nice when we find someone sharing what they’re working on with SparkFun parts.

For me personally, I get extra pleasure when a build using SparkFun parts is part of an artistic project or installation, as that’s the world from which I emigrated into the tech world. That was the case with a project build we recently found on Twitter. Artist and engineer Alexson Chu (@AlexsonChu) is working on an interactive book to go on display at the Hong Kong Heritage Museum.

alt text
Alexson Chu uses RFID tags, electric paint, and projection mapping to create an interactive book exhibit at the Hong Kong Heritage Museum.

According to Alexson’s tweet, the design uses the SparkFun Simultaneous RFID Reader placed under the left side of the book, with aluminum foil shielding under the right side of the book to keep the RFID tags from being read when not wanted. Each page has an embedded RFID tag, so the program knows what page the reader has turned to. The pages also contain interactive “buttons,” able to trigger additional videos corresponding to the initial images on each page. These buttons are created using electric paint from Bare Conductive, which adds no unnecessary thickness to the pages, while still allowing for capacitive touch triggers.

alt text
By using electic paint and copper tape, buttons can be added to each page without adding bulk.

The main interactive content/projector source is written in Unity, which is an ideal programming language for interactive museum installations. For the general concept in builds such as this, Alexson believes that there is great value in combining a physical object with which people, and especially children, can interact.

He says that even in museums, there are too many screens in our lives - he's tired of seeing more exhibits turning to nothing more than a screen-type kiosk, and thinks that by giving children - and all those who frequent museums - a chance to get information and feedback from interacting with something physical, they will take more from that experience than they would from the passive act of just watching a video on the same subject.

This current WIP exhibit is scheduled to open this summer at the Hong Kong Heritage Museum, and we’ll be sure to follow up with Alexson to see the final product in its new home.

Alexson Chu is a member of the group Extended Reality Art, a Hong Kong-based, technology-driven creative collective that creates art installations and experiences by using extended reality, immersive technology, artificial intelligence and machine learning. He is also the Innovation Director for Don’t Believe In Style, a Live Experience Studio that curates and creates live experiences with immersive and experiential technology.

alt text
DBIS combines art and technology to create large-scale immersive and experiential exhibits. (Image courtesy of Don't Believe In Style.)

comments | comment feed

I Scream, You Scream, We All Scream for Silkscreen

via SparkFun: Commerce Blog

Since its humble beginnings in 2003, SparkFun has seen quite a bit of growth. I am thrilled to say that we are continuing to see growth, working with new partners, and releasing more and more new products every week. However, with the number of weekly releases, I know that I for one find myself dropping a video or tutorial, and then rarely having the chance to look back at it to see if anyone has found it informative or useful, because the next crop of products demands my immediate attention. So it’s really appreciated when someone mentions that they still find something useful that we released several years ago.

For example, Chris gave a shoutout over on Twitter to let us know that he is still getting mileage out of Buzzard, the label making web utility for Eagle that Nick Poole designed and built. (You may remember Nick from such SparkFun favorites as the time he tattooed himself, the time he microchipped himself, or the time he tried to set himself on fire.) If you’ve used Eagle to design boards (as we have here at SparkFun for years) then you know that labelling options from within the software are primarily utilitarian. Eagle only supports vector, fixed and proportional fonts, so adding additional fonts isn’t an option - and if you’re like us, you like having options.

alt text
One of our very first boards, and one of our much more recent MicroMod boards. So pretty!

Buzzard allows for raster font labels, giving you, the board designer, much more flexibility in labeling. It can also give your board a much more finished and “designed” look. If you’re looking to put your board into the hands of a larger manufacturing or distribution partner, this will give your board a look that says, “Why no, this board doesn’t appear to have been created by a single person company in their basement,” even if you are a single person company designing and creating boards in your basement (I’m sitting in my basement as I type this).

Having the ability to use raster font labels opens up a whole new world for board labeling, but Buzzard offers more than that. It also affords an extremely simple way to add graphics to your board. Suppose you’re creating a hardware security module (HSM) and want to pay homage to Alan Turing on your PCB. By using the Image Importer in Buzzard, you simply upload an image, adjust the color and sharpness of the silkscreen, soldermask, and copper (if necessary), designate the output size in millimeters, download it, and add it to your board.

alt text
You could also silkscreen a tree-shaped board for a bare PCB LED Christmas Ornament, or a skull-shaped board for Day of the Geek.

We are also aware that in light of (semi-)recent events, a lot of designers are moving to KiCAD. We also have a tool that’s designed to process vector graphics files into device footprints for EAGLE or KiCAD. If this is what you need, take a look at Vulture. It requires a bit of pre-processing of your vector graphics file (we use Inkscape for this - open source!), but all of the steps are beautifully laid out in our GitHub repo.

alt text

And now you know how we're able to add things like the MicroMod logo and OSHW logo to our boards.

So when designing your PCB, remember - no one should have to be bored with your board (not even you!). Use all the tools available to you, and know that Buzzard gives you one more easy-to-use addition to your toolbox!

comments | comment feed

Wake Up to your Own Personalized IoT

via SparkFun: Commerce Blog

There are times when every original intention you had for a blog post winds up on the cutting room floor. This is one such post. It began simply enough - discuss the Internet of Things, create a project, share the project, eat some pie. But the further I got with my project, the deeper I dug, and the further down the rabbit hole I found myself.

The project idea is simple enough - make a device that listens for a keyword or wake word(s), and when it hears it, executes some simple code, sending a command to some other device. There are devices from major companies that do this, and millions of people have them, so why don’t I just buy one of those?

You’ve met me, right?

THE BIG THREE

alt text
Of the three major players in the Smart Speaker market, guess which one is customizable...

For most people, there are three ways to verbally access the Internet of Things. You either say “hey Google,” “hey Siri,” or “Alexa”. But what if you want to change your wake word? Well, if you have a Nest Hub, you could change your wake word to “OK Google.” On an apple device you could switch from “hey Siri” to “OK Siri.” But what if you have an Amazon Echo? Well, the world’s your oyster my friend! You have the freedom to change your wake word to any word you choose, just as long as the word you choose to change it to is either “Amazon,” “Echo” or “computer.”

Now admittedly that last one is great if you want that Star Trek feel around your home, but none of these devices come anywhere near what I would call customizable. I want a device that allows me to set any wake word I want, or even any command word I want. None of this is going to be possible on any of the aforementioned devices, but with a Raspberry Pi and some Python code, you control the wake words, the control words, and pretty much any verbal input you want. Want the name of your estate to be a keyword? No problem. What about your favorite toy from when you were a kid? Or that classmate you had a crush on in third grade? It’s all possible now.

So many options

Having worked with Pete Warden at the ARM AIoT Dev Summit, presenting a session on building a Harry Potter-esque wand using TensorFlow Lite (back when we were traveling and attending events), I knew that chapter 7 of Pete’s book TinyML focused entirely on wake word detection. Having worked with TensorFlow, I also knew that it took quite a bit of time to train a model, and works best using multiple voices to gather audio samples for training.

TensorFlow definitely yields solid results, but I wanted something simpler and less time consuming, so I started hunting around. I knew that I could probably use a speech-to-text service like Google Speech-to-Text, Microsoft Azure Speech, or IBM Watson Speech to Text, but I didn’t want to have to worry about a streaming API. Further down the rabbit hole.

While I know there are more options, I looked into three wake word engines - PocketSphinx, Carnegie Mellon University's open source, large vocabulary, speaker-independent continuous speech recognition engine; Kitt.ai’s hotword detector package Snowboy; and from Picovoice.ai, their wake-word engine Porcupine. All come with pros and cons, and here’s what I learned.

How much time (and how many friends) do you have?

For custom word recognition, training your model(s) will be compulsory, and can be incredibly time consuming. In CMU’s Sphinx training tutorial, they require a full hour of audio data for command and control usage by a single speaker. If your application is going to require command and control usage by multiple people, you’ll need five hours of audio data provided by two hundred separate speakers.

For Snowboy’s Hotword Creator, you only need five hundred of your closest friends to record three samples each. If I can’t muster two hundred people to help me build a wake word for PocketSphinx, chances are slim to none that I’ll be able to come up with two and a half times that many to help me out with Snowboy.

That leaves Porcupine. Apparently PicoVoice’s mantra seems to be “No friends? No problem!” The PicoVoice console simply asks you to type in a wake word phrase, choose a language from the four they offer (English, French, German or Spanish), and hit the “Train Wake Word” button. In about three hours you’ll receive an email letting you know that you can download your data set. However, even before it’s completed, you can test it on the console. I was amazed and how well and how quickly my phrase was recognized.

CPU usage

CPU usage varied quite a bit between the three engines. PocketSphinx, arguably the most flexible of the three, was also the hungriest. Snowboy sat on the high side of center, and Porcupine came in at just 12 percent of what PocketSphinx used.

alt text
When it comes to your wake word engine's CPU usage, less is definitely more.

AUCURACY IS IMPERTANT

What good is speech recognition if your speech isn’t being recognized? False positives and negatives greatly affect performance, and when benchmarked, the results also swung fairly broadly.

alt text
The lower the miss rate, the better (and more impressive) the final project.

Full disclosure, these findings were based on tests run by PicoVoice, so one might think that the results might be skewed, like drug side-effect studies paid for by the manufacturer of the drug. However, they are completely transparent in their methodology, and I was able to find comparable results when the engines were tested by Rhasspy.

AND THE WINNER IS…

Having been created in an educational setting, PocketSphinx is more than just a speech to text engine, it is a research system, so it will most likely continue to improve and expand. For an educational entity, it definitely should not be overlooked. As far as Snowboy is concerned, it is a decent engine, however, KItt.AI announced early last year that they would be shutting down all of their products as of December 31st, 2020. It remains in their Github repository, and can still be used and improved, but any support is now purely community-based. With it’s low CPU usage and extremely high accuracy, PicoVoice’s Porcupine is the engine I chose to use for my project. That being said, there are still some things to be aware of if you decide to use Porcupine for any IoT projects. First, you’ll need to create an account with PicoVoice. I know that there can be some aversion to that, but isn’t that what your Yahoo account is for? Then there’s the decision that comes with your account. PicoVoice offers two options for your account - you can create a Personal Account or an Enterprise Account. Speech models created with a Personal Account cannot be used for any commercial applications. This account type is designed for researchers, hobbyists, tinkerers, and educators. Additionally, wake words created with a Personal Account expire after thirty days. By contrast, an Enterprise Account allows for commercial use and distribution, and the wake words do not expire. However, if you’re a small startup or single-employee company, the $400/month (charged annually) might be a bit steep, but it is important to note that they do offer a “Startup Discount”.

alt text
Using the PicoVoice Console, you can create new wake words simply by typing them into the Phrase field.

MY IoT PROJECT

After all of this digging and researching, I have to say I’m very happy with Porcupine as a wake word engine for my project. Oh right, my project… My IoT project blog post will have to wait for another day, but do stay tuned, as this potential money-making project, which is definitely not a cryptocurrency harvester, promises to be much more fun than training a custom wake word for five hours! And if a bit more research on the front end can yield a more efficient project on the back end, then I believe that it's time well spent.

comments | comment feed