Gas station without pumps

2020 July 3

Twelfth video for electronics book

Filed under: Circuits course — gasstationwithoutpumps @ 22:41
Tags: , ,

I’ve just published my twelfth video for my Applied Analog Electronics book.  This video is for §34.2, which is the first part of Lab 10, and shows how to solder the FETs onto a breakout board.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited 3rd take. The first take stopped before I did any soldering, because I had forgotten to get blue tape out. The second take was complete, but had garbled sound for the intro and exit music, because I had the mic on while playing the sound, so I got a delayed superimposed sound.

I spent most of yesterday composing the 7 seconds of sound, because it has been a long time since I composed anything or used Finale Notepad. I’m not very happy with Finale Notepad, since it no longer runs on Macs (and so I had to use the “Barbie” laptop), and you can’t record the sound nor print the sheet music (it is deliberately crippled to induce you to buy the full-featured Finale). I got frustrated trying to produce the sound using online MIDI-to-MP3 converters, and ended up looking for another solution. I found MuseScore, which is freeware that runs on macs. I could import the music XML file that I had exported from Finale Notepad, and produce the sound using it—it even has a simple mixer panel that let me change the volume of the different instruments to get a slightly better balance and control the reverberation. I did have to edit the final sound with Audacity, in order to get the initial fade in. If I need to compose another short piece, I’ll try to do the whole thing in MuseScore, since it has more of what I need than Finale Notepad does.

I would upload the audio here, but only allows that if you have a paid plan, which I’ve been too cheap to do—you can hear the music on the YouTube link.

This video is the second one in this series using a green screen, and I’m still having problems with the lighting on my green screen not being uniform enough for OBS—even at night with only artificial light. The chroma key in OBS is nowhere near as easy to use as virtual backgrounds in Zoom. I have found some tricks to make adjusting the key color a little easier, but nothing that really handles the shadows and uneven lighting caused by wrinkles in the green-screen fabric.

2020 January 11

First week of class W2020

Filed under: Circuits course — gasstationwithoutpumps @ 21:16
Tags: , , , , , ,

I’ve just finished the first week of class for BME 51A (Applied Electronics for Bioengineers), and it has been a rather hectic week.

First, I had about 5 people sign up for the class at the last minute (from 56 to 61), which drove the BELS staff to having to do a lot of expensive last-minute purchasing of additional items for the parts kits.  It also meant that when we handed out the parts kits on Tuesday, several of them were incomplete and so more items had to be handed out during the Thursday lab period.  Since getting their kits, 2 students have dropped taking us down to 59, and one other has told me that they might drop (assuming that they can get a coherent plan together for an independent study to replace the course).  This enrollment is less than last year’s 82 students, but still a fairly large number, given that the BELS labs can only accommodate about 24 students.  I’m using two lab rooms for the first section and one for the second section, and have hired 3 group tutors (one for each lab room and time) to work along with me in the labs.

The first week’s labs consist of soldering headers onto the Teensy LC boards and installing software: Python with SciPy (using the Anaconda install), gnuplot, Arduino+Teensyduino, PteroDAQ.  For the first time in years, everyone got their soldering done within the allotted lab times!  I don’t know what was different this year that made it work as it was supposed to.  One thing that helped a little was that when students soldered the male headers on the wrong side of the boards (which happens every year, despite all the written, pictorial, and verbal warnings I can give), I had them cut apart the male headers to unsolder, then gave them new male headers to solder on.

Software installation is always a problem, because students are attempting to install on a variety of platforms, and something is always incompatible. Here are some problems that came up this year:

  • Gnuplot on old Mac OS X systems would not install with homebrew, as qt could not be installed—it insisted that you needed the full Xcode (not just the command-line subset), but Apple will not provide the full Xcode for such old, unsupported systems.  There may be already compiled versions of gnuplot for these old systems, but I have not gone looking for them. I’m not sure what to recommend to these students, other than updating to a system that Apple still supports.  I can’t recommend updating to Catalina, as they will lose all 32-bit apps, some of which will never be ported to newer versions of macos (for example, I lost access to Finale Notepad, which is no longer available on Macs—probably because Apple makes it so very difficult for third-party software developers to maintain their code).
  • Gnuplot on new Mac OS X systems installs and runs, but produces bad PDF files.  The workaround for this was posted at The answer to that stackoverflow question had two lines to fix the problem:
    brew uninstall --ignore-dependencies pango
    brew install iltommi/brews/pango

    The problem is that the default homebrew “bottle” for gnuplot points to a broken version of pango, and you have to remove that version and install an older version.  This one I knew about, because it had bitten me when I was trying to finish the book in December.

  • The standard Arduino+Teensyduino installation fails on macos Catalina (10.15). I knew about this one also, as I had tested the PteroDAQ install after I had “upgraded” to Catalina (which broke nearly everything).  The workaround is a beta release of Teensyduino (currently, which is pointed to from the Teensyduino installation page, but many of the students with macos Catalina did not notice the pointer.  One nice feature of the Teensyduino beta release is that it includes the Arduino IDE, so that you don’t need to install Arduino first.
  • The PteroDAQ GUI seems to be crashing on macos Mojave (10.14)—logging the user out when they try to run “python daq” as usual.  I think that this may be a weird filesystem thing, as it seemed to make a difference whether PteroDAQ had been cloned from GitHub or downloaded as a zip file, and whether the files were on the hard drive or on a Google Drive.  The only thing that seemed to work consistently was to clone the files from GitHub onto the hard drive of the laptop, then run the app that is in pterodaq/extras/maclauncher/ .  Why the launcher app works, when invoking “python daq” directly from a terminal results in logging the user out, is a mystery to me.
  • On macos Catalina, PteroDAQ can’t find the board if it is connected to the laptop through a USB2 hub connected to a USB3 port (I ran into this problem on my laptop before classes started also).  Apple has once again scrambled their USB stack, and USB Serial no longer seems to be visible through a USB2 hub (though the USB device is visible, the serial interface does not seem to be).  This hasn’t caused a problem for any students yet, as direct connection to a USB3 port works ok, and connection from hubs on USBC ports seems to be ok (probably because they are USB3 and not USB2).
  • One student had trouble getting PteroDAQ to run on his Windows 8 machine, with the python program crashing on trying to access the list of ports.  No one else with Windows 8 was having trouble, and his machine was running extremely slowly (slower even than the ancient “Barbie” laptop that I used for testing Windows implementations of PteroDAQ), so I suspect he was having hardware or malware problems on his machine.

I think that nearly all the students got their software installed—at any rate, people left the lab early on Thursday and were not queuing up for installation help, as they had in previous years.  Only one student asked for installation help during Friday office hours (the one with the probably bad hardware or malware), and there were no requests on Piazza for help.  If I’m right that everyone got things installed, then we are well ahead of previous years.

On Thursday, before lab, one of the group tutors ran a tutorial session on \LaTeX, which about half the class attended.  That should help somewhat in the prelabs to be turned in on Monday.

I’ve changed grading logistics this year.  Rather than hiring just 2 graders, I hired 6, and rather than having them work whenever they have time, I have scheduled grading sessions where we get together and grade in the same room.  On Thursday, we took just over 2 hours (with 5 graders, counting me) to grade homework 1, and today 6 of us got homework 2 graded in about an hour.  I graded the first quiz by myself Wednesday night.  So far, we have managed to keep the turn-around time to about a day, which is much better than last year, when the 2 graders were overloaded.

Monday’s assignments will be stressing our grading system a bit, as we have a lot coming in, but I couldn’t schedule a grading session until Wednesday at noon.  I’m hoping that we can get both homework 3 and the first prelab graded before Thursday’s lab.  If necessary, we can just give a turned-in/not-turned-in grade for the first prelab, as they are turning in a more complete draft of the same prelab on Friday, but I’d much rather give them feedback so that they can correct mistakes before the Friday draft.

So far, the quiz and homework scores look pretty good, so I’m hopeful that this will be a high-performing class this year.  It would be really nice to give out more B+ (and even A-) grades and fewer C grades.  I’m keeping my fingers crossed (even though that makes typing the blog post hard).

2017 November 27

Power board soldered

Filed under: Robotics — gasstationwithoutpumps @ 13:26
Tags: , ,

This morning I managed to fix the problems that I had created for myself by my mistakes in soldering yesterday.  The power board is  now soldered and passes continuity tests (no adjacent pins shorted, all header pins connected where they are supposed to be.

Finished board, with annotation for the header pins. The whole board is 5cm×7cm.

The power board has several functions:

  • The pair of H-bridges for the motors, powered directly from battery power input at the lower left, and controlled by PWM and DIR signals from the Teensy board (header pins at the top). The motor output wires are red and white header pins on the left side of the board, to match the red and white wires on the motors.  The two motors have red and white with opposite M1/M2 connections, so that matching DIR signal drives the motors in opposite directions.  Because the motors are mounted with shafts in opposite directions, this should result in the wheels turning the same way.
    There is a row of header pins on the right (input side) of each H-bridge, for hooking up oscilloscopes or other test equipment.  The EN– signal could be shorted to GND with a shorting plug, but the documentation claims that there is a pull-down resistor internally, so floating should be fine.
    The VM pins of the H-bridges have 220µF electrolytic capacitors as bypass, to reduce PWM noise from propagating back through the battery.  I was planning to add 10µF ceramic capacitors at the Vin pins, to reduce high-frequency noise, but I ran out of room.  If the high-frequency noise is a problem, I can try to squeeze in some bypass capacitors.
  • NCP7805 5V 1A regulator (bottom center).  All the red and black pair to the right of the motor control are 5V and GND.  The GND pin of the regulator is the only place where the 5V and battery power systems are connected.
  • The multiplexer connects one of the 8 white pins on the top right to the “out” pin, controlled by S2, S1, and S0. Up to 8 tape sensors can be connected with standard 3-wire servo cables.
  • The 8 yellow pins are not connected to anything—they are there just to provide alignment for servo cables sending 5V power to other boards.  I may not need any of these connections, as the Teensy board can be powered from the 5V and Gnd connections adjacent to the motor signals and tape-sensor signals.
  • There are also 4 pairs of yellow pins just above and to the right of the regulator.  These are intended for gathering the encoder wires from the two motors and transferring them to a single cable up to the Teensy board.  The power and ground connections there can also be used for the encoders.

This board will have a mass of connectors to it:

  • battery (3-wire servo cable)
  • motor connections (4 separate wires)
  • motor encoder connections  (8 separate wires: +5V, GND, ENC1, and ENC2 for each motor)
  • motor cable from Teensy (4 wires or 6 wires, depending whether 5V and GND included)
  • tape-sensor cable to Teensy (4 wires or 6 wires, depending whether 5V and GND included)
  • encoder cable to Teensy (4 wires)
  • tape-wire sensors (3-wire servo cable to each sensor)

I still have to lay out and solder the carrier board for the Teensy, but that should be relatively easy, as I don’t have nearly so many wires and I only need to populate a few of the connectors.

2017 November 26

Soldering failure

Filed under: Robotics — gasstationwithoutpumps @ 22:59
Tags: , ,

I am in a really bad mood—I’ve wasted an entire day soldering today, with nothing to show for it at the end.

I’ve been putting off soldering up some of my circuits, because I really hate perfboard soldering.  I don’t mind soldering PC boards (though I have a lot of difficulty with surface-mount components, so generally only use through-hole parts), but the need to make solder bridges and add extra wires makes perfboard soldering slow and frustrating.

I finally laid out my power board and started soldering it up today. It was going slowly, but not too badly, and I was 4 wires from the end of the job (after many hours work) when I saw that there were 5 posts left for the 4 wires—something was badly wrong.  I checked carefully, and found that I had put an 18-pin socket in where I needed a 16-pin socket.  I had two choices—leave the 18-pin socket in place and just put the chip in the end of it (with some risk of putting the chip in wrong), or replace the 18-pin socket with a 16-pin one.

I made the mistake of trying to unsolder the 18-pin socket to replace it with a 16-pin one. As I should have expected, I could not get the 18-pin socket out of the perfboard, and my attempt to do so made it nearly impossible to use the perfboard (some rings delaminated without releasing the pins, some of the pins of the socket are now too short to connect wires to, …).

My plan for today was to solder up two boards: the power board and the processor board, so that tomorrow I could start debugging my motor-control code. I’ve come to the end of the day and I have made essentially no progress (possibly negative progress, as I may not have enough spares to make the power board from scratch tomorrow).  I’m not going to try to do anything more tonight (except sleep, which will be a bit difficult given how frustrated I’m feeling).  In the morning, I’ll see if I can resolder the board to use the 18-pin socket, or whether I have to scrap it entirely.

If I take up making robots as a hobby (which I’ve considered), I’m going to do things at a somewhat slower pace, so that I can design PC boards rather than deal with the f***ing perfboard soldering.  I don’t care if it would add three weeks to a project to do a PC board—perfboard soldering is so frustrating that I would never finish a project if I had to do a lot of it. There are other prototyping possibilities besides PC boards and perfboards—for example, Adafruit’s Perma-protoboards or stripboard.  I’ve used the Perma-protoboards, and they are much easier to work with than perfboard, but I don’t have the space in my robot for a full size one (even if I had one at home to build on).

There are only two weeks left of the quarter, and I’m going to have to make a decision soon whether to finish a part of the project (I’ve already given up on the ball launchers) or to drop the whole project and go back to work on my book, which is now several weeks behind schedule.  I had hoped to build a reusable base that I could use for other robotics projects, even if I had nothing that could compete in the mechatronics competition, but even that is beginning to look like it will take more time than I can afford to spend.

2017 November 18

Four tape sensors made

Filed under: Robotics — gasstationwithoutpumps @ 15:01
Tags: , ,

I decided to make the tape sensors be as simple as possible, without switching the IR emitter on and off.

The tape-sensor boards have three ports: power, ground, and voltage output. The 220Ω resistor means that about 10mA is used at 3.3V and 18mA at 5V.

I soldered up four copies of this design today (all the TCRT5000L parts I had—I’ve ordered more that should be here early next week).

The three ports are color-coded male header pins on the top of the board. The TCRT5000L is mounted on the reverse side of the board.

I drilled holes for M3 bolts in the corners (the perfboard came with M2 holes) on the corners of  a 0.5″ by 9″ rectangle. M3 may be a bit big, but I only thought of that after drilling one of the boards.  I have both M2 and M3 bolts, and I also have M2 screws, which I’ll be using for fastening servo horns to MSF—I could have used M2 screws for mounting the tape sensors also.

The initial design was a little bit smaller, as I have 22kΩ resistors that are the same size as the 220Ω resistors here, but I had to squeeze in the larger 10kΩ resistor on the first prototype I made when the 22kΩ resistors proved to have too much gain at some distances from black electrical tape, so I ended making the whole thing be longer than necessary.  The boards are about 20mm by 34mm, but I could trim them down if needed to about 14mm by 28mm (and cut off the corners that don’t have mounting holes).

I tested the boards after soldering them, and they all seem to be working.  This design is only good for robots that run very close to the floor—the working distance for sensors as digital sensors is less than about 1.4cm.  (Analog sensors with synchronous sensing could probably go to 5cm or more, using one of the designs in Tape sensors).

Next Page »

%d bloggers like this: