Once these circuits are wired correctly, the Pi is able to send on/off signal to the remote control circuit board via its pins.

Now we need to write some software inside of the Pi that gives us flexibility in controlling the pins.

We use rpi-gpio for this purpose. rpi-gpio is a nodeJS library that allow us to interact with the GPIO pins on the Pi.

We use these pins to send signals to the remote control of the car so that we can control it, like so:

Here in our terminal if we do

sudo node app.js

It will trigger the on() function of the script, signaling an on signal to the pin of the Pi; after a full second, it will then trigger off() function which sends off signal to the pin. These on/off signals are passed on to the remote control by the Pi and therefore running the car.

Now we already have an interface that controls the car from the Pi, final step is allow Pi to trigger actions of the car based on messages it receives from the internet. We use tmi.js to connect with API of twitch chat channel

When we receive a message from the twitch chat FORWARD we trigger the on() function, which will then triggers the car to run.

To see the car moving in action check out the video below: