Battery powered Pi and servo switch

This post will outline the details of a couple of circuits I designed and built for my robot. The first is a regulator to supply my Raspberry Pi with power from a 7.2V battery. Although a simple circuit, it has some features that make it very easy to use to power the pi. Below is the schematic for the circuit, designed using Eagle.

Regulator circuit for Raspberry Pi battery supply

Regulator circuit for Raspberry Pi battery supply

The regulator is a 3A, 5V low drop out regulator (part no MIC29300-5.0WT) even though the schematic shows a different regulator. I realise that using a regulator like this is not the most efficient way of dropping voltage. As the current draw is relatively low (measured at around 0.7-0.8A with everything plugged in and running) and not a huge voltage drop is needed (8V for a fully charged battery dropped to 5V) then this approach is sufficient and quite cost effective. A good heat sink is required for the regulator, which I found out after making the circuit and not leaving enough room for a large heat sink. The regulator has been performing well with just a small heat sink for the moment but gets quite hot. I’m going to see how this goes and maybe redesign the PCB to allow for a bigger heat sink at some point. The feature I included in this design was having the 5V output connected to a USB socket, and also to some screw terminals. This means a standard  cable can be used to connect power to the Raspberry Pi’s USB power connector. The screw terminals allow power to also be connected to my USB hub. The picture below shows the circuit built and mounted to my robot.

Regulator built and mounted to robot

Regulator built and mounted to robot

The second circuit designed and built for my humanoid robot is a switch to turn the servo supply on and off. Let me explain why this is useful. At the moment, the Raspberry Pi on my robot is running headless and I am using a laptop to connect to the Pi via SSH. I can run my python GUI and control the robot from the laptop. I wanted a way to switch the servo power on when I run the GUI and off again when the program is closed. This will help the batteries last longer by cutting the power when I’m playing around with code and saves my legs walking over to the robot to power up the servos when its time to test said code. Anyway, below is the schematic for the circuit.

Servo switch schematic

Servo switch schematic

The relay used has a 6V coil and I’m using the supply voltage for the servos to switch the relay. A 2N2222 transistor is used to switch voltage to the coil with an output from the Arduino switching the transistor. A resistor to limit current, and another to pull the transistor gate low when the output from the Arduino is low or not present are required. Also a diode across the relay coil is recommended. I have built and tested this circuit and mounted it to the robot. I works great and does exactly what I intended it to do. The picture below shows the circuit in all its glory.

Servo power switch

Servo power switch

With the addition of these two circuits and some fully charged batteries, my robot can now roam around untethered. I really need to work on some code now to take advantage of this. Another task on my to-do list is to design and build some optical encoders for the wheels. I’ll be sure to keep you informed of any progress I make.

Advertisements

Wheels

I’ve been busy working on my robot lately, and I thought it’s about time to share my progress. The big news is that my humanoid robot now has wheels! I removed the base plate and mounted the torso to a chassis with two modified servos providing the drive and a castor at the rear. The modified servos had the potentiometer removed and replaced with a 10k trim pot. This allows the centre position to be adjusted so that the servos aren’t turning when the centre position signal is sent to them. I also removed the physical stops so that the output shaft can turn around as much as it likes. I allowed enough room on the new chassis to mount the Arduino and my Raspberry Pi (in a case). As I need a USB hub to connect the Arduino, webcam and wifi adapter to the Pi, this had to be mounted to the robot as well. Check out the picture below to see how things are looking.

Rolling Humanoid

BFR-H1 with wheels

The observant among you will notice the addition of the SRF05 sonar sensors to the chassis and the head. The sensor on the chassis should hopefully stop the robot driving into anything when moving forward. I’m not sure this one sensor will provide enough coverage to stop the robot ever hitting anything but I don’t plan on adding any more until it’s required. I added the sonar sensor to the head in place of the sharp IR sensor as it provides a wider beam and a longer range.

Have a look at the picture below to see the back of the robot with the Arduino and Pi mounted. The wiring is a bit of an issue to the looks of the robot and I may have a stab at tidying it up at some point!

Rear of new chassis

Rear of new chassis

The new chassis works well, although the servos are a touch noisy. They are metal geared digital servos and at higher speeds tend to generate a bit of noise. I can live with this for the moment though. The rear castor is one designed for furniture but works great on a robot, particularly for driving on a carpeted floor. You can also see a 7.2V battery attached to the underside of the robot, along with the 6V battery used for servo power which the photo doesn’t show. This is going to be the supply for the Raspberry Pi.

On the software side of things not much progress has been made. I have added data to the serial packet for the new sonar sensors and altered my python code to display these readings on the screen. I have been playing around with OpenCV on the pi and have been struggling to get a decent frame rate whilst keeping the GUI responsive. The main time consumer seems to be getting the data from the camera to the Pi. Instead of streaming video from the camera  I’ve decided to just capture frames and analyse them when required. This is adequate for development and experimentation, but may cause issues in the future, we will see!

I’ve designed and built a couple of new circuits for my wheeled humanoid robot. A regulator to supply the Pi and USB hub so that the robot can drive around untethered and a switch circuit to switch power on and off to the servos via an Arduino pin. My next post should be very soon and will include more details on these two circuits.

 

excitingtechnology.net

Facts and Thoughts on Technological Progress

Turing's Radiator

Pleasantly Warm Topics in Computational Philosophy

Mind the Leap

One small step for the brain. One giant leap for the mind.

Steve Grand's Blog

Artificial Life in real life

jimsickstee

Hi, I'm Jim. Read what I write and I'll write more to read.