Monday, December 6, 2010

Hacking a Knitting Machine's Keypad

by Travis Goodspeed <travis at>
in collaboration with Fabienne Serriere and Arjan Scherpenisse,
at Mediamatic's RFID Devcamp 2010, Amsterdam,
for Multithreaded Banjo Dinosaur Knitting Adventure 2D Extreme,
with kind thanks to David Carne.

Multi-Threaded Banjo Dinosaur Knitting Adventure 2D Extreme

Thanks to some extra-neighborly blackmail by Fabienne, I spent last week hacking up a storm in Amsterdam. By extending the work of Steven Conklin, Limor Fried, and Becky Stern, we were able to hack a Brother KH930 knitting machine to print high score panes from a custom video game in yarn. This game was then displayed at Mediamatic for SensorFest, leading all sorts of neighbors to learn that RFID, socializing, and beer can lead to a neighborly time. Never in my life did I expect to get such an adrenaline rush from knitting, much less from from this newfangled social networking nonsense.

Conklin's technique for loading new patterns into the machine involves using an FTDI chip to simulate a Tandy PDD1 floppy disk drive, then typing "CE 5 5 1 STEP 1 STEP CE STEP STEP CE 9 0 3 STEP STEP" to load a new pattern set from disk and print pattern 3 of the set. (551 is the command to read from disk, and patterns held in RAM begin at 900.) For our exhibit, this sequence was far too complicated to type for every half meter of output, so we hacked the device's keypad for scripting.

This article describes how a matrix keypad works, how we reverse engineered the specific keypad of the Brother KH930, and how to use an Arduino with a handful of transistors to automate the typing of commands necessary for loading a new pattern from an emulated floppy disk. It should be applicable to all sorts of keyboards, but for those with serial protocols there might be a simpler method.

Unfortunately, there won't be room here to describe the first emergency knitting machine purchase in history, our A-Team trip to the far side of Holland in a borrowed van, or the case of Club Mate that we begged from a squatter bar in order to finish the project in the five days allotted.

A keypad matrix is most often built with switches that connect a row wire to a column wire. By keeping every column in a high-impedance state with pull-up resistors, then dropping each row low in sequence, the column inputs can be sensed to determine when a button is pressed. Dave's Hacks' first article on IM ME Hacking describes in detail how the keypad of the GirlTech IMME works, and all other implementations seem to function similarly.

The connections between rows and columns are just switches.

While in a perfect world, rows and columns would be arranged exactly as they appear visually, this is rarely efficient to route in copper for more than twelve buttons. We produced the diagram below by scanning the keyboard membrane, then pushing a button while using the continuity tester to see which row and column wire were connected. The table at the bottom converts from wire signal names to the Arduino signal names used within the client library.
KH930 Keypad Topside

In order to connect rows and columns to a center rail, I used BC547 NPN transistors prototyped on an Arduino shield. Each has a 1K resistor on the base. Row transistors have the collector coming from the row signal and the emitter going to the common rail; column transistors are the same, except that the collector and emitter are swapped in order to fit the direction of current.
Keymu10 Rows

As each transistor conducts when only when its base is high, the Arduino can press a key by first dropping all outputs low, then raising a row control line (RCx) and a column control line (CCx) high. Because of debouncing and a limited scan rate, this must be held for a short amount of time before releasing the key.

Such a design fits perfectly well on a prototyping shield, although the transistors are a tight fit. I recommend first prototyping a single row and column to ensure that the transistors are properly aligned, as current direction might be different on your keypad.
Keymu Prototype

For those who prefer to have a board fabbed, here's a proper schematic and layout. Gerbers and Eagle CAD source files are available in the project's subversion repository.
Keymu10 Schematic
Keymu10 Shield

A more sophisticated software implementation would involve using the Arduino's serial port to communicate with the host, accepting strings in ASCII and translating them to keypresses. We decided against such a complication because we feared relying on a second long USB cable. Further, we thought it handy when necessary to be able to run the device stand-alone with a single (reset) button press from the operator signaling that the next pattern should be loaded.

Full keyboard emulator code is available either by pastebin or from SVN. You'll find it in banjo/code/arduino.
svn checkout svn://

The code works by using simple methods to press a row and column by raising those pin voltages. Higher level methods allow for such functions as loading a pattern from disk or printing a pattern, each by performing multiple key presses and occasionally inserting a delay. By placing this within the Arduino code's setup() function, the pattern is loaded whenever the device is reset.

New patterns are loaded from the Banjo Dinosaur Knitting Adventure 2D Extreme game by first starting a floppy disk emulator--as per Steve Conklin's technique--then pulsing the DTR line of the arduino in order to cause a reset. The Perl for that is just a single line,

The end result, with a machine typing by itself, looks a little like this,

That's all there is to it. With fourteen transistors and just as many resistors, you can script your knitting machine--or any other keypad device--from a microcontroller without modifying the underlying firmware.

As a final note, I will give a cookie to the first neighbor who uses this technique to dump all of the power codes from a universal infrared remote control, or to program something long and sophisticated into a graphing calculator that lacks a link port.

Banjo Dinosaur
Arecibo Pattern
Intel 4001 Art
Multi-Threaded Banjo Dinosaur Knitting Adventure 2D Extreme


James said...

This is one of those things where I'm slapping my forehead and saying "Why didn't I think of that?" I've been wanting to mod a scanner for computer control for awhile now. I never thought about taking advantage of the row & column addressing like this before. I was trying to come up with a way to clock a uC with the keycode scan and have it pull the appropriate row or column down. This is much easier. Thanks!

Andrew Kieran said...

That is proper good mate. as a textile student and amateur hacker i totally appreciate it.

there's nothing like upgrading old technology. sadly, my knitting machine uses punchcards, heyho

CarolinaKisslinger said...

this is awesome! I love video games, and as a knitwear design student this a sweet combination.
I'm trying to use Becki's tutorial to make my knitting machine do my own images but I havent got a clue what I'm doing really. i want to design fairisle Christmas style jumpers using old Nintendo characters and graphics

Unknown said...

I just wrote and posted code for doing keypad monitoring and control from an Arduino or other AVR to .

My approach doesn't need transistors.

Shay said...

I did this way back in the NES era. Some games had ridiculously long passwords for resuming game play where you left off, so I hooked a computer to a controller. This allowed me to just type the password into the computer when stopping game play, then have the computer enter it on the password screen later when resuming.

Unknown said...


Unknown said...

This is cool. I found this article about membrane keypads very interesting. Thank you for sharing!

Anonymous said...

Thanks for the post, but what to do about sites like ?

Anna Schafer said...

I expect to get such an adrenaline rush from knitting, much less from from this newfangled social networking nonsense.front load washing machine service

Unknown said...

Between the hundreds of sites about hacking someone's facebook account I found a software to hack a facebook account and its free. You can even download it to your PC from here

Anonymous said...

Very interesting topic, can you post some further information on this subject.
flexible circuits

naveen said...

Incorporated in the year 2010, Amba Steel is one of the foremost organizations in the market, vastly known as manufacturers, distributors, wholesalers, traders, retailers and suppliers of Food Equipment. Our offered items incorporates of Rotary Oven, Planetary Mixture Machine and Spiral Mixer. These items are generally refreshing and praised in the business sector for their ideal completion, predominant quality, low upkeep and dependable execution. Alongside this, these are given in different shapes, sizes and different determinations as per global quality models and rules.


commercial oven in delhi
rotary oven manufacturer delhi
biscuit oven manufacturer in delhi
Cookies dropping machine in delhi
commercial bakery equipment in delhi
bakery machine manufacturers in delhi

Blogger said...

If you want your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (even if they're dating somebody else now) you have to watch this video
right away...

(VIDEO) Text Your Ex Back?

Unknown said...

Thanks for this posting. The information which you have provided is very good. Keep sharing such ideas in the future as well.

flexible membrane keyboard traders

aarudhra said...

You are doing a very good job !!!! We are also manufacturers of Ovens in Chennai

Max said...

Nice post. I learn something more challenging on different blogs every day. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Naturally I’ll give you a link on your web blog. Thanks for sharing.

Nameplatemanufacturers said...

Thanks for sharing with us,Get a high quality membrane keypads from the membrane keypad manufacturer with affordable cost.

Lara Gargett said...

Not only in Solidworks, but also in other software related assignments, our experts can be extremely helpful. Our experts specialize in 3D mechanical design applications of Solidworks . When it comes to doing an assignment and you get stuck, don’t hesitate to get in touch with Online Assignment Expert for assignment help. If you are a university student and looking for assignment writing help then Online Assignment Expert is one stop solution. Our assignment writing experts in Australia serve the best assignment help Australia to students in order to solve their queries.

farnandazax said...

Your blog is very informative. Eating mindfully has been very hard for people these days. It's all because of their busy schedules, work or lack of focus on themselves. As a student I must admit that I have not been eating mindfully but because of this I will start now. It could help me enjoy my food and time alone. Eating mindfully may help me be aware of healthy food and appreciating food.
TeraStation 5810DN Series

Entertaining Game Channel said...

This is Very very nice article. Everyone should read. Thanks for sharing. Don't miss WORLD'S BEST TrainDrivingSimulatorFreeGames

Taylor Bara said...

You need to know only this tips to write a perfect college essay!

Puremelda said...

We are the best writing company providing Custom Research Paper Services to graduate and undergraduate students at reasonable rates. Our Custom Research Papers for Sale are reasonably priced to ensure that every student seeking to purchase a document can afford to get one from us.

Elec Flex said...

A very effective post on Membrane Keypad, keep sharing such information like this to help the beginners. Thanks again for the information.

Chris George said...

I have gone through your content, I found it quite interesting and informative. However, this is to let the readers know that My Assignment Services is offering online essay assignment help and other services for students who are enrolled in a programming language. We all are aware of the issues and challenges that a student encounter in writing programming assignment. Such students may be happy to hear that HTML assignment help is available in their region by a team of subject specialists. These writers are skilled, proficient and have years of experience in research essay assignment help, case study assignment help etc. My Assignment Services is firm offering web-based assistance in their academic concerns whether it is writing assignment, homework, project etc. Availing help from our services can be the best choice for you if you any issues with your academic tasks.

Leo5 said...

Your blog is filled with unique good articles! I was impressed how well you express your thoughts.
wps wpa tester for pc

meldaresearchusa said...

Money spent on hiring Research Papers on Nursing is a pale shadow of the amount you could have otherwise spent on Cheap Dissertation Writing on your own.

meldaresearch said...

Are you struggling with identifying an online Research Papers Writing Services provider which is credible to undertake your Custom Research Paper Writing Service task? Do you know how to access top-rated High Quality Research Paper Writing Services at some clicks from your personal computer?

monikalai said...

Thnaks for sharing,get an affordable membrane keypad at bashyam graphic.

aditya said...

I have read so many content on the topic of the blogger lovers however this piece of writing is actually a nice paragraph, keep it up.

Free Movie Streaming Websites
appvalley vip
firstrowsports alternative

Carol Bennett said...

When it comes to a movie review essay it helps one to get a deeper understanding in what the movie is about. Such writing requires critical thinking and creative writing.

ibt said...

IBT institute is offering result oriented coaching Classes in Chandigarh with good facilities like free study material, small batches, and regular doubt sessions Join IBT Chandigarh Today for SSC Classes

Spam Leads said...

Hey Guys !

USA Fresh & Verified SSN Leads AVAILABLE with best connectivity
All Leads have genuine & valid information

First Name | Last Name | SSN | Dob | DL Number |Address | State | City | Zip | Phone Number | Account Number | Bank Name

*Price for SSN lead $2
*You can ask for sample before any deal
*If anyone buy in bulk, we can negotiate
*Sampling is just for serious buyers


->Hope for the long term deal
->Interested buyers will be welcome

**Contact 24/7**
Whatsapp > +923172721122
Email >
Telegram > @leadsupplier
ICQ > 752822040

Qasim Khan said...

Great info. Thank you for sharing this fascinating information are a lot of people looking for posts like this. Write My Essay For Me Cheap

Amy Bella said...

Hello, I just wanted to compliment and thank you for your excellent work. As I guess, this is one of the most unique and informative sites that I visited in a couple of days. As you have great and engaging content and very well laid out and it was easy to read and understand. I also do a similar kind of content marketing practice. Please have a look and share your views.

webmaster developer
Hire Wordpress Developer
Development Services
freelance android app developer india

ireland assignment help said...

Do you find hard to seek a reliable homework writer in ireland? The easiest way to overcome the academic-related issues of ireland universities are homework help ireland .

Mithun Prakash said...

Hi, thanks for sharing such a nice blog.
Massage Therapist Services
Maid Services in Toronto

Mark Coblin said...

Thank you for this amazing post.
Just visit my site: coupon codes

Alex Kim said...

Do you face more trouble to get the certified translation servicesfor passport in Singapore?If yes,Don't worry this regard at we offer well precise,an effective translation of your passport at budget friendly price.

Sales Fundaa said...

Helpful InformationCRM Software in Mumbai

GRSoft Developers said...

Great Research Solutions Pvt. Ltd. ( GRSoft ) is an IT company with no geographical boundaries and provides all that you can think of around IT including consulting, solutions, applications and outsourcing services.

Hire Software Developers

GRSoft Developers said...

GRSoft Gaming is an honor winning, Live Casino game advancement organization of India. We offer curiosity and inventive game development with an exceptionally talented group of developer. Our bleeding edge gaming innovation creates esteem included gaming arrangements. Quality is our real worry for club game development. We offer tweaked Casino game development benefits over the globe and help you furnish with customized development. With our Casino game, individuals couldn't imagine anything better than to chance their gaining and appreciate the advantages. We have created numerous effective games like the video poker game, Sports wagering game, online club game, lottery games, and numerous other common games.

Hire Dedicated Casino Game Developers

Agarwal Packers an Movers said...

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

Agarwal Packers an Movers said...

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

Agarwal Packers an Movers said...

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

Agarwal Packers an Movers said...

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

Packers and Movers

pradeep said...

Great Article Nice Post Thanks for Sharing

GRSoft Developers said...

GRSoft's Remote IT infrastructure services are custom tailored based upon your business needs. Our Remote IT infrastructure services align network architecture and end-to-end communication, to ensure your company has the best IT solutions. We provide wide array of IT infrastructure services, right from IT infrastructure and consulting support to managing the most complex of IT infrastructural issues, with absolute precision.

Remote IT Infrastructure Support Services

Cylar Lucas said...

pay someone to take my online exam so they can do assignment and homework without worry and pressure. If you find difficulty in your online exam then connect with us. We have subject matter expert team members to give your online exam. we will give you 100% result.

Alex Kim said...

If you are looking for the most trusted translation services to translate Chinese written payslip into English then you must hire chinese to English translation. Here, a great community of expert translators always active to deliver you fast, flawless payslip translation at a budget-friendly price.

Retha said...

Academic Writing
Need Academic Assignment Help online? Get help from expert writers for Top Quality and Plagiarism free work. 24x7 Live Help. Order Now! an Academic Assignment Help Service To Up Your Level Of Academic Achievements
Academic Writing Help

Johnson said...
This comment has been removed by the author.
onlineAssignmenthelp said...

Online Exam Help
Are you Seeking Online exam help in the USA, Canada, Australia, and the UK? The simplest solution is to believe in online test preparations. There are numerous online exam help websites that provide a good range of tests to aspirants in various subjects also as academic levels. Thetutorshelp .com Seemore-

onlineAssignmenthelp said...

Online Quiz Help
Well, most of the people would say a “no” for this question and this is very obvious.Are you afraid of scoring less in the online quiz? Do you wish to have online help who would guide you through the quiz? Seemore-

nuuthana said...

Thank you for this post. Good luck.
Call Center Software

Dave said...

Hello everyone I want to introduce you guys to a group a private investigators who can help you with information you need in any situation in life and they are ready to follow you step by step until your case is cleared just contact +17078685071 and you will happily ever after

essay help zone said...

It is a commitment & effort of our team of UK essay writers that they fulfill all custom requirements of professional essay writing. The team of professional essay writers is hired based on high and complete qualification and experience in the respective field of their specialization. Plagiarism-free results are 100% guaranteed. This helps to produce the best quality for the customers. Confidentiality of your personal information and personal information is guaranteed & ethical responsibility.

Unknown said...

Great work and the art of writing skills is shown here. I would love it more to explore. CoDuniya

Haps said...

Nice Article, Thanks For Sharing This Informative Article.
Best Boarding School in Himachal Pradesh

Unknown said...

Thank you for sharing such great information.

Cracked Mac Apps said...

Hello there, You’ve done an excellent job. I will certainly digg it and personally recommend to my friends. I am sure they’ll be benefited from this web site.

Arcade VST Crack

RoboForm Crack

Crack Software

Pc License Keys

Cracked Mac Apps said...

Way cool! Some extremely valid points! I appreciate you penning this write-up and also the rest of the website is extremely good.|
Final Cut Pro Crack Free

Crack Software

Max Willor said...

Hands down, I agree with you on that. Well done for presenting such a beautiful post. The writers and editors of the Myassignmenthelpau platform are PhD and Masters qualified professionals who strive to online Assignment essay help services in Australian student achieve the highest possible grades in their academic program by helping them to submit flawless assignments every time. You can get in touch with them easily by making only a few clicks here and there.


I am very thanks for sharing this post with great mind and thought and it would be so worthful for the readers with IMyFone Coupon and we are looking forward to more.

unknown said...

it is the best website for all of us. it provides all types of software and apps which we need. you can visit this website.