Stupid Pet Trick
Here’s the video of our first real assignment for Physical Computing: the Stupid Pet Trick!
My project is a low-fi DJ set made with a PC fan for the scratching turntable, a hacked walkman to play cassette tapes at the desired speed, and an Arduino to map these two. There are also some LEDs to show the speed of the song in another way.
My initial idea was to have the fan acting as input and output at the same time. I intended to have it rotating all time at the speed of the music (output) and let the user slow it down or speed it up to control the song (input). To achieve that, I wanted to read the rpm of the fan through its third wire, as explained in this tutorial, but I didn’t success in it.
I really don’t know the reason. Maybe the fan was broken, maybe I was doing something wrong, but more probably it was because the so-called hall effect only appears at high rpm, not the ones you can produce manually. So I had to think of another trick: use the motor as a generator. This way I can measure the amount of current generated by the manual rotation of the fan. It’s not as accurate, but it’s enough for this project. But be careful when doing this, since you don’t want to plug more than 5V to an Arduino pin! I tested and the voltage generated was really small, but for higher amounts a voltage divider should be used.
Finally, I’d like to comment one of the most delicate parts of the project: the mapping, which is not linear at all. First, the reading from the fan had to be smoothed because it’s really unstable, but not too much to avoid delays between action and reaction. Second, writing the right voltage to the walkman motor became hard because it changed depending on many factors:
- The minimum voltage needed to start the motor is higher than the one needed to run it when it already started.
- The amount of current affects the motor even more than the voltage, so analogWrite(150) behaves very differently when the Arduino is plugged to the computer, to a 9V battery or to a power adapter, even you are providing always the same voltage.
- At a certain voltages, the motor wasn’t powerful enough and produced a very annoying sound.