Skip to content

USB Measuring Board and USB Attenuator.

License

Notifications You must be signed in to change notification settings

vojtamolda/usb-board

Repository files navigation

USB Measuring Board & USB Attenuator

Wouldn't be cool to drive any experiment directly from your computer? Without the need to get up from your chair and touch things? Well, now your computer can directly flip switches, measure voltages, send signals and talk to other devices using the USB Measuring Board or USB Attenuator!

board_diagram board_pcb

If your applications is simple and requires just a few inputs and outputs then USB Attenuator is the right solution. USB Measuring Board is more versatil and can handle control of more complex experiments. See board.md and attenuator.md readme files for more details.

Both projects were originally inspired by the needs of the Department of Low-Temperature Physics, Charles University, Prague, but obviously range of application is much wider. USB Measuring Board was developed as part of my bachelor thesis written in 2009. If you're interested in how it all works, take a look at the prototypes.

Compilation

So... How do I build this monster? It's not as complicated as it looks. Build chain uses QMake (part of Qt framework). Besides Qt, you'll need two libraries that provide USB communication - libftdi and libusb. Tested platforms are Mac OS X 10.11, Ubuntu Linux 14.04 LTS and Windows 8, but chances are it would run on any platform supported by Qt and libusb.

Firmware powering the ATmega microprocessor requires it's own version C compiler, linker and standard C libraries called avr-toolchain. To upload the firmware no special programmer is needed. Microprocessor programming can be done over the USB cable by avrdude.

Mac OS X

  • Download and install latest version of Qt 5.x libraries from here.
  • Install libftdi library. Homebrew installs libusb automatically as a dependency.
   # Get Homebrew OS X package manager here: http://brew.sh/.
   brew install libftdi
   # Alternatively download and install CrossPack.
   brew install avrdude
   brew tap larsimmisch/avr
   brew install avr-libc
  • Compile both projects with QMake and make.
   # Alternatively open the .pro file in Qt Creator IDE.
   qmake board.pro
   qmake attenuator.pro
   cd firmware; make;
  • Remove colliding OS X kernel extension and run the compiled application.
   # Remove AppleUSBFTDI kernel extension to prevent 'Unable to claim USB device' errors.
   sudo kextunload -bundle-id com.apple.driver.AppleUSBFTDI

Linux

  • Install your distribution's default version of Qt 5.x libraries.
   # DEB-based distributions. (Ubuntu, Debian...)
   apt-get install qt5-default
   # RPM-based distributions. (RedHat, SUSE...)
   yum install qt5-default
  • Install development version of libftdi-dev library. Package manager installs libusb-dev automatically as a dependency.
   # DEB-based distributions.
   apt-get install libftdi-dev
   # RPM-based distributions.
   yum install libftdi-dev
   # DEB-based distributions.
   apt-get install avrdude avr-gcc avr-libc
   # RPM-based distributions.
   yum install avrdude avr-gcc avr-libc
  • Compile both projects with QMake.
   # Alternatively open the .pro file in Qt Creator IDE.
   qmake board.pro
   qmake attenuator.pro
   cd firmware; make
  • Remove conflicting kernel module and run the compiled application.
   # Unload kernel module to prevent 'Unable to claim USB device' errors.
   sudo rmmod ftdi_sio

Windows

  • Download and install latest version of Qt 5.x libraries from here.
  • Download and compile libraries required for USB communication.
    • Source code and documentation for libusb is available here
    • Source code and documentation for libftdi is available here.
    • Copy freshly compiled static libraries and headers (ftdi.h, usb.h, libftdi.lib and libusb.lib) into lib/win32/.
  • Download and install WinAVR required to compile and upload firmware.
  • Compile both projects with QMake.
   :: Alternatively open the .pro file in Qt Creator IDE.
   qmake.exe board.pro
   qmake.exe attenuator.pro
   cd firmware; make.exe

Schematics and PCB Layouts

Circuit schematics (.sch) and PCB layouts (.brd) files are designed with Eagle CAD. Free version for non-commercial use version can be downloaded here.

License

This work is licensed under the GNU GPL 3.0 License © 2009.