Categories
Gadgets Geekery Raspberry Pi

Ryanteck Raspberry Pi Serial Debug Clip review

When building projects on the Raspberry Pi that run ‘headless’ I’ve often found it necessary to connect to the Pi to see what’s going on, work out why it’s not working as I expected or to simply shut it down neatly without yanking out the power cable.

There are a few ways to do this – you could carry around a keyboard and monitor, hook them up to the Pi and see what’s what. The extremely useful and sadly getting rarer and more expensive Motorola Lapdock which I reviewed a while back works very well as a portable monitor / keyboard combination.

Or you could connect to the Pi using SSH if you’re both connected to the same network.

The third option is to connect to the Pi using a USB to Serial port converter. These are usually available as USB to TTL Serial Cable with a USB plug on one end and a series of female jumper wires on the other. Adafruit have a good guide on how to use one of these. Ryanteck have recently released a Raspberry Pi USB debug chip which works in the same way as the USB serial cables, but which is easier to connect to the Pi and includes friendly green and red LEDs to indicate data being sent back and forth. I recently backed this on Kickstarter so was able to get one to play with.

For this option you do need to carry round a computer, but as I discovered it works well with my tiny Toshiba Encore windows 8 tablet – and even with an Android mobile phone!

Raspberry Pi USB Serial debug chip
Lego spaceman has removed the important little jumper on the bottom left of the clip

Assembling the chip is very straightforward with the instructions on the Ryanteck website – although it’s worth mentioning that the version of the PCB supplied varies slightly from the images in the guide. The final version of the PCB includes a little jumper clip – this is quite important – with the jumper in place the Debug Clip will power the Raspberry Pi. It’s vital that the Pi is powered from either the clip or it’s micro USB port – the serial link will not work if the Pi is powered from both.

The RPi debug clip lacks any headers or sockets – it’s designed to sit on the Raspberry Pi GPIO pins underneath a hat or add-on board. In practice I found it a tight fit on the Raspberry Pi pins and a loose fit on a spare extension header I had lying around so I’ve used a 40 pin extra tall header – with this it’s possible to use the Rpi Clip with the Pimoroni Coupé style cases and have room to fit additional hats on top:

Debug clip sat on a 40 pin tall header, sat on a Pimoroni Coupé case
Debug clip sat on a 40 pin tall header, sat on a Pimoroni Coupé case

Despite having just one micro usb port it’s possible to use the debug clip on the Toshiba with a Micro USB Host OTG Cable – as there are a lot of very cheap Windows based tablets now available I imagine they all work in the same way.

To get the RPi clip working with the Toshiba Encore I installed the driver from the Microchip website, and then looked up the COM port the USB Serial port was using with the Computer Management window (right click on the Windows 8 start icon). In my case it was COM3. I opened up the Windows Telnet App PuTTY, chose a serial connection on COM3 at 115200 baud, hit enter and voila! – the Raspberry Pi login prompt appeared.

RPi debug clip
I do normally use this with a little keyboard, but it’s still very little.

It’s also possible to use the same cable with an Android mobile phone. I tested it with my bog standard Nexus 5 (which hasn’t been rooted) and a free app called DroidTerm – to connect hook up the Pi with the OTG to USB cable, make sure the header on the RPi debug clip is removed and use the following settings:

Droidterm screenshot
Basic connection options

When you first connect the screen will be blank – just enter the username you normally log in on your pi with (I think everyone uses ‘Pi’) and it will prompt you for your password. It’s a basic app – there’s no cut and paste, but for checking on things it’s fine.

Droid term /cat/proc/cpuinfo
Here’s some Pi info on a mobile!

The Ryanteck Raspberry Pi debug clip is available here for about 7 quid.

 

Categories
Geekery Raspberry Pi

Controlling Lego motors with the Ryanteck Raspberry Pi board

I’ve reviewed a few Raspberry Pi add on boards before, including the PiFace which includes a multitude of inputs and outputs, and the minimalistic LEDborg which has a very bright single multicoloured LED.

The Ryanteck Raspberry Pi Motor Controller Board Kit is a GPIO add on board that allows you to control 2 motors with your Raspberry Pi. Although it’s much simpler than the PiFace it’s cheaper (about £12) and is easy enough to assemble yourself. In fact it makes a nice introduction to soldering, and is an ideal project if you want to take the plunge and have a go at making your own hardware.

With the motor controller board you can build a simple Raspberry Pi based rover – you just need 2 motors driving side by side sets of wheels or tracks. Driving the motors in opposite directions allows you to turn on the spot. The Ryanteck board can control motors up to 12 volts to you could always re-purpose a toy or build your own.

There’s some documentation available here, but I thought I’d share my build guide. If you’ve never soldered before check out the Soldering is Easy guide, and try to buy some leaded cored solder. Lead has (quite rightly) been removed from the solder used in commercial products to prevent it ending up in landfill when electronics are thrown away. However lead-free solder is much harder to work with (it’s fine if you’re a robot) and for hobbyist applications it’s easier to work with the leaded variety. Just make sure you don’t throw your electronics projects away once you’ve finished with them.

Build guide

In the kit are 3 sets of 2 pin headers, 3 sets of blue terminal blocks, a GPIO connector pin header and a chip carrier and controller chip.

Don't panic.
Don’t panic.

 

Holding everything in place when you’re soldering is tricky – so my tip here is to use the GPIO header block to hold the parts in place while you solder them. So first we have the set of 3 2 pin headers:

The spacing is just right!
The spacing is just right!

Next we’ll solder the chip holder into place, using the GPIO header plugged into one of the sets of 2 pin headers – orientate the cut out to the left hand side of the board:

Chip holder next, held in place with the GPIO header
Chip holder next, held in place with the GPIO header

Next comes the blue terminal pins. These are a tighter fit so easier to just rest the board on the blocks and solder away. Finally comes the GPIO header. Remember to solder this facing down – you’ll need something to rest the board on. Fortunately I discovered this was exactly one lego minifigure knee in height, so I used the lego workman as a rest:

Soldering is Awesome!
Soldering is Awesome!

 

Finally comes connecting it all up and testing. The board is rated for a range of motor voltages. Surprisingly as I seem to have a lot of Lego around I thought I’d test it with a vintage Lego technic motor. Lego motors come in different voltages – the very old ones are 4.5v and the newer ones tend to be 9v. My motor is 9 volts but I’m running it off a 5 volt USB power supply, which I’m using in my Lego rover project. The motor runs a bit slower but is fine for my purposes. Attach the power supply for the motor to the J1 blue terminal with positive on the left hand side.

It lives!
It lives!

There’s a test program included in the instructions to switch the motor on, and change it’s direction for a set period of time.

Create the program with:

sudo nano motortest.py

 

copy the following code:

##Simple motor script for the RTK-000-001
import RPi.GPIO as GPIO
import time
#Set to broadcom pin numbers
GPIO.setmode(GPIO.BCM)
#Motor 1 = Pins 17 and 18
#Motor 2 = Pins 22 and 23
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
#Now loop forever turning one direction for 5 seconds, then the other
while (True):
#Sleep 1 second then turn 17 on
 GPIO.output(18, 0)
 time.sleep(1)
 GPIO.output(17, 1);
 time.sleep(5);
#And now the other way round
 GPIO.output(17, 0)
 time.sleep(1);
 GPIO.output(18, 1);
 time.sleep(5);
 #And loop back around
#And final cleanup
GPIO.cleanup()

 

and then run it using:

sudo python motortest.py

 

You’ll need to use sudo as you’re using the GPIO pins.

Finally here’s a picture of the almost completed Lego Rover: all that’s to do next is to write some software and add a PiCam:

Curiosity killed the cat..
Curiosity killed the cat..

The Ryanteck Raspberry Pi board is a nice kit, easy to put together and get going straight away, and works with Lego motors so there’s quite a range of interesting things you can try. Ryanteck has now launched a complete robot kit that includes a chasis as well. For more info check out their GitHub project page. It’s a bargain way of making your Pi control things.