Polarization Analyzer

With the help of two summer students (Jorge Ferreras and Thomas Bishop) and my lab mate (Matt Jones) we put together a polarization analyzer to help us set up polarization maintaining optical fibers. By having a real time feedback of what is the polarization coming out the fibre we can easily adjust the input polarisation so that the output is as stable as possible, thus, rendering a 20 minute chore into a 2 minute dance.

In the lab we only use very specific wavelengths of light so this polarimeter is only designed to work for one wavelength. The light goes into a motorized rotating waveplate, then passes through a linear polarizer and finally is measured with a photodiode.

Now, depending on the incoming polarization, the photodiode will detect different kinds of signals.
Modulated intensity signals

The form of these signals is given by

I(\theta) = \tfrac{1}{2}\left[A-B\sin 2\theta+C\cos 4\theta + D \sin 4 \theta\right],

where I(\theta) is the measured intensity as a function of the waveplate angle. The A,B,C,D coefficients are related to the Stokes parameters by
S0 = A-C
S1 = 2C
S2 = 2D
S3 = B

Once we capture an intensity reading I(\theta) after a revolution of the waveplate, we can extract the A,B,C,D coefficients using
A = \frac{1}{\pi}\int_0^{2\pi}I(\theta)\,d\theta
B = \frac{2}{\pi}\int_0^{2\pi}I(\theta)\sin 2\theta \,d\theta
C = \frac{2}{\pi}\int_0^{2\pi}I(\theta)\cos 4\theta \,d\theta
D = \frac{2}{\pi}\int_0^{2\pi}I(\theta)\sin 4\theta \,d\theta


The photodiode signal and rotation of the waveplate are measured using an Arduino. A python application was developed using pygame to display the result. The communication and plotting is discussed in detail on a previous post.

In our software we display the photodiode signal on the left so we can adjust the intensity of the incoming light such that the photodiode receives enough light but it’s not saturated. The measured polarization is displayed on the right as a red dot in the PoincarĂ© sphere. The blue dots on the sphere represent previous polarization measurements so we can observe the time evolution of the polarisation.


The drawing of the sphere is based on Peter Collingridge’s tutorial here.

All the code can be downloaded from github.




The design of the piece contains two main holes for allocating the ball bearing and the motor. Right below the ball bearing there is a small place to fix the photodetector used to count the turns of the waveplate. There is also a hole in the side just to pass the cables from one side to the other.

It would be a good idea to separate a little bit the two main holes from each other when manufacturing the metal piece to help the gears to work better.

The gear in the parts list is transparent for the IR light, it needs to be covered with an IR-opaque material only leaving the reference hole clear.

Base plate to hold motor, gears and photodiodes in place.

Base plate to hold motor, gears and photodiodes in place.

Mechanical drawing for base plate.

Mechanical drawing for base plate.

The built result is shown in these photographs:

frontsvg back


Our main reference was Sebastian Arnoldt’s Bachelor thesis.

Copy emails between IMAP servers

I was assigned an email account which I could only access through a dated online interface called Outlook Web Access or using IMAP4. I like to keep all my email accounts together by importing them to my Gmail account. However, Gmail doesn’t allow IMAP importing and this email provider doesn’t allow forwarding so I ran into an impasse.

Kidnapped email

To get around this problem I tried several programs, but they either required a complicated setup of an SMTP server, which also altered the email headers, or didn’t work with IMAP SSL. The solution at the end was the following python script, which I run from a raspberry pi every 10 minutes as a cron job: