Tektronix data in Python

Screenshot of python code for viewing and saving data from Tektronix scopes.

Screenshot of python code for viewing and saving data from Tektronix scopes.

In the Photonics and Quantum Optics lab, I’ve made open-source a high priority. With that in mind, we’ve written software to interface with many of our instruments. We also rely on github for version control and dissemination of our code. I’m particularly happy with a small application that pulls data from a Tektronix oscilloscope (tested on TDS1000 & 2000 models). This is my first python GUI app, despite having worked in python quite heavily for the past 12+ years. If you are interested, the work-in-progress code is available and should work for a Tek scope plugged in to USB on a linux host. I can’t promise it works on other platforms.

Here is a partial list of the requirements:

  • Python
  • numpy
  • matplotlib
  • wxPython
  • python-usbtmc

All but the last are fairly standard for scientific use of python. The last can be installed by your package manager. In Fedora, run

yum install python-matplotlib-wx

and that should ensure that you have all but the last of these components installed. I used the python package manager “pip” to install the usbtmc package:

pip install python-usbtmc

Credit for this project also goes to Eli Bendersky for an awesome example that got me 90% through this process.

Doppler Radar from Surplus Equipment

For the final projects in my electronics class, there are always a lot of different interests. One student wants to create a radar gun based on doppler-radar principles. This is a more complicated project mostly because at microwave (2—12 GHz) the devices in a circuit don’t act like the nice simple components we study with Ohm’s law—everything becomes an antenna or a waveguide or both. That said, there are a lot of scrap electronics around with GHz-range components and in fact we have a whole bin of old demos that were designed to show wave effects of microwaves (micro-waves, not the ovens!). The figure shown here is a modern version of what I found.

microwave apparatus

Example microwave demonstration apparatus

You may be able to find an old setup on eBay or lying around in a demo room somewhere collecting dust. These are still very usable in their original purpose, but I wanted to go a little further since radar is a very practical application of 10 GHz signals.
Continue reading

More planned failure

We need more planned failure in the college experience.

I couldn’t agree more. I’ve mentioned this before but I am still not satisfied that I have added planned failure in any large-scale way. This quote comes from the Tomorrow’s Professor Msg.#2171 posted Sept. 16, 2013. The main premise of the post—to make college more like a video game—is centered on the idea that learning takes place after failures and to improve learning, we need to add more planned failures. The most important part of these planned failures is that they are low-stakes. In other words, we don’t mean more F’s, we mean more times that the student a) makes a mistake, b) has quick feedback, and c) has another low-stakes attempt. Video games reinforce this style of learning, hence the thesis of the post. In a video game, there is no cost to a mistake other than the time it takes to try again. Why should mastery of an academic concept be different? 

Continue reading

VernierI have been teaching with Vernier hardware for at least 10 years, so it is great to see them supporting work on the Arduino platform (another passion of mine). I’ll keep an eye out for the Sparkfun boards this fall, this is a great way to get more sensors available for use in our electronics class projects.

They have a very nice guide to interfacing with their sensors:

And more announcements in the newsletter:

Vernier + Arduino

5 minute workbench

I've had grand plans to build a custom workbench for my research lab, but other projects take up my time and kept it from happening. Then in a moment of desperation while trying to move a desk out of the lab, I realized it could complete our workbench. An aluminum rod for the spool holder and two angle brackets to hold it in place. Grand total, $7.49 and 5 minutes to move and build.


Laser Diode Protection Circuit

PCB for laser diode protection circuit

PCB for laser diode protection circuit

Our lab is building our fourth and fifth lasers so I finally got around to documenting some of the process. I’ll be posting related items here in order to share the lore and hopefully help others get to a finished working laser. This installment covers our standard laser protection board [1]. This is a small circuit board that is installed between the laser current supply and the laser diode itself. Specifically, the board is as close to the diode as practical in order to provide maximum protection from voltage spikes, surges, and other nasty stuff. The circuit is pretty simple, a filter reduces noise, three forward diodes will not conduct for normal operation (they won’t conduct until the voltage hits 2.1V which is higher than most laser diode operating voltages). There is also a Schottky diode at reversed polarity to provide fast shorting for spikes of the opposite polarity.

The board is simple, and you could certainly make one on some sort of perfboard, but I went ahead and put together a PCB as an excuse to play with circuits.io — a handy site that combines schematic capture, PCB layout, and board ordering in one online interface.

The PCB and schematic are available for our Laser Diode Protection Circuit, and you can order all the parts from our Mouser Project. You may have many of the parts already, and the board is 100% through-hole so you can hack it to your hearts content.

[1] Many folks use this circuit, I first saw it in the paper by MacAdam et al., and subsequently in a design specified by Todd Meyrath. Please correct me if I should cite someone else.

MOT cloud drop

For the 2013 ALPhA immersion workshop on teaching with the magneto-optical trap (MOT), we hosted two visitors who came to learn about the MOT and how to set one up to use in a teaching context. By the second day, they had already taken apart our working setup, and reinstalled it on the optical table. Here is a video of the trap in action. When the magnetic field is turned off, the atoms drop out of the trap (due to a combination of gravity and an unbalanced optical force in the vertical direction). This cloud has between 15 and 20 million atoms before the trap is released.