Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
Brian Innes edited this page Aug 4, 2017 · 24 revisions

Welcome to the TobyJnr wiki!

TobyJnr is an evolution of TJBot. It is driven entirely by Node-RED running on the Raspberry Pi inside TobyJnr and also has an optional SenseHAT. The SenseHAT allows TobyJnr to be controlled via the joystick on the SenseHAT. It also provides environment and motion sensors and an 8x8 LED panel for feedback to the user.

What's in a name?

TJ Bot => Bot reversed and now shares T - Tob J => add Node-RED (NR) - Tob Jnr => add a y -> TobyJnr

Assembling your bot

This wiki will walk you through the steps needed to build and configure the hardware and software needed to implement your own TobyJnr.

Hardware Required

The list of hardware needed to build TobyJnr is:

  • Raspberry Pi 3 Model B (+ SD Card, + microUSB cable + power supply)
  • NeoPixel Diffused 8mm RGB LED (or other WS2812 based RGB LED with integrated controller - These usually have 4 connectors +, -, DataIn, DataOut).
  • Tower Pro SG90/SG92 Mini Servo (to move the arm)
  • Raspberry Pi SenseHAT
  • Raspberry Pi Camera
  • USB Mini Microphone dongle
  • USB Bluetooth 4 dongle (Yes, the built in bluetooth is not reliable so will be disabled if using a bluetooth speaker)
  • Bluetooth speaker (I have tested with a betron BPS-60 and an EasyAcc Mini portable Bluetooth 4.0 speaker, but others should also work). You can a USB speaker or sound card instead of Bluetooth, so long as it doesn't require the audio signal from the 3.5mm socket - there is a wiki page looking at Sound options for the Raspberry Pi and TobyJnr
  • Connecting wires (Male <-> Female and Female <-> Female)
  • A body for your bot which can be laser cut or 3D printed (see here for details)

Building TobyJnr

Follow the instructions in the above link to get the parts needed to build and assemble the body. If you want to mount a SenseHAT to the front of your bot you will also need a hole at the top of the front face of the head 52mm X 6mm to allow the connector to pass through the head and a couple of M3 bolts with washers and nuts to hold it in place.

Wiring TobjJnr

You may want to defer this step until the basic setup of the Raspberry Pi is complete, as it can be easier to access the additional connectors of the Pi before it is installed in TobyJnr. Wire the TobyJnr according to the above diagram (LED and Servo match instructions for TJBot). The connections for the 3 components are also listed below, showing which Raspberry Pi pin number on the 40 pin connector for each connection:

  • LED : +'ve : pin 1; -'ve : pin 6; DataIn : pin 12
  • Servo : +'ve : pin 2; -'ve : pin 14; Data : pin 26
  • SenseHAT : connect pins with same pin on Pi : 3, 4, 5, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28 There is additional information about wiring the components on the pages dealing with GPIO and the SenseHAT

Setting up the Raspberry Pi

It is now time to setup up the Raspberry Pi. If you are familiar with the Pi then you can do the steps outlined below. If you are new to the Pi, then there is a more detailed set of instructions here.

  • Flash an SD with the latest version of Raspbian
  • Boot the pi and connect your it to the local WiFi - it is possible to use Ethernet if preferred. Ethernet socket of Raspberry Pi is accessible when installed in TobyJnr.
  • run sudo raspi-config to change password, set a hostname for the Pi, set the localisation options to match your language, location and WiFi location and enable SSH, VNC and I2C interfacing options. You also want to set the VNC resolution in the advanced options to 1024x768 or larger. Reboot the pi after setting the options.

Update and additional packages needed

Raspbian contains most of the software needed to run TobyJnr, but there are a few additional packages needed. It is also advisable to make sure you are running the latest available versions of all software, so run the following commands - again, if you need additional assistance please see the more detailed instructions.

Run the following commands in a terminal window, logged onto the Raspberry Pi as standard user pi:

  • sudo rpi-update
  • sudo reboot -n
    the raspberry pi will reboot, so you will need to reconnect once the pi has booted
  • sudo apt-get update
sudo apt-get upgrade -y

  • sudo apt-get autoremove -y
  • sudo apt-get install -y libasound2-dev netatalk
  • update-nodejs-and-nodered
    answer y to confirm the instruction to update Node.js and Node-RED
  • sudo systemctl enable nodered.service
  • sudo systemctl start nodered.service
  • mkdir /home/pi/audio
  • curl https://get.pimoroni.com/unicornhat | bash
    select to continue (y), but don`'t need a full install (N) and don't let it configure sound (N), select to reboot.
  • cd ~/.node-red
  • npm install node-red-contrib-speakerpi node-red-contrib-micropi node-red-node-pi-neopixel
  • npm install node-red-node-watson node-red-dashboard node-red-contrib-camerapi
  • npm install node-red-node-base64 node-red-node-weather-underground
  • sudo nano /etc/rc.local
    add the following to the end of /etc/rc.local, but before the exit 0 line :
    /usr/bin/pigpiod -l
    then exit the editor (Ctrl x)
  • sudo reboot