Micropython: Building a Physical Inventory Search Engine

Vinay Keerthi K T (~vinay_keerthi)


Description:

Description

What if your bookshelf could tell you where to find a particular book?

What if it could tell you where to place a new book?

What if your bookshelf was powered by Python?

The problem: I own 1500 books and often need to find where I placed a book.

The over-engineered Solution: Use MicroPython to make the bookshelf light up and tell me where the book I want is when I ask for it.

Who is this talk for?

  • Anyone who has heard of MicroPython and wants to know what someone could use it for.
  • Anyone who has a few Raspberry Pis lying around and wants to know what one could use them for.
  • Anyone who wants to try their hands out on Alexa Skills with Python and build something that could make their lives easier.
  • Anyone who thinks programming is fun.

Outline

  • Introduction: Why I Stuck LEDs on my Bookshelves (5 minutes)
    • Description of the problem (2 minutes)
    • Description of the solution (2 minutes)
  • How to use make an RGB LED strip blink with MicroPython. (5 minutes)
    • Introduction to the NodeMCU and MicroPython (3 minutes)
    • Connecting addressable LED strips to a NodeMCU (2 minutes)
  • Making the Rasperry Pi talk to the nodemcus. (5 minutes)
    • MQTT and MicroPython (2 minutes)
    • Setting Up Mosquito Message Broker on the Raspberry Pi (3 minutes)
  • Setting up a Voice Recognition Service (5 minutes)
    • Using a Raspberry Pi 4 Node Microphone Array (3 Minutes)
    • Using Alexa with Flask-Ask (2 Minutes)
  • The End Result
    • Video Demo (1 Minute)
  • Questions

Details

I began using MicroPython 2 years ago when I first discovered the NodeMCU, a tiny chip that costs about 140 Rs. I've been making tiny things with it, but I quickly realized I wanted to make something bigger. I own upwards of 1500 books. It becomes hard to find a book in my bookshelves sometimes. So I decided to buy a few NeoPixel strips, stick them to my bookshelves, and have the lights blink to indicate the position of a book. Granted, I needed to do a lot of work to get this working. I needed a database for the books, I needed to be able to add, remove and move books around, and I wanted to be able to do this without opening a terminal and sending curl commands.

In short, I wanted to build a voice interface for my bookshelf so that I could do something like ask it where my copy of the Lord of the Rings is and it would light up in response.

In this session I'll describe how you can leverage a few Raspberry Pis, write code in Micropython and use NeoPixels to find items stored in racks or shelves. I'll be describing how I used this approach to make a physical search engine for my bookshelves, allowing me to find where I placed a particular book, where to put a new book and pick what to read next.

Attendees will learn how to begin programming physical systems that leverage Python, and they'll also see how to piece together a production-grade Voice UI that uses Flask.

Hardware used:

  1. Raspberry Pi 3B / Zero W
  2. ReSpeaker 4 node voice array hat
  3. NodeMcu/ESP8266/ESP32 chips
  4. WS8218B LED Strips

No prior knowledge of micropython necessary. All code will be shared on github. The code will be thoroughly documented so beginners can learn how to do this themselves without knowing MicroPython beforehand. Programmers who have used Micropython will appreciate a few patterns I've put together as part of this project to get set up with an ESP8266.

Takeaways

  • Some personally attained best practises when using MicroPython
  • A knowledge of how to get started building things you can use with MicroPython.
  • Some gotchas when dealing with MicroPython and the Electronics involved.

Prerequisites:

  • Intermediate knowledge of Python
  • Some familiarity with Electronics.
  • Basic knowledge of MicroPython

Speaker Info:

Vinay Keerthi is a self taught programmer who works at Visa Inc. as a Sr Software Engineer. He dabbles in MicroPython for fun, and loves building things such as a telegram bot that delivers weather stats, a coffee machine that turns on at 5 AM and, the subject of this talk, a bookshelf that he asks when he wants a book.

Speaker Links:

Github

Website

Section: Embedded Python and IOT
Type: Talks
Target Audience: Advanced
Last Updated: