A Loom Controlled with a Raspberry PI

This page outlines a project that occupied about a year of my time; controlling a hand-weaving loom with a computer, a Raspberry PI.  As with most projects, the idea for this arose out of necessity and a failed project.

Among other things, Gina is a weaver, and has been a weaver for about 30 years.  We have various looms around the house and as we get older the physical aspects of hand weaving start to become an issue.  Issues include back and neck pain while warping floor looms.  Some weavers have problems holding down pedals of larger floor and jack looms.  I occasionally run into “former” weavers who complain about similar problems.

One day we stumbled across a Youtube video of a computer controlled tabletop loom that looked kind of fun to work with.  Before we knew it we ordered one of these “cute” little items and started eagerly awaiting delivery.  The manufacturer kept delaying the delivery date due to “software” problems for almost a year and a half.  The day the loom arrived was exciting.  We unpackaged it and connected it to our MacBook Pro.  I immediately saw a problem.  The loom controller and the instructions called for an early version of Java 6 to connect with the loom.  That was a problem as the MacBook Pro had a late version of Java 7 installed.  Wasn’t there something more up to date.?  Anyway, after several tries at configuration, we got the loom to work when connected to the MacBook Pro with a USB connection.  We never could get the advertised wi-fi to work.  We put the loom aside for a couple of months due to other projects before warping the loom and trying to weave a complete project.

During the couple of months the loom was sitting in the corner waiting for a project, a new version of OS-X was installed on the MacBook Pro.  When we next tried to connect to the loom, the Java 6-based software could not find the loom control unit.  After several weeks of trying to patch the software we ended sending the loom back.  On top of the software problems, the loom was heavy, for a tabletop loom, and quite noisy.  The evening we sent the loom back Gina and I were discussing some of the failings of this project.  All of a sudden she says: “You should be able to build a computer controlled loom with one of those Raspberry Pi things of yours”.  The most reasonable answer I could give to that was: “as a matter of fact, I think I can”.  A project was born.

To keep the project within reasonable limits we ended up setting up some ground rules.

  • build a 4 harness tabletop loom
  • control the loom with a Raspberry Pi
  • the loom has to be quiet enough carry on a conversation in the same room with it
  • the loom needed to be controlled without a lot of fancy software and interfaces.  It must be controlled from a Unix/Linux Bash console.
  • the loom had to be controlled directly with a keyboard and monitor plugged into the Pi or indirectly through a wi-fi SSH connection using a stock terminal utility on a PC or Mac.
  • the Raspberry Pi must be the most expensive single component of the loom.  No single part of the loom can cost more than $35.

For this project I really didn’t want to get into hydraulic or pneumatic actuators to power a loom project this size.  This left me with electricity; AC or DC?  DC would be the simplest.  Fortunately there are a number of low cost, high torque 12 volt motors available from the automotive parts market.   I found a Hossen motor available for about $12 that turned at 30 rpm, with a torque of 120 N/cm.  The math was quite simple.  Assuming a 1.5 inch (38.1 cm) diameter wheel attached to the hub, the motor could produce ~63 newtons (120 N/cm can lift 120 N-cm/1.9 cm = 63.2 N).  Assuming that each 1 kg requires 9.80665 N of energy to lift, This motor could potentially lift more then 6 kg (63.2 N/9.80665 N =~6.4 kg).  As far as speed is concerned, 1.9 cm X 2pi X 30 rpm = 358 cm/min which converts to 2.3 inches/sec.  I am in business.

motor_mount_bracketAfter several starts and design changes I finally settled on a loom with “lifted” harnesses through a series of pulleys and actuator arms.  While this idea might seem cumbersome to some, it seemed to be the simplest method of controlling the motors through distance traveled rather than a complicated timing mechanism.

Of course a Raspberry Pi cannot directly control 12 volt DC current so I needed to come up with a “motor control unit”.  After trying to use one of the H-bridge chips readily available from most any electronic supply house, and frying my Raspberry Pi, I had to design a motor control unit using 12v relays and TIP 120 darlington transistors.  I notice that my problem was not unique and there are several H-bridge kits capable of controlling now on the market.  Anyway, here is a schematic diagram and a picture of one of my motor control units.

Loom Wiring Logic JPEGFirst of all, the motor control circuit is a modification of a typical DPDT relay motor control circuit.  This is a time dependent circuit.  The difficulty here is predicting the time the motor needs to run.  Running under differing loads can get the harnesses out of sync.  Therefore, I planned to “over time” the motor actuation and use limit switches to stop the travel.  With the limit switch activated and power cut off from the motor, how do we run the motor the other way?  We incorporated diodes to bypass the limit switches when we reversed the polarity of the power.

The TIP 120 Darlington transistor allows me to co-mingle the 12 volt circuit with the low voltage GPIO circuit.  The TIP 120 data sheet can be found here.

Here is an image of the completed motor control board.  There is one board for each harness.


My Raspberry Pi controlled loom is complete and it works.  Maybe not ready for the “big leagues” but good enough to prove the concept.

This is a quick and dirty video showing a general walk around the loom.  Sorry, the video has no sound or music.  As I said, this is “quick and dirty”.

This video shows some close ups of the loom.  They are still pictures taken at the same time as the walk around video.

This third video shows the general sequence of events for running the loom.  It might help to reference the source code linked below when you watch this video.  As with the other videos on this post, there is no audio.

For those interested, the loom is controlled with a simple Python script.  All the script needed to do is activate the proper GPIO pin connected to the proper motor control unit, a simple on or off circuit activated for 1 second.  I hard coded the sequences in my testing script but as most loom control programs are controlled with a plain ASCII .wif file, adapting a Python program to using one of these control files should be simple.  The source code can be found here…. Link to .pdf “Twill_1-3_2-4”  Feel free to use and modify it as you wish.  Just don’t try to copyright, patent, or otherwise claim it as yours and “close” the code.  Since I freely referenced the open source work of others, I expect those referencing this code to pass their code on  “freely” too.

A final word about lessons learned from this project.

  • This project proved that you can make a loom controlled with a simple credit card sized computer such as a Raspberry Pi.  With a simple USB keyboard/mouse and monitor (I use one of those backup camera screens) you can control the loom with no other computer or networking needs.
  • This project can be done with the most expensive single component being the Raspberry Pi at about $35.  In fact, everything together on this project cost about $150.  This includes the power supply.  Of course there is a lot of “sweat equity” into this project.
  • There have been some questions about using alternative sources of energy to power this loom.  Yes I considered using something like solar or wind power, however:
    • You will very quickly break the monetary restraints for this project.  Solar panels or wind generators, even the cheapest, cost much more than a Raspberry Pi.
    • While a Raspberry Pi can run on battery power, remember it can draw up to 1 amp, so it will have to be a big battery.   And you will need a step down voltage regulator from the 12v to 5v needed to power the Pi.
    • If for some reason you wanted to activate all of the all the motors at the same time, this loom could potentially “pull” close to 100 watts.  This would not be a small and portable solar or wind power situation.
  • This loom is not really intended for production work.  It is much too slow.  It is more suitable for design work.  You might want to look at other power sources such as pneumatics or hydraulics to drive the harnesses and automatic cloth advance mechanisms for production work.  I have seen production hand weavers quickly outpace this loom.  On the other hand, a “board” computer such as a Raspberry Pi should be able to easily control large, production looms.
  • If I had this project to do over again, I would investigate other types of actuators.  Electric door lock actuators for automobiles specifically come to mind.  One can be had for as little as $5 and can be attached to a bell crank or walking beam mechanism to activate the harnesses.  Questions include: do these actuators have enough power?  Do they travel far enough?  What dimensional or weight constraints do you need to operate under?

Doing this project was fun, I learned a lot and it is certainly within the limits of engineering students in a “STEM-like” learning situation.  Feel free to ask questions either by responding to this post or through our contact page.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.