This is the a new version of the Salvius robot blog. The old blog can still be accessed at

Get local IP in Python

This is a cool code snippet I have used on several occacions for Python projects that need to figure out what the IP of the device they are running on is.
import socket
import fcntl
import struct

def get_ip_address(ifname):

    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    return socket.inet_ntoa(fcntl.ioctl(
        0x8915, # SIOCGIFADDR
        struct.pack('256s', ifname[:15])

ip_address = get_ip_address('wlan0')


Gathering Parts For Your Project

Recycling used electronic gadgets is a fantastic way to build a parts inventory for your projects. It is extremely useful to always have a few parts on hand for when you need them. However, when salvaging parts, some devices prove more bountiful than others.

VCRs, Cassette players, Walkmans, CD players

Devices like these are a goldmine of parts. In all of these items you will be able to recover small gears, motors, sensors and switches, not to mention a plethora of circuit boards with components that can easily be unsoldered for use in other projects.

Pagers, Cell phones

These devices usually have a few useful parts that can be extracted. The parts used in the circuit boards for cell phones are typically too small to unsolder from the circuit board. The only useful parts that can be recovered are speakers, microphones and vibrator motors. Cell phones may also contain a tiny CMOS camera which is usually too small to be able to easily integrate into other projects.

Televisions, Computer monitors, Air conditioners, Calculators, Television remotes

Items like these typically have nothing of value in them for our robotics projects. You will probably only find one useful item.

In addition to the items listed above there are some rare items which you do not want to pass up if you have the opportunity to get. These items include electronic children’s toys, treadmills, and power wheelchairs. Any children’s toy with electronic parts is going to have a bountiful selection of high quality parts. In addition, treadmills have a selection of motors in them. As for power wheelchairs, if you can get one of these you pretty much have a mobile robot base already. All that needs to be done is to set up a remote connected to the control panel on the chair and you’re good to go.

Know When To Stop

Gear boxes are gold for robotics projects and if you strip one down to just a motor and a pile of gears then you have lost a valuable part. Gear boxes make it very easy to move parts on your robot and you will find that many times just a motor on its own will not suffice. Circuit boards are another valuable resource. There will be times when you can tap into a circuit board and use it, as well as other times when you may just need one capacitor from the board. Some parts are more useful as a whole.

Dangerous Items

Some electronic devices contain components or materials which can be potentially hazardous. All electronic devices contain the toxic element Lead. Lead is used for the solder which attaches electronic parts to the circuit board.

Be careful not to damage batteries, batteries contain acid and other toxic chemicals. Some batteries contain Cadmium, an extremely toxic metal.

Most smoke detectors contain a artificially produced radioisotope, americium-241. You’re not at risk for radiation poisoning from standing near a smoke detector but don’t take these items apart.

Infrared lasers are used in cd and dvd players, be careful if testing a part from one of these devices. Shining any laser into your eye will damage it, but the human eye can’t see infrared light so you can damage your eyes without you even being aware of it.

Capacitors in old monitors and televisions can store a charge of several hundred volts without even being plugged into an electrical socket.

Most devices are completely safe to take apart. It is better to be safe than sorry so do research on the devices you are taking apart. You will soon learn to quickly identify what gadgets contin useful parts and what ones you don’t need to waste your time with. Stay safe and learn what these used devices have to offer.

Raw Materials

Large sheets or blocks of various types of metal and polymers. These items can be machined or milled into nearly anything.

2015 Head Redesign

Robot head sketch

Redesign of where the camera mounts.

Simplification of the neck rotation mechanism.

Allow new face panels to be easily attached.

Speech Synthesis Options for Robotics

Language can become a barrier for humans and robots when trying to communicate. The robot will have the ability to produce sounds in order to communicate with people, animals and other robots.

Options for speech

When I first started exploring ways to add speech to my robotics projects I was using a small FM transmitter to send audio to the robot. However, it can probably be agreed that just sticking a radio in the robot isn’t that cool. Instead we are going to look at a few of the different software and hardware required make this conversion.

Operational requirements

  • Can’t slow down other processes to generate the audio.
  • Ability to stop speaking process on demand.
  • Ability to queue tasks for processing.
  • Ability to modify pronunciations as needed.

Design goal

We are going to set up a dedicated speech processor that will receive text data from the robot’s main computer which it will then process into audio signals that can be understood as words. The following options list various pros and cons for available solutions that can handle speech synthesis on either the hardware or software level.

Arduino for speech synthesis


  • Arduino board is low cost.
  • Many programs for speech synthisis on an Arduino have already been created so very little needs to be created from scratch.


  • Lowest quality audio output of all options

Raspberry Pi for speech synthesis


  • Install commonly used (free) espeak package.


  • The Raspberry Pi might be overkill for just speech synthesis processing tasks alone.

eSpeak text to speech module


  • Takes the load of speech synthesis off of the robot’s main processor.


  • More expensive ($50 to $70)

An amplifier will be required in either case to amplify the audio you generate for output through speakers.

Fast, Cheap, and Out of Control

A hexapedal robot named Genghis was revealed by MIT in 1989. Genghis was famous for being made quickly and cheaply due to construction methods; Genghis used 4 microprocessors, 22 sensors, and 12 servo motors. Rodney Brooks and Anita M. Flynn published “Fast, Cheap, and Out of Control: A Robot Invasion of The Solar System”. The paper advocated creating smaller cheaper robots in greater numbers to increase production time and decrease the difficulty of launching robots into space.


An endoskeleton is an internal support structure of an animal, composed of mineralized tissue.

Endoskeleton develops within the skin or in the deeper body tissues. The vertebrate is basically an endoskeleton made up of two types of tissues (bone and cartilage). During early embryonic development the endoskeleton is composed of notochord and cartilage. The notochord in most vertebrates is replaced by vertebral column and cartilage is replaced by bone in most adults.In three phyla and one subclass of animals, endoskeletons of various complexity are found: Chordata, Echinodermata, Porifera, and Coleoidea. An endoskeleton may function purely for support (as in the case of sponges), but often serves as an attachment site for muscle and a mechanism for transmitting muscular forces. A true endoskeleton is derived from mesodermal tissue. Such a skeleton is present in echinoderms and chordates. The poriferan ‘skeleton’ consists of microscopic calcareous or siliceous spicules or a spongin network. The Coleoidae do not have a true endoskeleton in the evolutionary sense; here, a mollusk exoskeleton evolved into several sorts of internal structure, the “cuttlebone” of cuttlefish being the best-known version. Yet they do have cartilaginous tissue in their body, even if it is not mineralized, especially in the head, where it forms a primitive cranium.The endoskeleton gives shape,support and protection to the body and provides a means of locomotion.

Choosing a licence for your robot's software

I like to encourage developers and engineers to open source their robotics projects when possible. Obviously the nature of intellectual property and ownership does not always permit this, and there is still a great amount of proprietary software that many businesses rely on which cannot be open sourced.

However, all is not lost. There is many alternatives that make it possible to leverage the advantages of open source software while avoiding releasing proprietary code. As usual in development, abstraction is the key. Instead of releasing the entire sum of a project, try modularizing the codebase into one or more abstract library that can be released. The added advantage here is that the process of modularizing your codebase will significantly improve the readability and maintainability of your code.

There are a significant number of benefits to open sourcing a useful package or library. Aside from the possibility of allowing a community of other developers to double check your work and possibly improve it, an open source project can become a significant way for a single developer or a company to establish and maintain reputability.

Project History Summary 2008 to 2011

  • 08/15/11 - I will create a blog to talk about the robot.
  • 08/12/11 - Arduino arrived in mail, began programming it
  • 08/08/11 - Ordered Arduino Uno USB IO Board.
  • 08/07/11 - Tidied up electrical wires.
  • 07/28/11 - Installed 8 ohm speaker in head.
  • 07/15/11 - Configured computer.
  • 07/11/11 - Installed optical sensor panel and speaker in head.
  • 07/10/11 - Finished building new human-like head.
  • 05/16/11 - Broke laser cartridge, will have to get new one.
  • 05/15/11 - Installed optical sensors in mount.
  • 05/14/11 - Attached camera to sensor mount.
  • 05/13/11 - Cut plexiglass optical sensors mount.
  • 05/12/11 - Made template for optical sensors mount.
  • 05/11/11 - Removed and measured optical sensors from head.
  • 05/03/11 - Moved shoulder joint up higher so that it is 3.5 inches from top of shoulder.
  • 05/02/11 - Cut 18 inch replacement axial for arm joints.
  • 04/28/11 - Simplified audio amplifier.
  • 04/26/11 - Finished adapter to run radio off of psu.
  • 02/28/11 - Tested larger audio amplifier with stereo speakers.
  • 02/27/11 - Began work on servo controller for ear servos.
  • 02/26/11 - Added 3 watts of extra amplification to audio amplifier.
  • 02/25/11 - Tested cam and mic wireless connection.
  • 02/24/11 - Connected left arm wires to junction box.
  • 02/23/11 - Attached new wires to left arm motors.
  • 02/22/11 - Enabled two speakers for mono.
  • 02/21/11 - Assembled audio amplifier.
  • 02/20/11 - Installed radio.
  • 02/19/11 - Attached electronics to drive base.
  • 02/18/11 - Attached left arm to body.
  • 02/17/11 - Mounted upper-torso on drive base.
  • 02/16/11 - Assembled plywood drive base.
  • 02/15/11 - Reattached sensors and electronics to new head.
  • 02/14/11 - Salvaged two gear boxes and chain from older body design.
  • 02/13/11 - Robot Operating System (ROS) is a potential OS for robot.
  • 02/06/11 - Cut out metal parts for new head based on cardboard template.
  • 02/05/11 - Stereo speakers hooked up and functioning.
  • 02/04/11 - Attached temporary wires for neck joint.
  • 02/02/11 - Created neck joint.
  • 02/01/11 - Built new wooden cube shaped upper body for robot.
  • 01/27/11 - Began redesigning head due to problems with size and shape of previous version.
  • 08/24/10 - Upgraded to larger upper arm on left side with larger motor.
  • 08/20/10 - Development has begun on radio core.
  • 06/15/10 - Right hand is now able to reconfigure into drill driver.
  • 06/14/10 - Found an online suppler of muscle wire for nano-robots.
  • 05/05/10 - Finished installing right arm motor for wrist rotation.
  • 04/12/10 - Organized data files.
  • 03/01/10 - Robot now has limited speech and extremely pour motor control.
  • 02/27/10 - Someone to speak to the robot and the robot can to reply to the person.
  • 02/14/10 - Working on a design for a grabber to go on the flexible mobile arm.
  • 02/10/10 - Working on housing for custom power cell.
  • 02/07/10 - Working on navigational system.
  • 02/08/10 - New design for legs and feet will likely result in a more maneuverable torso.
  • 11/19/09 - Working on a design for legs to get the robot mobile.
  • 10/01/09 - The design for a bracket to attach the head to the neck has been made.
  • 08/29/09 - Brackets to hold the access panel in the back of the head closed have been installed.
  • 07/29/09 - The laser data transmitter circuit board is now finished.
  • 06/18/09 - The new head is being modified to use the sensors built for the older head.
  • 06/15/09 - Salvaged a sound amplifying circuit for microphone elements in ears.
  • 05/07/09 - Began redesigning robot’s head.
  • 04/26/09 - Made larger shoulder mount.
  • 04/18/09 - Upgraded left arm chain drive.
  • 04/15/09 - Made simple right arm.
  • 04/02/09 - Mount for legs and torso joint is installed.
  • 04/01/09 - Upgraded wrist joint.
  • 03/25/09 - Made simple left arm.
  • 03/23/09 - Reinforced Neck rotation joint.
  • 03/19/09 - Neck rotation joint installed.
  • 03/17/09 - Inserted grommet into hole in chest cover.
  • 03/16/09 - Chest cover panel is attached.
  • 11/09/08 - Mounted wire holders to secure wiring.
  • 11/08/08 - Installed Wire covers.
  • 11/07/08 - Attached motor wires.
  • 11/06/08 - Officially started building robot.