A python script on my Raspberry Pi is now typing on my typewriter, not optimized yet, but working. Yeah! zzzzzzzzzzzzzz
I am turning an almost hundred year old typewriter into a Twitter printer.
An update is needed here, since a few things changed, not as much progress as wanted was done though.
I decided for the future of the project to use a Raspberry Pi to operate the typewriter and the connected webcam.
Arduino WiFi Shields are expensive compared to a $10 WiFi USB dongle. Also I can plug in a fairly cheap webcam via USB to the RPi to show images of the actual print job without bothering a network camera. However, I had an RPi around and got the needed python script to read from an API (the typewriter API) and send according signals via a cobbler board going within half an hour.
The RPi runs a python script that does nothing else than grab a string from an API.
So it basically just gets a string, like “print me this please” and will then according to the characters, send the right signals to the shift registers that control the transistors that will trigger the solenoids. Also it makes a cartridge return and new line when needed based on settings, like every 10 characters.
Compared to having the web based print queue push jobs to the typewriter via arduino and probably bother it too much if stuff goes wrong, the RPi python script only asks for jobs if it is okay to do so, but does not have to worry about anything else, other than the paper size.
That also means if I need to reload paper or whatever happens, I just unplug the RPi and fix the typewriter while the online print queue can keep growing.
Also the API will only have jobs in the print queue if the web app decides to put them in there, so it can be from there configureable if hashtags from twitter, or just retweets from one account actually go into the queue.
Therefore there will be an interface to maintain the print queue (auto fill print queue because of name / hashtag, delete tweets, prioritize tweets, easter eggs, etc)
Furthermore, the web based print queue manager can send out tweets/ reminders / emails 5 min before your job is coming into the typewriter so you can watch it happen and after it is done send you the link where to find the screenshot of your print being done.
Considering my last post, I did move on quite a bit:
- Tested the shift registers (but new challenge with the raspberry now) need to to it again.
- Laser cut pieces are wonderful but I got at some point cm and inches mixed up, no biggie, but will do it again some day. The solenoids are not working right now anyway, I switched to fishing string, it has therefore a little play that won’t trigger the key enough to do the trick. I will need to go back to wire when the solenoids are sitting exactly under the keys.
- Cartridge return I tried a few things now. Some very promising, some just crazy. Undecided what to go for.
Anyway, most of the software got figured out, since I had to step away from the hardware for while to brainstorm again about the hardware.
If you have ideas, let me know. Cheers, michael
I am converting an almost 100 year old typewriter into a printer that will print your tweets to it on paper while you can watch it on a webcam.
It has been a good week for the typewriter to printer conversion project.
- Andrew helped me put together a table I designed for the typewriter. Basically I just went to Home Depot and bought 3 pieces of lumber ($15) and figured out how to cut them to get what I need out of them. Turned out pretty stable. Maybe I should build more of them anyway, quite good size for a standing-work desk and dead cheap.
- SolenoidsI bought turned out to have enough power to pull the key down enough to strike. This showed though, that they will all need to be individually adjustable, since each key has a little different resistance.
- I finally got almost all the electronics I need (another motor probably for better cartridge return), so I started soldering the control board and it works very well with the arduino. (right now still connected to a computer to read from keyboard and send pull to according solenoid. At some point I will use a WIFI arduino to make have the least cables possible go into the table to make it moveable)
- Configured an old network camera to show what the typewriter is doing on the web. Important to show people what is printed after they send their tweet to the typewriter
- Jane helped me figuring out how the online representation should be. We will open a site called something similar to “le petite print shop” and give the typewriter its own “business” where you can get your tweets printed.
- check the shift registers (74HC595), in a daisy chain for 32 different outputs. I found a source for them at Creatron here in Toronto because of Jon who is working on a very cool flipper project.
- Finish soldering the control boards (2 boards with each 16 transistors and 2 shift registers to control 32 “actions” all together.
After above two steps are done, the electronics soldering part should be done, just a few pins from an arduino will go into the shift registers and control all keys. Not sure yet if also the cartridge return and new line motors will / can go through that or if they will be connected directly to the arduino. However – should not be an issue.
- Laser cut 3 pieces that will let me move the solenoids up and down and fix them in position with a screw. Will do this at site3 here in Toronto, a really cool spot to build hardware.
- Fix motor with gears on new line gear (this is all moving with the cartridge return, therefore not that easy)
- Find new motor for cartridge return, maybe same one as new line anyway?
- Make sure it is easy to move and setup (just one cable to plug in and WIFI setup on arduino / also setting twitter hashtag or account on the web server to line up tweets) so we can actually take it somewhere to show people during events or at places.
Feedback / Ideas – let me know!