Hantek oscilloscope on Linux


Reading time: less than 1 minute

I bought a second-hand USB oscilloscope from the internet, and it arrived today. I believe the model is Hantek 6022BL. I was a bit worried about Linux support, but thankfully some people already reverse-engineered the device and wrote Linux userspace drivers for it.

I didn’t have time to dive too deeply into it, but I played around a little bit. Here are some tiny projects I’ve done with it.

  1. Figuring out the mains AC frequency.

I wrapped a random alligator clip cable around my extension cord, probed one end of the cable and observed an oscillating signal, precisely at 50 Hz (which is the AC frequency in my area).

  1. Audio card

I probed an audio cable, and used the Python API to capture samples. I then piped those samples to aplay in order to play them through my computer’s speakers.

This is an interesting way to use the oscilloscope as a high sample-rate audio card. And due to having two channels, it can be used for stereo recording as well.

The graphical oscilloscope application I used on Linux is called OpenHantek6022. And the Python API and open source firmware is called Hantek6022API. You can find the links to those below.

Citation

If you find this work useful, please cite it as:
@article{yaltirakli,
  title   = "Hantek oscilloscope on Linux",
  author  = "Yaltirakli, Gokberk",
  journal = "gkbrk.com",
  year    = "2022",
  url     = "https://www.gkbrk.com/hantek-oscilloscope-on-linux"
}
Not using BibTeX? Click here for more citation styles.
IEEE Citation
Gokberk Yaltirakli, "Hantek oscilloscope on Linux", September, 2022. [Online]. Available: https://www.gkbrk.com/hantek-oscilloscope-on-linux. [Accessed Nov. 12, 2024].
APA Style
Yaltirakli, G. (2022, September 12). Hantek oscilloscope on Linux. https://www.gkbrk.com/hantek-oscilloscope-on-linux
Bluebook Style
Gokberk Yaltirakli, Hantek oscilloscope on Linux, GKBRK.COM (Sep. 12, 2022), https://www.gkbrk.com/hantek-oscilloscope-on-linux

Comments

© 2024 Gokberk Yaltirakli