Over the past week I’ve made a couple of hardware improvements, as well as building the majority of the software library, a TCP server and making a good start on a client.
The camera draws over 350mA@12V and there’s no reason why I need it permenantly on. I’ve connected one of the Phidget Kit’s outputs to a simple transistor/resistor/LED circuit, with a 12V supply passing into the transistor’s collector pin, through the transistor, relay input and resistor. Then I’ve connected the camera’s power over the relay’s output. The power on and off for the camera/LED are now through setting the board’s digital output 0 to 1 and 0 respectively. Power consumption with no movement has now dropped from 1.25A to just under 0.90A. I’ve also put all essential USB hardware on one usb hub and all optional hardware on another (USB to TTL adapters, sound adapter) on the other. The optional hub is also on a relay now on the opposite side of the robot, and this now reduces idle power consumption from 0.90A to about 0.50A which I’m happy with.
![]() |
![]() |
I’ve spent a while working on the software site of things. I’ve written a ‘library’ in C which interfaces with the various hardware that we’re interested in. The library provides a number of functions, I’ve listed the useful ones here, and they’re hopefully pretty self explainatory: (more…)
Tags: 12v, beej, C, camera, collector, cvoiceengine, digital output, LED, Linux robot, phidgets, phidgets sensor, port settings, power consumption, relay, resistor, software library, speech to text, struct, tcp server, termios, transistor, usb hub, usb to ttl
I’ve made some excellent progress over the last week! The Robot is now independant, and it moves freely. I’ve written a simple shell script to take the following characters as control:
a – left
s – stop
d – right
w – forward
x – back
q – hard stop
k – turn anticlockwise
l – turn clockwise
This sends a single byte to the serial port. I am using 2xUSB to TTL converters which show up as
/dev/ttyUSB0 and /dev/ttyUSB. Each serial port controls two motors through the sabertooth controller. As we control two motors with only a byte, each motor has a 7 bit resolution from full reverse to full forward. For motor 1, 0 is stop, 1 is full forward, 64 is stop, 127 is full reverse. Motor 2 starts at 128 for full forward, 192 for stop, and 255 as full reverse. Although 7 bits of accuracy, speed changes only seem to occur at roughly 4 intervals, so we technically have about 32 different speeds, 14 forward, 2 stop, 14 reverse. We’re only using 3 speeds though as I can’t see the benefit in programming for any more right now.
The movement now seems to be working well. Smooth, controlled and straight which is something of a miracle
The battery is a 12V/7.2Ah sealed lead acid battery. With USB devices active, the board running and the processor 100% active, as well as peripheral fancy LEDs, digital outputs high, wifi active, etc, it uses 12v/800mA.
With all four motors moving at full speed, it uses 12v/6A. Seeing as the motors will be in action for short periods only, I would expect 6h+ battery life.
I have tested the sensors, and they are all working and reporting data except for the top back one which I’m going to have to investigate. Here are some more pictures:
Tags: digital output, espeak, Linux, Linux robot, motors, sensors, serial port, the robot, usb devices, usb sound, usb to serial, usb to ttl