Lousa mágica & Lousa paramétrica
Tools for drawing with potentiometers (take a look at the GitHub repo!)
Lousa mágica is something like “magic blackboard”, it was the name in Portuguese of the “Etch A Sketch” drawing toy that inspired this project. Then Lousa paramétrica would mean something like “parametric drawing board”.
Lousa mágica video at Sesc 24 de maio - credits: João Adriano Freitas
- Lousa mágica was inititally presented as part of Estúdio Hacker activities at the inauguration of Sesc 24 de Maio, on August 2017 (video above). It used 6 potentiometers for drawing and drawings could be erased by tilting the control box. It was also possible to post tweets with the drawing content (using a Twitter API library).
- On Estúdio Hacker Day (September 7th, 2017), also at Sesc 24 de maio, a workshop was held where the participants set up a version of Lousa mágica with 4 potentiometers in a protoboard.
- Setups with 4 potentiometers using a variation of the Lousa mágica software and a new version called Lousa paramétrica with a recursive parametric drawing of a tree were displayed at the Sesc Art Circuit 2018.
- Several sketch-a-day project drawings can be used with the same setup.
TO DO: more 'usable' drawings links
- Arduino (or similar board) with at least 4 analog pins;
- USB cable to link up the Arduino to the computer;
- 4 to 6 linear 10kΩ potentiometers (type “B”) (you can use 2 or 3 but it’s not as cool);
- Protoboard and jumpers;
- Computer and monitor (or a laptop) running Linux, Mac or Windows. Use a big TV or a projector for bigger impact on guests!
- Optional: button or mercury tilt switch (the computer keyboard may be used instead) and 10kΩ resistor (if it’s a button/switch connected to a pin other than
Connect your Arduino/board to your computer, open the Arduino IDE, and in the menu
File > Examples > Firmatalook for the sketch called Firmata All Inputs. Next, select your board’s model in
Tools > Board:, and in
Tools > Port, the USB/serial port the board is connected to. Lastly, click the
➔button to upload the sketch to the board;
- Some Arduino clones need a special USB driver: How to Install CH340 Drivers
- If you use Linux, you might not have permission to access the USB/serial port, that can be corrected by typing
sudo usermod -a -G dialout <your username>in your shell prompt.
Open the Processing IDE and download the Arduino (Firmata) library in
Sketch > Import Library... > Add Library.... We suggest you select Python mode on top right corner menu of the IDE instead of the default
Java(detailed instructions here);
Connect each potentiometer to your Arduino/board according to the image:
4.1 Connect the side terminals of each potentiometer to the
4.2 Connect the central terminals to the board’s analog pins:
Optionally, if you chose to use a button/switch to erase the drawing in Lousa mágica, it must be connected to the
Digital 13pin and
If not using the
D13pin, connect the chosen pin terminal to the 10kΩ resistor (so called pull-down resistor) and to the
GNDpin simultaneously. The
D13has a built-in pull-down
Copy the code
LousaMagica.pydefrom this repo and alter the number of your serial/USB accordingly! Test using the number of ports that appear in the Processing console, starting from the top of the list:
NUM_PORTA = 0.;
- Linux: confirm you have access to the USB/serial port (as mentioned in item 2).
- 64-bits Windows: Processing might download the incorrect version (32 bits) of the serial library. You can solve this by deleting or renaming the file in
C:\Program Files\processing-3.X.X\modes\java\libraries\serial\library\windows32\jSSC-2.8.dllas documented in issue 227.
Explore other versions in the repo
- Lousa mágica:
- Lousa paramétrica:
Arduino Nano example
Definitive setup suggestions
- Tools: pliers and soldering iron;
- Use a tilt switch (mercury switch) instead of a button on
D13to erase drawings in Lousa mágica.
- Setup in a box with a transparent panel, with holes for the potentiometers.
- Pong with potentiometers, Dojo version:
- “Wireless” version made by João Adriano Freitas: