Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
brian111 edited this page Jun 13, 2018 · 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 and also provides environment and motion sensors and an 8x8 LED panel for feedback to the user.

Instead of adding a SenseHAT you can add a DHT22 or DHT11 temperature and humidity sensor to provide temperature data.

There will be a series of videos to take you through all the steps here, the introduction video is linked below:
TobyJnr

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 (optional)
  • DHT11 or DHT22 (optional) to provide environment data if no SenseHAT connected. The DHT22 is more accurate (+/- 0.5C) than the DHT11 (+/- 2C)
  • Raspberry Pi Camera
  • USB Mini Microphone dongle
  • Bluetooth speaker or USB sound card and speaker (I have tested with a betron BPS-60 and an EasyAcc Mini portable Bluetooth 4.0 speaker, but others should also work). Instead of a Bluetooth speaker you can a USB speaker or sound card, 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 in more detail.
  • 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 53mm 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.

The rest of this page covers the setup required to get TobyJnr up and running, but they assume you are familiar with the Raspberry Pi, Node-RED and hardware. There is a more detailed set of instructions (accessible from the side menu), which take you through all the steps and provides a little background information, where needed.

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 Stretch - Select the version with Desktop.
  • 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 apt-get update
  • 
sudo apt-get upgrade -y

  • sudo apt-get install -y libasound2-dev netatalk smbclient
  • 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
  • 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