Uncategorized

API for Broadcom Qmini

Broadcom has excellent spectrometers for an affordable price of around 2000 euro excluding tax. They have many different spectrum options; visible light, UVC, UVB, UVA, far red are one of the options. The QMINI comes with spectrometer software called “WAVES”. It’s a easy program to see the spectrum but it is not able to log values of the spectrometer over a longer period. If you want to log the values, you can follow the steps below.

Note that these steps are exclusively for Microsoft Windows computers only. Probably it will work under Linux / OSX as well since it is using Python. The steps below are necessary to gain direct access to the Spectrometer values that are transmitted over USB-C 3.0. Do note that this might not work on older models of the spectrometer that are still equipped with USB-Mini and/or RS232 ports. This is only for the new 2024 model.

We captured the spectrometer values with Python. Then we used Python to post the new samples to a MQTT server. Then we used Home Assistant to connect to the MQTT server to retrieve the new samples. Home Assistant then will automatically recognize the new samples that are being posted to the MQTT server thanks to the auto-discovery function that is build in. We retrieve the peak wavelength (nm), the peak normalized output and the temperature sensor that is build in to the spectrometer. We used a Cloud MQTT server called EMQX. That way the spectrometer can be used all over the world withoud having to worry how to get the samples to our database. It just connects to the internet and post the samples to the MQTT server.

Home Assistant was used as we are very comfortable with that system. It is very easy (without programming) to apply triggers and automations to the sample data. Also since Home Assistant is publicly accessible over a normal browser, everyone could access the data from the spectrometer; on their phone, tablet or laptop. Just go to the website and see the data. Inside Home Assistant we used InfluxDB for long term storage of the measured data. And we Grafana to visualize the wavelength’s, peak power outputs and exposure time. This combination makes it easy for our customers and team to analyse long term data that is coming from the Spectrometer. Thank you Home Assistant for making this possible and so easy for us, we keep sponsoring that project by using their Cloud server access, that open source community deserves that!

The original drivers that comes with the Spectrometer cannot be used for the Python application. I had to use Zadig for changing the drivers of the spectrometers to one that can be accessed over Python. When doing so, the default app Waves from the Broadcom will stop working. If you want to use Waves again, change back to the original driver in the device manager tab.

Inside Zadig, you need to select to the driver “libusbK (v3.0.7.0)” for the attached spectrometer. Use the option (big button) “Install WCID Driver” or “Install Driver” and then “replace driver”. Also make sure to select the Qmini from the drop down list otherwise you might replace a driver for another attached USB drive 😉 . If the Qmini is not shown, select Options->List All devices and then select the Qmini from the list.

Changing back to the Waves driver:

  1. Go to “Device manager”, go to “libusbK USB Device” and see “Qmini” listed there.
  2. Then click the option “roll back driver” and accept the question.
  3. Unplug the USB, wait 15 seconds, and put it back in
  4. Ready to use the spectrometer as original.

Error? Under windows it is not possible to use the Python function listed in qseriesdriver.py self.dev.is_kernel_driver_active(0):“. By default it is enabled in API that comes with the QMINI. You will need to commend out the whole if/else section for making it work under Windows.

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *