Live Streaming & DIY Microphone

Backstory

During 6 and 1/2 of my 7 years of college (part time), I was President of and helped build a student organization for LGBTQ+ students and their allies. Every year we host an event comprised of speeches from students, faculty, and staff that I video tape. Eventually we began streaming the event live on Facebook. The event is always around the 2nd week of October.

Now I’m an alumni advisor to the organization and I’m still recording/live streaming the event. I wanted to post about how I do this, mainly for my future reference.

Recording/Live Streaming Setup

The event is held in a small, but beautiful chapel on campus. I normally setup the camera in the back corner of the room and the speaker is in the opposite corner in the front of the room. The recorded audio has always been decent, but it could definitely be better.

I connect the camera’s A/V output into the composite input cable on the TV Tuner, which is then plugged into the computer’s USB port. I use the software that came with the TV tuner or VirtualDub to set the channel on the TV tuner to the composite input. Then I can close VirtualDub or the TV tuner software and open OBS.

Computer Specs

OBS Setup

In OBS, I have a scene with just a photo source (the club’s logo). In another scene, I have the TV tuner’s video and audio sources. I run the photo a few minutes before we start and then switch over to the camera when the event begins. I do the actual recording in the camcorder at 1080p 30fps. Composite video has a standard resolution of 480i or 576i, so I set OBS to stream at a resolution of 640 x 480 to Facebook using a bit rate of 2000 kbps.

DIY Electret Condenser Microphones

Disclaimer

I am NOT responsible for any loss or damage resulting from the use or building of this project. PLEASE make sure your camera/device accepts this type of powered microphone before connecting it. I am NOT going to be responsible for any damage you may cause by building or using this microphone.

Parts list

  • 6 Feet of 2 Conductor Audio Cable – I used thin coax cable, RG-174.
  • 2 Mono 3.5mm (1/8″) Phone Plugs (male)
  • 2 Capacitors (100nF – Code 104) – I used the ceramic disc type.
  • 2 resistors (680 Ohm) – Value should match the impedance of the microphone elements you purchase.
  • 2 Microphone Elements – I used PUI Audio AUM-5047L-3-R.
  • 2 short lengths of PVC Pipe – I used 1/2″ Sched. 40 PVC cut at 6.5″.
  • 2 PVC End Caps – Size needs to match the PVC pipe.
  • Spray Paint
  • 1 Length of wood or PVC pipe cut at 26″
  • 2 Bolts – 6-32 size. Use a length that will go through 1/2″ PVC (OD = 0.84″) and your piece of wood/pipe. (I used 2.5″ bolts and they were a 1/2″ too long).
  • 8 Flat Washers – #6 Size
  • 2 Hex Nuts – 6-32 Size
  • 2 Wing Nuts – 6-32 Size
  • Heat Shrink Tubing (various sizes)
  • Air Conditioner Foam Filter
  • 3 Panel Mount 3.5mm Phone Jacks (female)
  • 9V Battery
  • 9V Battery Holder

Tools

  • Soldering Tools
    • 15W Soldering Iron
    • Solder – I used 63% Lead / 37% Tin with a rosin core.
    • Desoldering Wick
    • Flux Pen
  • Pliers
  • Wire Cutters
  • Wire Strippers
  • Tweezers (optional)
  • Lighter
  • Audacity Recording Software

I’m not going to go into painting the PVC and putting the bolts through it. Nor will I cover cutting the slots in the PVC pipe or the sewing of the windscreen foam.

How to Build The electronics

wiring the microphones & connectors

  1. The first thing I did was solder the connectors onto the ends of the coax or audio cable. Make sure you put the plug’s cover on first. I did not care about interoperability so I soldered the center conductor of the coax to the center pin and the shield of the coax to the sleeve of the connector. Put one connector on each 3 foot piece of cable.
  2. Put heat shrink over the cable first. (we’ll shrink this later).
  3. On the other end of the cable we’ll solder the microphone element to the wire. The center pin goes to the positive and the shield of the coax connects to the negative on the mic element. Try to do this quick and precisely or you’ll ruin the mic like I did on my first try. I had to order another one after ripping the solder pad off the mic element. The mic’s solder pads are tiny, about 1mm wide by 3mm long. Don’t short the two solder pads either.
  4. Slide the heat shrink tubing up enough to cover the wires a bit, but do NOT cover the back of the microphone element. Shrink it over the wire. Don’t over heat the wire or mic element.
  5. Make sure you’re soldering the center conductor to the positive solder pad on the mic element. I messed this up on one microphone and could not figure out why neither microphone worked with the circuit.
two microphones
Two completed microphones.

create the circuit

Mono Directional Electret Microphones – Power Supply & Mono to Stereo Connection Schematic

Using the above schematic, we’ll create the circuit used to power the microphones.

Basically, the resistors provide bias to the microphone elements. The value of these 2 resistors should match the impedance of the microphone elements you bought. Mine were 680 Ohm. These resistors should be 1/2 Watt resistors.

The capacitors block the battery’s direct current (DC) from getting into the camera. While capacitors block DC current, they allow AC current, such as an audio signal, to pass through.

NOTE: Some capacitors are polarized and must be installed with the positive leg facing the microphone elements. If you install the capacitor backwards you could damage your camera and/or the microphone elements. The capacitors used in this schematic are NOT polarized.

Project box with power switch.
Project box with power switch

Test for DC on the Output before use

Just to be on the safe side, I tested for any DC voltage on the output before I plugged this into my camera. Plug in the battery, turn the switch on and test the output connector with a multimeter for DC voltage to make sure there will NOT be any DC getting into the camera. If your multimeter detects DC voltage on the output do NOT plug it into the camera. Go back and check your connections.

Project box output side
Output Side of Project Box

Creating the Stereo Effect (Extremely Basic)

This part is a little over my head, but according to what I’ve read, you can create a stereo effect in one of many ways. Since I couldn’t find microphone elements with the correct polar patterns to create a single stereo microphone, I made two mono microphones that get connected to the circuit which connects both of them to the stereo mic input on my camera. By separating the microphones at least 24 inches using the piece of wood or pipe, you will get a “stereo” sound effect.

completed microphones showing spaced stereo positioning
Showing Spaced Stereo Positioning of Completed Microphones

Matching the microphones

Typically, when a stereo microphone is built, the two elements are “matched” to be sure that the sounds they record are the same volume and gain on both the left and right channels. This is done so that the volume of one channel is the same as the other, else the audio would not sound right.

I personally did NOT match my microphone elements. I am not recording professional audio and I needed something cheap. I also wasn’t 100% sure how to do it at home (it can be done fairly well at home though).

That said, the two microphones are from the same manufacturing lot, the audio sounds the same on both channels to me and the gain of each channel is extremely close when looked at with Audacity.

Results

The microphones sound MUCH better than the camera’s internal microphone. They’re fairly clear and provide decent audio for a “home” video. The volume of the recorded audio was almost exactly the same as the source audio I recorded.

The internal camera microphones sounded quieter than the source I was recording. While they were clear, the audio didn’t sound as clear or as full as the microphones I built. The audio from the camera sounded like it was too deep.

Sources

I used many sources and forums to find the information necessary to build my microphones. I originally was trying to build a shotgun microphone (a very directional microphone employing an interference tube design), but there was significantly more information on building a DIY Directional Microphone, so I went with that. I did research over the course of a couple of weeks trying to learn enough to build this project. The circuit is the basic manufacturer’s recommended design for a single microphone element that has been modified to connect two microphone elements to the same battery and stereo output connector.

I want to thank everyone who put this information out there for others to use.

Schedule Update of Stripped.csv File

I recently had a gentleman, Richie M6XRM, contact me on how to do this. It proved to be quite the challenge.

Instructions & Script

The information and how to has been posted on my GitHub page along with the script (you will need to supply your own URL to the stripped.csv file). Below I’ll explain the issues we encountered while trying to configure this automatic update. I can’t say that this is the best or only way to do this, however this is how I did it and I can confirm it works.

Issues & Fixes

Issue 1

One of the biggest issues was writing the script on Windows and converting/keeping the line endings of that script as unix line endings so they’re compatible with linux. I used Notepad++ to write and edit the script before uploading it to GitHub. Apparently it is not enough to save the file as a UNIX bash/sh file type. At the bottom of Notepad++ it says what the line endings are and I never noticed it. The DOS line endings created a lot of issues when the script was run on the Pi.

Fix 1

The fix for this in Notepad++ is to click Edit > EOL Conversion > Unix and then save the file as a UNIX bash/sh file with the extension “.sh”. The fix in the nano text editor is to press CTRL + x, then y, then ALT + d, then enter.

Issue 2

The other major issue was that system cron on the Pi does not understand rpi-rw even when it is run inside the script which is being run as root.

The cause of this is that rpi-rw is actually an alias set in the bash profile for the logged in user. Since cron runs as it’s own thing/shell separate from the logged in user (pi-star), it doesn’t understand rpi-rw or at least it didn’t understand it for me or Richie.

Fix 2

The fix for this is to put the actual command that rpi-rw points to in the script instead of using rpi-rw. That command is as follows:

sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot

I came across this page on Medium which explained how to convert Raspbian to a read-only filesystem which is what Pi-Star uses. At the end of the page it talks about creating an ro and rw alias to quickly switch the filesystem between read-only and read-write. That’s when it dawned on me that this is the way the Pi-Star developers handled the read only operating system and that rpi-rw/rpi-ro are aliases.

A huge thank you to Richie M6XRM for his patience with me in figuring this out and for being so understanding while I was recovering from surgery.

We just hope this helps someone else and explains a bit of the mystery behind the rpi-rw and rpi-ro aliases.

73,
Tyler N3TDM