Light Nib

Introduction:

Light Nib

This project is an intent to join two visual arts on which creativity and technique are always present: calligraphy and photography. Accorrding to wikipedia, calligraphy is a visual art related to writing; as for the photography, it literally means "drawing with light". If you are into lettering or light painting this can be useful to you.

This Comment/How-to describes how to join these two areas with electronics and some programming. Instead of using ink and paper to write nice calligraphy letters, we are using LEDs to paint/write letters and the canvas will be our photo frame. There are some basic techniques that will be described for calligraphy and photography, but for the most part, some extra references will be listed so you can dig into more details if you want.

In Photography, light painting is using long exposure photography to create magnificent light effects with a portable light source and loads of experimentation. The tool created to draw calligraphy with light is something I'd lke to call: 'Light nib'. It is heavily based on Arduino.

If you prefer to draw complete images, you can take the fully automatic approach such as this great projects did: LightScythe runs on Arduino, so storing big or many pictures is something to take into account. The results are something similar to the Persistent-of-Vision (PoV) effect. The guys at Adafruit did a great job on sharing this tutorial on how to create similar results using a raspberry Pi (a platform where storage is not an issue).

The 'light nib' is not an automatic tool. Instead, it is light source that reacts to commands and gestures that the artist gives to the nib. Just like a real nib, it can change its color and react to hand gestures to modify the width of the stroke. The final result: calightgraphy.

Step 1:

The idea behind the light nib: Calligraphy

The name of the lines dictating the height of every letter.

The stairs commonly used to measure the height of every letter.

Celtic calligraphy (4 nib height, nib is 3.8mm long)

Roman calligraphy (6 nib height, 6mm nib).

Celtic calligraphy (4 nib height, 1.5mm nib)

The 6mm Pilot Parallel Pen. Look how flat it is!

My pens with different nib sizes. The Green is 3.8mm. Blue 6mm, both are Pilot Paralle Pens. The black pen is a Lamy Joy 1.5mm.

The height of this letter is 6 nibs in height. The pen used is the 6mm Pilot Parallel pen.

All you would need to get you started with Calligraphy, a notebook and a pen. A marvelous and inexpensive hobby.

The name of the lines dictating the height of every letter.

The stairs commonly used to measure the height of every letter.

Calligraphy has been around for centuries. It was used before the printing machine was invented. Calligraphers were the people in charge of creating unique pieces of art using writing. I started practicing some calligraphy and then the idea of the light nib hit me.

The angle of the nib is very important when practicing calligraphy, let's use an IMU!

Inks can be of any color visible by man, let's use RGB LEDs!

Unfortunately it is impossible to cover all there is about Calligraphy on one Comment/How-to. However, if you are interested in Callipgraphy the book from Margaret Shephert named Learn Calligraphy the complete book of lettering and design is a truly easy and inspiring way to get into this beautiful art. I bought the book on Google books.

The basic rules are important, because they bring order when using the light nib:

Letters are written with one or several strokes! You can find educational calligraphy alphabets, indicating the order and direction of the strokes. Like this one, you get one in the booklet when you buy a Pilot Parallel Pen. To simulate this, the light nib requires an ON/OFF button to simulate strokes.

Five lines dictate the size of any letter, lower or upper case.

The baseline serves as the reference to every letter.

The midline will be the maximum height for the main body of the lower case.

The descender and ascender mark the maximum length of the lower and upper extensions of the lower case, respectively.

Some letters have a capital height, others use the ascender line to limit the capital height.

Many letters use a straight nib and they have different sizes, depending on the size of the letter and the style of the calligrapher. Because of this I chose a bar of LEDs.

Every Calligraphy style defines an angle of the nib to be used during writing. Some letters may require you to change the angle of the nib. Here's where the IMU becomes useful.

My two cents on how to get you started on Calligraphy. Buy one 3.8mm parallel pen from Pilot, they are cheap, and that's it! I assume you already have one notebook and pencil. Optionally, get one Rhodia notebook, they work great with Parallel Pens.

Remember, practice makes perfect! Calligraphy is no exception.

More information on typography and all the lines that define a typography.

Step 2:

The scenario

The camare is on the back.

The camare is on the back.

Lights should be turned off.

Lines are drawn on the canvas, delimiting the size of letters.

The user faces the canvas. Writes naturally.

The light nib rests on the hand of the user.

Buttons to trigger patterns.

The RGB Led faces backwards

The cangas is an empty space :D

The light nib resting on the hand of the user :)

The light nib on a dark environment.

The camare is on the back.

The camare is on the back.

Lights should be turned off.

Lines are drawn on the canvas, delimiting the size of letters.

The user faces the canvas. Writes naturally.

The light nib rests on the hand of the user.

To make it usable, the light nib had to be ergonomic and ready for right and left handed people. Another important thing to take into consideration is the arrangement of all things when taking the long exposure photo.

To make the writing more natural the light nib, held by the user, projects the light backwards. The user can concentrate on writing, paying attention to limiting lines previously defined on the canvas. The camera is located on the back, the user can write normally and their movements will be captured by the camera. Of course, the light on the room has to be completely off, so that the camera only captures the light coming from the LEDs.

The images on this step represent the scenario, the way the light nib is held, a photograph of how it looks on a dark room and lastly, a little video showing how it works.

Step 3:

Materials

The Arduino Pro mini with all headers soldered ready to rock and roll.

The NeoPixel Bar :D

ArduIMU V3. It has a 6 header serial connector, compatible with the FTDI cables.

The Arduino Pro mini with all headers soldered ready to rock and roll.

The components required to build a light nib are basically:

A programmable Micro Controller Unit (MCU).

One Inertial Measurement Unit (IMU).

One bar of LEDs.

Any kind of toggle switches.

A portable power source.

The past list is too general and can be sufficient for the most experienced makers out there. When choosing all components, it is important to make sure that the power levels on every component are compatible (3.3 or 5 volts). The light nib only uses 5V components, here is the detailed list:

The light nib described here uses a USB cable and a cell-phone portable charger as a power source.

Portable cell phone chargers are very common these days and they basically consist of one big battery. Because power travels through two of the four lines of a USB cable, an old cable was repurposed to power the light nib.

If you run into trouble on how to interface components with different power levels, you can take a look at this nicely written PDF.

ArduIMU has been discontinued in Sparkfun, but there are plenty of options to measure absolute position. My recommendation is this IMU breakout board from Adafruit. It really looks awesome, it is 3.3V and 5V compatible, leaving you a plethora of compatible MCUs to chose from.

Step 4:

The electric diagram.

The electric diagram is very simple.

Power comes from a usb cable that has been repurposed. When connected to a portable cell phone charger, it will provide the power to the light nib.

The power lines are connected to all electric components:

ArduiIMU

Arduino

NeoPixel

The serial TxD line from the ArduIMU is connected to the TxD line in the Arduino. In order to receive the orientation data.

As explained by the Adafruit tutorial, the Neopixel is connected trough a data line and some passive components to the Arduino.

The mechanical switches have a pull up resistor.

Step 5:

The Software

The software running on the Arduino is very straight forward. But first, it worth mentioning the following:

The ArduImu has a serial communication port. The Arduino receives serial packages from the IMU that then decodes and translates into numeric values denoting the orientation of the board. This part of the code would have to be modified if you use other IMU, specially if you choose an IMU that communicates with I2C or SPI.

The NeoPixel library has been developed by Adafruit and it is very easy to use. Here's the tutorial.

The arduIMU wasn't easy to setup, but this tutorial helped a lot. The code shared on that page had some issues, let's assume it was because of the firmware version running on the ArduIMU. After some debugging It worked nicely.

The light nib has 2 switches to interact with the user and turn it on or off.

What the software does is:

During setup, the code configures: the Input pins to read the switches, the serial port to receive data from the ArduiIMU v3 and the pins to control the NeoPixel.

Once in the loop section of the code:

The readPacket() function receives and verifies the code received from the IMU. It returns true if the packet is valid, false otherwise.

If a valid packet has been received, the state of the switches is read with the function ReadInputs(). This function enumerates all possible combinations of the switches. For two switches, the total combinations are 2^2=4. The enumeration starts with 0, this indicates all switches are off, this is used to power off the LEDs.

The combinations is decoded using a switch instruction, apart from the off condition, there are 3 more combinations used to trigger other patters of the light nib.

Once the corresponding pattern has been drawn on the LEDs, the loop starts again.

You can have as many switches as you want to trigger different light effects. Adding a third would give you the possibility to have 2^3=8 possible combinations. But pushing that many buttons while drawing can be difficult, but still a possibility. The flow chart attached to this step, describes what has been discussed.

The Zip file includes three folders for you sketchbook directory:

ReadBinaryArduIMUV3- The code to receive and decode the packages from the ArduIMU in the Arduino.

NeoPixelTest- The code shared by Adafruit to get started with NeoPixel. The NeoPixel library is not included.

LightNib- The full code to get the light nib running, using the hardware described here.

Step 6:

Putting everything together.

An early experiment. All components are connected together.

This is a capacitive toggle switch from adafruit.

Solder some headers to the arduino pro mini.

First steps, solder the headers to mount the Arduino pro mini

First steps, solder the headers to mount the Arduino pro mini

First steps, solder the headers to mount the Arduino pro mini

This 90 degree header will be used to mount/connect/power the second board.

The limit switch was soldered to the board.

Extra headers to solder the other terminal to the board.

The old USB be cable to be used as power plug.

The USB cable stripped. RED is 5 volts, black is ground, white and green are data lines for USB. You can cut them.

The board is ready to house the Arduino and the ArduIMU. The switches are soldered and the pull up resistors, too.

The second board will house the NeoPixel board. It has the capacitor and the resistor.

These two 90 degree headers were used to fix the NeoPixel bar with solder.

The wires used to power the NeoPixel bar

These two holes are used to solder the bar to the PCB.

The Neopixel bar has ben soldered and the wires too!

Another view of hoe thr neopixel bar is held in position.

Power lines

Power lines

Power lines

Power lines

Power lines

Power lines

The USB cable already soldered and fixed to the main board. You can see the red and black cables connected to the main power lines.

A jumper was used to interrupt the RxD line from the ArduIMU. It is necessary if you require to reprogram the arduino without taking it out of the PCB.

The zip tie used to lock the USB Cable is very close to the jumper to interrupt the serial cable.

Very simple wiring to get the light nib working

The fist Board with all the wiring fo the ArduIMU and Arduino.

The second board is ready.

You have to be extra careful to align the two boards. I marked the VCC line with a Sharpie.

Be extra careful to alighn the two power boards and solder them together with the 90 degree header.

With the boards, mounted, you are good to go.

Another view of the Light Nib

Another view of the Light Nib

Another view of the Light Nib

Buttons to trigger patterns.

The RGB Led faces backwards

The cangas is an empty space :D

The light nib resting on the hand of the user :)

An early experiment. All components are connected together.

This is a capacitive toggle switch from adafruit.

To put everything together, two premanufactured PCBs were used. They are united with a straight angle header.

The first board carries the arduino pro mini, the arduimu, the two switches and one usb cable for power. The arduino and the arduimu are mounted on the first PCB with female-headers, this makes it easy to reuse these boards in future projects.

The second board carries the neopixel and their corresponding components, a 1000 uF capacitor and one 470 ohm resistor.

If you will follow the idea here presented, be extra careful when defining the lines you are using to transmit power to the second board through the 90 degree header.

When connecting the usb cable, pay attention to the colors, black and red. If you are not sure, use one multimeter and connect the other end of the cable to a wall charger for smartphones. Of course, you have to make sure that none of the cables are in contact when plugging it in.

It would be cool to make a 3D printed vessel for this strange shaped device.

Step 7:

Results! (After some practice) :D

The pattern is completely white, but some LEDs are off.

Rainbow colors! :D

Lovely!!

I love you!Different patterns were used.

This pattern was created by slightly changing the orientation of the Light-Nib

Another pattern that changes colors and intensity, depending on the orientation of the light-nib.

It means: Hen!

The pattern is completely white, but some LEDs are off.

For "light painting" photography you will basically need a camera with manual settings and a tripod. It would be useful if you have an off-camera flash, but it's not completely necessary to get you started.

You'll need to be in complete darkness to get the best results and a good advice is to wear black clothes and black gloves. You won't need to use the flash at the beginning.

Basic steps to do light painting:

Set up your tripod on a stable surface.

Set your camera to:

Aperture mode (A) tag on Nikon and (Av) Canon cameras.

Autofocus.

ISO: 100

Aperture: F/22

Shutter speed: 30 seconds (you could vary this later)

When the person that is going to write is standing in front of the camera, press the shutter button halfway down to start the autofocus, then, press all the way down to start taking the photograph.

When you finish your writing, stay away from the framing area and wait for the camera to finish taking the picture. Don't move the camera or press any button until it is done.

Look at the results and make adjustments in the previous settings only if necessary.

Repeat and keep trying until you get the best results. You’ll just need to vary your shutter speed based on the amount of light and the complexity of your painting.

After many experiments using the light-nib, the work paid off! :D

The cool thing is that you and create as many patterns as you want by interpreting the IMU data!

Changing color is one simple move, the next is to vary intensity, turning on and off some LEDs... whatever you want.

Comments

Add a Comment

Sign in to comment.

Adapt or Translate this Article!
Is this article useful to you? If so, take the time to translate it into your language so it can help others too! Or adapt it to better suit your needs, taste, or local context.