# Ngdon-Darca-Object

## The Toilet Paper Printer

The Toilet Paper Printer plots data in realtime on a roll of toilet paper. It can accept data such as a simple sine wave, amplitude of noises in its surroundings, or even any data curled from the internet. Its circuit mainly consists of three littlebit DC motors and a cloudbit, while the entire structure is built with cardboard boxes, straws, and toothpicks.

Video

Inspiration

I like plotters. As a kid I enjoyed ripping off the top of a printer while its printing and peaking into the machine as it worked. So when I saw all the motors we’ve got, I suggested that we can make our own plotter/printer thing.

We spent most of our time figuring out how to make a print head that actually works.

At first we tried to make a conveyer-belt-like mechanism to move the pen. That didn’t work because little bits motors couldn’t their change direction of rotation in real time. So I designed a logic circuit which splits the analog input to control the motors separately. This didn’t work either, because the axles are locked even when the motors are not activated.

I came up with the idea of a gear and a rack when I suddenly realized that the wavy layer in cardboards could serve perfectly as the teeth of the gears. We made both the gear and the rack out of peeled cardboard, and powered the gear with the only motor that can rotate both ways. It worked.

There is rail at the bottom of the print head, so it could slide smoothly left and right.

The Paper Feeder

We had a couple of ideas how this could look like. One is that the printer should have wheels like cars and drives back and fro on the paper. Later we decided to print onto a motor-driven toilet paper, because it’s both easy to implement, and interesting as a concept.

We made two gears, rotating in opposite directions, fixed very close to each other. Thus the paper which is placed in between them gets driven out.

Littlebits Circuit

The Software

We used cloud bits to receive data from the computer over wifi. Basically a processing program gets input from the microphone, writes it real time into a text file, which is then read in real time by an AppleScript script, which uses shell commands to communicate with the cloud bit API.

Code

Processing:

```import processing.sound.*;
Amplitude amp;
AudioIn in;

void setup() {
size(640, 360);
background(255);

amp = new Amplitude(this);
in = new AudioIn(this, 0);
in.start();
amp.input(in);
}

void draw() {
background(255);
float aa = min(0.99,amp.analyze()*10);
//println(aa);
line(0,aa*height,width,aa*height);
saveStrings("audioin.txt", new String[]{""+aa});
}

```

AppleScript:

```set p to "/Users/lingdonghuang/Documents/Processing/audioin/audioin.txt"
set f to 0
set lf to 0
set i to 0
try
repeat
delay 0.2
try
set f to (read p) * 100
end try
set d to (f - lf) * 0.4 + 50
if d > 80 then
set d to 80
else if d < 20 then
set d to 20
end if
set d to d - 3
set a to do shell script "curl \"https://api-http.littlebitscloud.cc/v2/devices/243c201dc4f7/output\" -X POST -H \"Authorization: b97ba2fe26cdb3de50b2ead1c2838e0c13e244f0d628a0c5a20a8ca3d6d358ab\" -H \"Content-type: application/json\" -d '{ \"percent\": " & d & ", \"duration_ms\": " & -1 & " }'"
set lf to f
log {d}
end repeat
on error
log ("STOP!")
set a to do shell script "curl \"https://api-http.littlebitscloud.cc/v2/devices/243c201dc4f7/output\" -X POST -H \"Authorization: b97ba2fe26cdb3de50b2ead1c2838e0c13e244f0d628a0c5a20a8ca3d6d358ab\" -H \"Content-type: application/json\" -d '{ \"percent\": " & 50 & ", \"duration_ms\": " & -1 & " }'"

end try

```

The Box

Made of laser-cut white and frosted plastic.

Reflections

Little bits sucks. They might sound like a nice idea, but when you actually want to make something with them, they only “kinda works”. They make you want to trample on them and fling them out of the window. But in general we’re quite satisfied with what we’re able to achieve.

I enjoyed the process of struggling with the littlebits and the cardboards-and-straws mechanisms we had. Instead of being able to make whatever I want like coding in Processing or Python, we had to constantly take into consideration the flakiness of little bits and the straws, and challenge ourselves into coming up with more and more robust and reliable solutions.

The thing that excites me most is being able to make a working printer entirely out of trash. In the future I can probably improve the hardware and software so that it will be able to write letters and even make drawings. I’m going to publish the recipe so even beggars can own printers.