Raspberry Pi Big Trak vehicle

Raspberry Pi BigTrak

BigTrak converted to use a Raspberry Pi and L298 motor driver.

I’ve had an original Big Trak since the late 1980’s when I bought one to connect to my Jupiter Ace. Time passed and it eventually gained a PICAXE and then more recently it gained a Raspberry Pi.

The Big Trak electronics are fairly simple to work with, although I have a feeling that the original motors are only rated at 3v rather than 6v or anything higher. I tried a 7.2v battery pack and it went off rather too fast. It’s now running a 4.8v “SubC” NiCd rechargeable racing pack.

The motors are controlled by an L298 H-bridge motor which I’ve covered previously. The actual remote control is handled here from a wireless keyboard – the receiver is in the USB slot. I eventually want to make it more autonomous with an ultrasonic sensor fitted on the servo at the front.

From a software point-of-view, it’s all fairly simple. The main program is written in Scratch and uses ScratchGPIO to control the outputs. It looks for keypresses (up, down, left, right) and turns on the relevant outputs. The “b” key makes a piezo buzzer beep (useful for warning pedestrians who don’t look at their feet!) and also requires space bar to bring it to a halt.

I had originally intended to use my “Flirc” device to control this from a TV handset, but it seems to have died just prior to exhibiting. It partially works but I can’t fully program the keys. A shame, as it also did double duty as a remote for my Raspberry Pi Kodi media centre.

The following video was taken by an attendee at the Raspberry Jam in Exeter – I’m not driving either!

Advertisements

The bells are ringing in my head.

Sometimes, when things are going smoothly, it’s easy to lose track of time. This is compounded if the school bells aren’t working correctly (Excavator + Buried Cables might have something to do with it). Replacing cables is expensive, disruptive and time-consuming. Here’s where the Raspberry Pi might come in handy – particularly if it has the ability to use “Network Time”.

It’s also a bit of fun. I’ve got an RGB Piranha LED as well as a set of speakers. Ideally, I’d connect up that doorbell sat on my desk so that it sounds more realistic, but the “Ring Ring” spoken by espeak is a better talking and teaching point. Perhaps I should even get the head connected up. In addition, I’ve used figlet to make the time visible, although I’d really recommend running this headless to reduce power consumption.

The LED lights up green in the last 5 minutes of a lesson, and then goes red when the bell should be going. It repeats each message a couple of times to hammer the point home. If I really wanted to use that doorbell, then it’s a simple job to use the PiFace relay where the bell push-switch would be fitted.

Using this program with mplayer or omxplayer might make an interesting clock radio with mp3 files playing instead. Perhaps use mpd to play streaming radio. So many ideas, so little time…

#!/usr/bin/env python
import time, RPi.GPIO as GPIO
import os
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
GPIO.setup(12, GPIO.OUT)
GPIO.setup(13, GPIO.OUT)
GPIO.setup(7, GPIO.IN)
shortDelay = 2
bell_times=["08:45","08:50","09:50","10:50","11:10","12:10","13:10","14:10","14:15","14:30","15:30"]
bell_warning=["09:45","10:45","12:05","13:05","14:05","14:15","14:25","15:25"]
while True:
         GPIO.output(11, GPIO.LOW)
         GPIO.output(12, GPIO.LOW)
         GPIO.output(13, GPIO.LOW)
         current_time=time.strftime("%H:%M")
         print(current_time)
         os.system("figlet "+str(current_time))
         time.sleep(1)
         if current_time in bell_warning:
                 print("Five minute warning for the bell")
                 GPIO.output(11, GPIO.HIGH)
                 os.system('espeak "the bell will go off in five minutes"')
                 time.sleep(20)
                 GPIO.output(11, GPIO.LOW)
                 time.sleep(1)
         if current_time in bell_times:
                 print("Brrrring, Brrrring, Brrrring....")
                 GPIO.output(12, GPIO.HIGH)
                 os.system('espeak "Ring Ring. Ring Ring. Ring Ring"')
                 time.sleep(20)
                 GPIO.output(12, GPIO.LOW)
                 time.sleep(10)