Back in 2010 I was part of a team that sent up a couple of weather balloons on a NC spacegrant. I posted about the first one (which flew straight into a thunderstorm) a long time ago, but with the recent weather balloons in the news, I decided to go back and look up my old photos from the second balloon. In the pic above the yellow balloon was the first one, the green plot is of this second balloon.
We launched from Monroe Airport in NC and the path of the balloon followed the path of HWY 74, which is the main road in the area. There are a couple of good pics of Wadesboro, NC and Lake Tillery as well.
This one went about 75k ft. in elevation. You can *just* make out the curvature of the earth in some of the photos. We launched on a beautiful clear day and we were able to visually track the balloon’s full ascent AND descent. Fun times! Luckily it didn’t freeze on the ascent so we got some better pics. We stocked this one with a bunch of candy like last time and it was fun eating space candy again!
I recently got more interested in python after some MOOC classes on AI. I hadn’t really used it much since my thesis work which allowed users to write Jython scripts to control robots in my robotics simulator. Since then I did a little webscraping project here or there but nothing big.
There was an annoying set of issues I had with python, one of which was that I couldn’t slap together GUIs as fast as I’d like to. I admit, Java had me spoiled with the wysiwyg builders in netbeans and eclipse. I honestly would gravitate to processing if I needed an interface, but now I’ve come across a stupid-simple GUI library for python called PySimpleGUI.
Basically this is a wrapper around the tKinter library (though QT and other graphics libs are available as well). Much of setting up a GUI is done in a few lines of code. There’s a large number of example programs and a good bit of documentation. It’s slightly annoying but also awesome that the entire doc are in one giant webpage so no matter what you want, simply ctrl+f to find it on that page. Their gihub page is very insightful as well with insightful gems of example code in the issues section. My dude even has a youtube channel full of great tutorials and explanations. I recommend getting up to speed with it starting with this playlist.
It’s as easy as installing the library:
pip install pysimplegui
One of the key features of PySimpleGUI is its simplicity. It abstracts away many of the complexities of GUI programming, making it easy for even beginners to create visually appealing and functional GUI applications. PySimpleGUI also offers a wide range of customization options, allowing users to tailor the appearance and behavior of their GUI applications to meet their specific needs.
In addition to its simplicity and customization capabilities, PySimpleGUI is also highly portable. It is compatible with multiple operating systems, including Windows, Linux, and macOS, and can be used with both Python 2 and Python 3. This makes it an excellent choice for developing GUI applications that need to be compatible with a variety of platforms.
PySimpleGUI lays out windows in a very simple grid form that is controlled by lists. Let’s write an example to see how this works:
Check out the code below:
This is a simple converter from inches to centimeters. Looking at the “layout” variable you can see a list which has 3 elements.
TextOutput, TextInput, Button
This is the order the elements will appear on the main screen. If I wanted to add a second row, I could simply make this a 2D list, each row containing a new line of elements in the GUI window. For example the following puts the “OK” button on the next line down:
When GUI items like buttons, etc. are activated by the user, a message is sent to the “window.read()” function. You can then run if-else statements to do different things based on which button was pressed.
Of course it can get into much more complicated territory, but since there are so many example programs doing pretty much anything you can think of in one way or another it is easy to see how this library can be applied nearly anything written in python. Examples include a “how do I” app that basically tells you how to do anything you type in the question box, games like Uno and Chess, Matplotlib for graphing, even integrating with AI programs and making desktop widgets.
I’ve written a couple apps with it now for personal and professional use and I’m hooked. Definitely give it a try!
Overall, PySimpleGUI is a powerful and easy-to-use Python library that enables developers to create professional-quality GUI applications with minimal effort. Its simplicity, customization options, and portability make it a great choice for a wide range of projects, from small utility programs to large-scale applications.
Once you fabricate a PCB, it pretty much instantly begins to oxidize. PCBs created in industry are coated with a couple of things to protect them from this oxidation and short circuits. The first is called a soldermask, which is a type of epoxy that literally coats the entire circuit board. If you’ve ever seen a circuit board, you’ve seen the soldermask. It is typically GREEN but can be different colors. For example, official arduinos typically have a Teal BLUE soldermask. Sparkfun uses RED. OSHPark uses Purple.
You can see below just how badly the copper oxidizes after being touched an exposed over time.
There are multiple ways to add a soldermask to a PCB. My new favorite method is using Kapton tape (explained at the end of this page), but I have tried and compared a lot of different solutions below.
Epoxy-based:
In industry, they use a specially designed paint or epoxy that is cured with ultraviolet light. This allows them to cover all the traces (the wires) but leave the pads visible so you can solder components on the board. Some folks have tutorials out there showing how to do this, but it is messy and uses nasty chemicals.
Dry-Film Soldermask:
You can also buy sheets of “dry film soldermask” which has the epoxy deposited as a flexible sheet that you adhere to the PCB, then use a photolithography method to harden it with UV light. This allows you to remove the softer material on the pads you will solder the components to. This material is not readily available, but you can find it from electronics suppliers online. Here’s an excellent tutorial on how to do this process at home.
Tinning Traces:
Another option to protect the traces from oxidizing is to tin them. Tin doesn’t oxidize as badly as copper. Essentially you can deposit tin on all the copper surfaces using a chemical deposition (electroless). This is actually done to the solder pads on commercial PCBs, but it can be done to the entire PCB. The biggest issue with this method is that it doesn’t prevent short circuits because it doesn’t add a layer of insulation to the traces. Again, it uses nasty chemicals.
Conformal Coating:
There is a conformal coating that can be painted or sprayed on a PCB after soldering the components. It coats everything. While it has been formulated for electrical characteristics, etc. I personally don’t like this option. There are Acrylic, polyurethane, and silicone based products, which you can solder through, but it only comes in clear (you though you can see it in UV light).
DIY – Nail Polish:
When I did FabAcademy in 2014, I milled a ton of PCBs. They always oxidized really badly. Some would be useless within a month. I began painting finished boards with fingernail polish. I only painted the traces in case I needed to resolder the components. (The soldered areas do not oxidize like the copper traces). This option isn’t great because fingernail polish isn’t designed for electronics, or being touched with a soldering iron, but it works and I have boards that are almost 10 years old that look brand new. This is probably one of the easiest solutions due to availability and color selection.
Lacquer:
Another thing I tried more recently was to spray the PCB with colored lacquer, then using either a laser to etch off the lacquer on the solder pads with a laser, or to just solder it directly (the lacquer melts only when touched with a soldering iron). I don’t really know the chemistry here so when you laser it or solder it, I don’t know how safe it is. I don’t see how much different it can be from the conformal coating you can buy. A bonus with Lacquer is that you can get lots of colors, though I recommend avoiding anything with glitter, pearl, or metal flakes in it.
Both nail polish and lacquer do allow multiple colors, but neither are designed for electronics. Here you can see the left board is almost 8 years old but has had its traces painted with clear nail polish for protection. The red board is from my previous article in 2021.
The best solution I’ve come up with is to mill or etch a circuit board, then export the pads layer of the design to an SVG. From here it can be cut by a laser or a vinyl cutting machine into Kapton tape. Once cut, the tape can be applied to the PCB and pressed down hard. Since kapton tape is heat resistant, it can withhold under a bit of soldering. It also has excellent electrical properties (resistance, capacitance, and inductance). It is actually used for a substrate material for flexible electrical circuits.
UV Curable
Dry Film
Conformal Coating
Nail Polish
Lacquer
Kapton Tape
Cheap
✓
✓
✓
✓
Availability
✓
✓
✓
✓
Safety
✓
Designed for
Electronics
✓
✓
✓
✓
Ease of Use
✓
✓
✓
✓
Clean
✓
✓
✓
Speed
✓
✓
✓
Special Equipment
✓
✓
✓
✓
Ok, so Kapton tape wins. How do you cut and apply the kapton? We tried a couple of things and both worked.
Firstly, I told Garrett (who is taking FabAcademy in our lab this semester) about my idea and asked if he’d play with the kapton tape and the laser to find out what settings to use. He set about finding the best settings. He first used it to make a solderpaste stencil for his own project. Apparently on a 120 watt epilog, for the size holes we needed, about 6-7% power worked well.
We tried a couple of methods. First we placed the tape on cardboard, cut it, then peeled and stuck it to the PCB. This worked fine, but was a little tough to unstick and weed. This is likely the method I’ll use in the future though.
The second attempt we got cocky and just stuck the tape on the PCB and lasered it directly.
It is easier to line up with the cameras on the laser, but even when we placed the PCB directly under the camera (to avoid aberration of the fisheye lens) we still didn’t get the best alignment. It was good enough to solder though. You can see the finished product at the top of this page.
For FabAcademy, students have to post each of their assignments on a website. The website must be a static HTML site hosted on Gitlab (though this method works for github too). There are a lot of ways to generate static sites, but maybe one of the simplest seems to be to use mkdocs.
I made a video tutorial showing the steps required to get up and running quickly with this method. Just a couple of tweaks required here… In the video I apparently missed a couple of steps. If you have trouble getting python from within VScode’s terminal to work, you need to set the path in VSCode’s settings as well as the PATH environment variable in windows. VSCode’s tutorial on installing python and selecting the proper python interpreter shares some steps to help you debug if you have this issue.
The second thing you might have to do is set your name and email in git. Try this:
(Video at the end…) OBS is a great tool for capturing screencasts for classes and such. I also use it sometimes to capture zoom and webex chats when I want the entire screen recorded full-sized. (By default those apps record and show other things like chat on the screen which isn’t useful for me). Sometimes I’m in class when my webchats start, so I wanted to automate the recording setup just like you used to be able to do with old VHS tapes on a VCR. Simply program the start time and the stop time (assuming your VCR didn’t just flash 12:00 forever because you never figured out how to set the clock on the thing). Of course you have to have your chat already started and opened on the screen you wish to record before you start OBS or you won’t record anything but a blank desktop with no sound… ask me how I know. it works better with dual monitors and muting the external microphone inputs.
OBS has a STOP feature built-in. Simply open OBS and go to Tools–>Output Timer and you can set a time limit for how long you want it to record for. I also check the box for “start every time” when I set it up this way.
The tricky part is STARTING the recording. Since OBS doesn’t run as a background process, it can’t just open itself and do whatever it wants. That’s just not safe. The work-around for this is to create a Windows Task that will do it for you. Windows Tasks are incredibly helpful. It’s like a cron job on linux. Even windows itself uses this tool for checking for updates and running virus scans for you. To access it, simply click your windows icon and type “task scheduler”
Once it loads, you’ll need to doubleclick the “Task Schedule Library” in the left pane. If you don’t doubleclick it, then you won’t have the ability to create a task. Kind of a bad design in my opinion, but easy enough to work around.
Click Action–>Create Basic Task to open the wizard for you. It’ll walk you through the steps for setting the trigger you want. (In my case, I just want it to be a timed trigger at a certain date, but you can have it repeating, or based on a user’s action, or even every time you login. I set the time for about 5 minutes before the start time of my webchat.
Then it asks for what action it should perform when this task is triggered. This is where we will tell it to open OBS and start the recording. To figure out what to type here, you’ll click your windows icon and type “OBS” but instead of opening it, right-click the icon and select “open file location” This will open the start menu folder. Right click the OBS icon and click “properties”
Copy and paste the “Target” to the task Scheduler’s “”Program/Script” box.
Then copy and paste the “Start- in” path to the Task Scheduler’s “start in” box. But you have to remove the quotation marks on this one or it will not work!
Finally, you’ll need to type in some arguments for the Task Scheduler. Type:
--startrecording -m
The -m is there to allow multiple OBS windows to run at the same time in case for some reason you forget to close the previous one. Without this in the command, OBS will just give an error if another window is already opened.
Click OK to finish this task. You will then be able to find your new task in the Scheduler’s window. If it is a long time before your trigger point, you can test it by right-clicking and selecting “run” and it should immediately open OBS and start recording. If this doesn’t happen, then go back and make sure you don’t have quotation marks on the “Start in” function of the task.
I had a bit of trouble setting this up on my older laptop for some reason. I just could not get it to run directly from Task Scheduler. Instead, I wrote a windows batch script with the command in it, then passed the path to it as an argument to the “cmd” command (the windows command terminal/console). Worked like a charm. First, open notepad and enter the following:
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\OBS Studio\OBS Studio (64bit).lnk" --startrecording -m
and save this file as “obsScript.bat” The icon should change from a notepad file to a script icon as shown below.
If you can’t get it to change even by adding “.bat” to the file name, then you need to show file extensions in windows. Open any folder, click View–>Show filename Extensions as shown below then change the filename.
Once this batch script is created, simply create a task for it like we tried to do above, but the path to the program/script should point to our new batch script.
Remember, you can always doubleclick the task in the schedule window to edit the different features. The command itself is listed under the “Actions” and the time is set under the “Triggers” tab.
When you run it, you should see the black command window pop up with the command, then OBS should start.
COMMON QUESTIONS:
Question: I want it to stream instead of record Answer: Then use –startstreaming instead of –startrecording
Question: How can I make it record multiple times without opening a new window each time? Answer: There are a couple of ways to do this. The easiest is to close the window first.
Question: How do I make it automatically close the OBS window when done recording? Answer: Schedule a “taskkill” command in the scheduler. This is like using the task manager to kill an app. You’ll need to know the time that you want it to end. The command might be:
taskkill \IM obs.exe
If that doesn’t work, add a “\F” to the end of that line to force-close the program.
Question: How can I start a recording automatically when a call stats on zoom or other services? Answer: You might be able to do this in TaskScheduler, but I did find a solution script for the program AutoHotKey on the OBS forum that checks to see if zoom is started.
Question: It doesn’t work, even with the batch script. What do? Answer: You need to be in an Admin account in windows for it to work.
Question: I only have one screen. Wheen OBS starts it hides the content I am trying to record. What d? Answer: In OBS Open Settings, under General tab > System Tray, select “Minimize to system tray when started”
Here’s the video showing the whole setup. You’re welcome!