First of all, sorry for my absence...
A small list of excuses: a) been sick, b) been busy with school, c) haven't really got anything worth telling about done, ... ... ... z) lazy. Feel free to pick your favourite
What I’ve done during the absence
Circuit Design
I finally got around to making my prize order, should arrive next week
It took this long, as most of the stuff is components for my custom home automation add-on for the Pi. It'll include 1-Wire, RTC, 8-ch relay controller, "watchdog" for the Pi etc.
I have started a blog post about this and if all goes well, I'll publish it next week. Once I've experimented on a breadboard, I'll also put up the design with explanations why I've done things the way I have. After that, I'll design the PCB and once that's proven, it'll be made public as well.
(my take on a) Python library for the scope
I’ve wandered off from the main point of the challenge somehow… For some reason, I finally (about 24h ago) decided to plug in the Tektronix to my Linux PC. I tested out the example found at https://github.com/DawesLab/instruments just to check that it’s working.
After this, it’s mainly been the case of reading the programmers manual for the scope and writing a Python library (coming soon to a Github near you) to be able to get basically everything possible from the scope. Also, it at the moment allows setting both horizontal and vertical settings, fetching the automated measurements, as well as plotting an image from the waveform. At the moment, there’s only trigger settings, saving the settings etc to be done. Also, I’m not happy with the code structure at the moment, so it needs fixing.
Next step is to allow saving settings, image etc easily, hopefully in the same format as Tektronix uses for USB. This would allow going back to the same settings easily after making measurements.
After this, it’s time for a GUI. At the moment I’m not planning on making the GUI real time, the main point is to allow easier setting and fetching single runs from the scope (in the same manner as USB-saving).
The library is designed to be easy to use from the beginning. The following code does all the setting up (from Default Setup, at the moment needs Trigger level pushing to set 50%) and produces the image shown later on…
# Initialize instance
s = TBS_1000()
# 250µS divider
s.horizontal.div = 250e-6
# Offset trigger timing to -4 divisions
s.horizontal.offset = s.horizontal.div_to_offset(-4)
# Set the new horizontal settings
s.set_horizontal()
# Set channel 1 offset to -3 divs (offset_v sets as volts)
s.channels[1].offset = -3
# Set div to be 1 V
s.channels[1].div = 1
# Do the actual updating of the settings
s.set_channel(1)
# Fetch one "trigger event"
# Same as pressing Single on the front panel
s.single()
# Fetch data from CH1 as waveform
# (a list of waveforms, s.get_data(2) would fetch CH2)
waveforms = [s.get_data(1)]
# Plot the waveforms as they appear on the scope
plot_waveforms(waveforms)
Coming in the future
I’ll keep on working with the scope library for the time being. When the Farnell order arrives, I’ll setup the PCB on a breadboard and test the functionality. After this, I’ll make needed changes to the schematic and design the PCB and order it. It’ll take 4-6 days to arrive, so there’s time for school, job, some further developments on the scope library or just being sick.
Or maybe I’ll try and write some blog posts. Is there any interest in posts such as home automation reliability / security and why it’s important to me? The post I’m writing about the schematic does leap to this area a bit, but I’m willing to go a bit further to the risks and possibilities of home automation, especially considering wireles, which this challenge is about...