Snap Circuits Telepresence Robot

by smagoun in Circuits > Robots

3350 Views, 10 Favorites, 0 Comments

Snap Circuits Telepresence Robot

IMG_3636.jpeg
IMG_3638.jpeg

Holidays in 2020 are a little different. My family is spread out around the country, and due to the pandemic we're unable to gather together for holidays. I wanted a way to make grandparents feel included in our Thanksgiving celebration. A telepresence robot like the Double 3 would be perfect, except that it costs $4,000. I wondered if I could build something similar for far less money.

The Snap Circuits® RC Snap Rover® is a remote-controlled rover with electronics that are designed for change and experimentation. It's about the right size to be the base of a telepresence robot, and I figured that I could probably wire it up to be controlled from the web.

If I could mount a tablet on the rover, I'd have a telepresence robot that would let grandparents participate in our celebration! They'd be able to move around the house on their own and interact with different people, instead of being stuck in one place. The novelty might also keep them - and my kids - more interested than a normal video call.

I got the robot working the night before Thanksgiving, and it was a huge hit!

With off-the-shelf electronics and a bit of light carpentry, you too can build a telepresence robot. No soldering required!

Supplies

Hardware

  • Snap Circuits® RC Snap Rover®
    • Note: the 'Deluxe' Snap Rover does not use the same parts and will not work with this guide. If you have the Deluxe Snap Rover, you'll need to purchase a separate Motor Control IC.
  • Snap-to-Pin connectors
  • Raspberry Pi Zero W or other device with programmable GPIOs capable of running NodeJS
  • Case for the Raspberry Pi (optional)
  • GPIO Hammer Headers (female)
  • MicroSD card (4GB or larger)
  • USB battery and Micro-USB cable to power the Pi
  • iPad or another tablet/phone
  • Misc. wood:
    • 1" x 48" wooden dowel, cut to desired height
    • 2x4, approx. 10" long
    • 2 pieces of 1/4" x 1" x 8" moulding
    • 2 pieces of 1x1 or similar scrap, approx. 3" long
  • Small cardboard box to serve as the iPad holder
  • Nylon webbing strap, approx. 6'

Software

Tools

  • Drill with 1" spade bit
  • Hot glue gun
  • Hammer
  • Saw
  • Tape measure / ruler

For the user (grandparents, etc)

Grandpa, or whoever is operating the rover, will need the following:

  • A PC with videoconferencing software (FaceTime, Zoom, etc) and a web browser

OR

OR

  • 2 devices:
    • A phone, tablet, or other device with videoconferencing software, and
    • A second device with web browser that can be used to control the browser while the first device is being used for video

Hardware Selection

To control the rover from the internet I needed a small computer that could both control the rover and act as a web server so that a grandparent could access the rover. The Raspberry Pi Zero W is a perfect fit. It's small, has Wi-Fi, and has plenty of CPU power to run a small web server. Plus it's only $10, which is less expensive than virtually all other hobbyist options. I got my Pi + accessories from the excellent folks at Adafruit.

Preparing the Pi: Headers

IMG_3641.jpeg

The Snap Circuits line of educational toys are like LEGO® bricks for electronics. They let you wire circuits without any soldering, and they're relatively kid-proof. Hobbyist electronics boards (like the Raspberry Pi) provide a number of ways to wire things up, but none of them are compatible with Snap Circuits.

To get around this we'll install a header in the Pi, then use special "Snap to Pin" jumper wires to connect the Pi to the rover without any soldering.

Install the female hammer headers into the Pi using the installation instructions (labeled "for pHATs"). It's important to use the female headers; these allow us to plug in the jumper wires.

Preparing the Pi: Software

rover-interface.png
IMG_3669.png

The Raspberry Pi loads its software from a MicroSD card. We'll install an operating system, then boot the Pi and install a couple other tools plus the control software for the rover.

  1. Use the Raspberry Pi Imager software on your PC to download and install Raspberry Pi OS Lite (32-bit) to the SD card.
  2. Use this tutorial to set up the Pi in 'headless' mode, without using a keyboard or screen. This will get the Pi on Wi-Fi when it first boots.
  3. Enable the Secure Shell (ssh) protocol on the Pi using steps 3+4 from this tutorial on SSH. You can ignore the part about setting up "X Forwarding." This will enable you to log in to the Pi once it gets online.
  4. Move the SD card to the Pi and boot the pi. I used a USB battery to provide power, but for this step you can also use a power adapter or Micro-USB cable to power it from your PC.
  5. Find the Pi's IP address. You'll need to connect to the Pi, and later on to control the rover.
  6. Login to the Pi from your PC. The "Set up your client" section of the SSH tutorial has detailed instructions. You should now be logged in to the Pi:
    ssh pi@<IP>
  7. The remote control software uses a tool called NodeJS. To install NodeJS on the Pi, run the following commands over SSH:
    wget https://unofficial-builds.nodejs.org/download/release/v14.15.1/node-v14.15.1-linux-armv6l.tar.gz
    tar xf node-v14.15.1-linux-armv6l.tar.gz
    export PATH=/home/pi/node-v14.15.1-linux-armv6l/bin/:$PATH
    
  8. You should now have NodeJS installed on the Pi. To test it, run
    node -v
    After a few seconds it should output the version of NodeJS, such as
    v14.15.1
  9. Next we'll install the rover control software, called pi-rover. This will take several minutes:
    sudo apt-get install git
    git clone https://github.com/smagoun/pi-rover.git
    cd pi-rover
    npm install
  10. Run the server software on the Pi:
    node index.js

    If all goes well, you should be able to access the Pi via a web browser on your PC by navigating to port 8080 on the Pi's IP address. For example if your Pi's IP address is 192.168.1.123, go to http://192.168.1.123:8080.

  11. Quit the server software with Ctrl-C.
  12. To run the server whenever the Pi starts up, install the system service file:
    sudo cp pi-rover.service /etc/systemd/system/
    sudo systemctl enable pi-rover.service
    
  13. Once the software is tested and working, shut it down so we can install the Pi in the rover:
    sudo shutdown -h now

Note: If you're going to give access to other people outside your home network (such as grandpa, who is at his own home this Thanksgiving), you'll need to configure your router to send traffic from your public IP address to the Pi. Use a port forwarding guide for support to do this.

Wire the Rover

pi-rover-schematic-1.png

The Snap Rover comes with instructions for wiring up the remote control that comes with the rover kit. We'll adapt these to replace the radio receiver component with the Pi.

The rover manual includes a number of circuits. Start with #1 (the "Night Rover") and rip out everything to the left of column 6. This leaves in place the motor control IC, the (4) 1kΩ resistors on the inputs to the motor control IC, the slide switch, and the wires going to the rover.

Wire the Pi to the Rover

pi-rover-schematic-2.png
IMG_3647.jpeg

If you have a case for the Pi but haven't installed it yet, do so now.

The 40pin connector on the Pi exposes a great deal of functionality. We'll use several of the general-purpose I/O pins (GPIO) to connect the Pi to the rover. It's important to wire this up exactly as shown here; wiring it incorrectly risks damaging the Pi or the rover.

  1. Pins on the Pi are numbered 1-40. It's worth reviewing the pinout to understand how they are laid out.
  2. Use the Snap-to-Pin connectors to connect the following 4 GPIOs to the resistors on the inputs of the motor control IC:
    1. Pin 11 (GPIO 17) to the resistor on LF
    2. Pin 12 (GPIO 18) to the resistor on LB
    3. Pin 13 (GPIO 27) to the resistor on RF
    4. Pin 15 (GPIO 22) to the resistor on RB
    5. Use one more Snap-to-Pin connector to connect a ground pin (Pin 14) from the Pi to the ground (-) on the rover. Though we have 2 separate power supplies (the rover uses 9V and the Pi uses 5V from the USB battery), the two sides are electrically connected and we need a common ground for the circuit to work.

Build the Tablet Mount

tablet-mount-base.png
tablet-mount-base-side.png
tablet-mount-top.png

Mounting the tablet requires balancing several competing needs:

  • The tablet should be high enough in the air that it can interact with standing children and adults.
  • The rover needs to be stable enough to avoid tipping over when driving.
  • The tablet should be mounted as close to the center of the rover as possible to provide stability and a smooth experience while driving.
  • The top part of the rover isn't designed to have anything other than Snap Circuits attach to it, and there isn't a great way to place a load on it without risking damage to the components.

Part 1: Building Bridges

The top of the rover is a plastic grid with bumps designed to secure the electronics components. Placing a load directly on the grid wouldn't be stable, and could damage the grid. I chose to build a sort of bridge over the base with supports that sit between the bumps on the grid, and a dowel mounted to the top of the bridge. I used a nylon strap to secure the bridge + dowel assembly to the rover body.

  1. Cut a 2x4 to about 10" long; it should be longer than the rover is wide, to allow us to strap it safely to the rover.
  2. Cut a pair of 8" pieces from the 1/4" moulding strips. These will help stabilize the tablet mount and prevent it from rocking forward and backward.
  3. Glue the moulding strips to the 2x4. The strips should be spaced so they fit in the grooves of the grid, between the bumps (about 5" apart from each other). The strips should be mounted so that the bottom of the 2x4 sits above the electronics.
  4. Cut a pair of 3" pieces from the 1x1 and glue them to the corners where the moulding strips meet the 2x4. The goal here is to prevent the moulding strips from breaking away from the 2x4 under lateral pressure.
  5. Use the 1" spade bit to drill a hole for the dowel in the top of the 2x4. The hole doesn't need to go all the way through the 2x4; leave about 1/8" of wood intact at the bottom of the hole to support the dowel. The hole should be offset toward one edge of the 2x4, to leave room for the nylon strap on the other side. Glue the dowel into the hole, making sure that it's vertical.

Note: A smaller dowel could work. I chose 1" diameter to ensure it was stiff enough to dampen oscillations. You don't want to make grandpa carsick while he's driving!

Part 2: Tablet Holder

I needed a lightweight yet sturdy way to attach the tablet to the top of the dowel. The tablet itself should be held as close to the dowel as possible so that its weight does not act as a lever trying to tip the rover over. After briefly considering building a box out of a lightweight wood like basswood, I opted for the low-effort approach of cutting up a suitably-sized cardboard box. I found a box that was about 10" x 12" x 1". Cut off one end so the tablet can slide in, and cut a rectangular opening on one side so the tablet screen is visible. Use hot glue to secure the tablet holder to the top of the dowel.

Strap In!

tablet-mount-strapped.png

We need to attach the tablet mount to the rover. The rover isn't designed for this, and there aren't any convenient mounting options. I opted to secure the mount using a long nylon strap wrapped around both axes (not axles!) of the rover. This prevents the mount from tilting forward, backward, or to either side. Make sure that the strap doesn't put pressure on any of the electrical components, and make sure that it's pulled snug and secured so that it cannot come loose.

Start Roving!

IMG_3636.jpeg
IMG_3639.jpeg

Once the tablet mount has been secured to the rover, power up the Raspberry Pi and the rover. Once the Pi is online, log in to the web interface (e.g. http://192.168.1.123) and 'Request control.' You should now be able to drive around! Only one person at a time can drive the rover, so be sure to give up control of the rover before having someone else try.

Instructions for Grandparents

Once the rover is online, call grandpa (or grandma!) on FaceTime. Once they pick up, have them open a web browser and go to your public IP address. Depending on what phone/tablet/computer they're using, they may have to go into "split screen" mode or use a second device.

Once they've loaded the web page they should see the rover's control interface. Have them request control. Now they can interact with the rest of the family as if they were there!

Future Improvements

This design isn't perfect. Some possible improvements:

  • Stabilizers for the rover so that it doesn't tip over as early when bumped by a child, pet, etc.
  • A way to prevent the rover from bumping into things (the driver can't look down!)
  • More finesse in the controls of the pi-rover software. Right now they're hardcoded to something that worked well enough for us.
  • Embed the videoconferencing tool in the web page so that grandma doesn't need 2 devices to use the rover