Byron J.

Member Since: September 10, 2013

Country: United States


Apparently, the J is for JFET.

Thoughts and ramblings about numbers, plus an interesting discovery.

Continue reading

Examining one of the categories that occupies significant space on my workbench: wire strippers.

Continue reading

Drive the Moog Werkstatt-01 with the SparkPunk sequencer, and starting in on a MIDI-to-CV converter.

Continue reading

Experimenting with optics and imagery.

Continue reading


Servo Trigger Hookup Guide

March 26, 2015

How to use the SparkFun Servo Trigger to control a vast array of Servo Motors, without any programming!

Pi Wedge B+ Hookup Guide

December 18, 2014

How to assemble and start using the Pi Wedge to prototype with the Raspberry Pi B+.

Decade Resistance Box Hookup Guide

December 4, 2014

How to assemble the decade resistance box, then use it as a design and measurement tool.

SparkPunk Sequencer Theory and Applications Guide

August 14, 2014

Examine the inner workings of the SparkPunk Sequencer, then explore some modifications and alternate applications.

SparkPunk Sequencer Hookup Guide

August 14, 2014

How to assemble and use the SparkPunk Sequencer kit.

SparkPunk Hookup Guide

June 12, 2014

How to assemble and modify the SparkPunk Sound Generator kit.

Pi Wedge Hookup Guide

May 29, 2014

How to assemble and start using the Pi Wedge to prototype with a Raspberry Pi.

Sound Detector Hookup Guide

February 27, 2014

The Sound Detector is a microphone with a binary output. This guide explains how it works and how you can use it in your projects.

Large Solderable Breadboard Hookup Guide

February 27, 2014

This breadboard has a couple of tricks up it's sleeve!

VKey Voltage Keypad Hookup Guide

February 13, 2014

A quick hookup for the VKey analog voltage keypad.
  • Yes, R9 bleeds the cap back to ground. If you want it to discharge more quickly, reduce either the resistor or the cap.

    If you want to play around with the sim, there are LT Spice files in the GitHub repo. “Sound_detector-wav.asc” allows you to use a .wav file as simulated input.

  • I think there are several things at play here that might be confusing things overall.

    When that hookup guide was written, I didn’t have a scope capable of capturing a diagram like that - the minimum time base was too fast to capture audio bursts like that, and I only had 2 channels. So I used an LTSPICE simulation to generate the diagram, using the output of a different simulation as a substitute for actual audio input, and adjusting the display parameters to make things line up – in the algebra in the top line, you’ll notice that the audio signal has been multiplied by 5 and offset by 2.5V. It doesn’t actually drop below 0V – it’s just been scaled to be a little more visible against the other signals.

    The signals in the picture approximate what you’d see if you put a 3 channel scope on the 3 outputs of the Sound Detector, where the audio output is indeed DC-coupled, similar to our Electret Mic Breakout. With the DC bias, it’s easier to interface with a microcontroller.

    But that’s not the signal that’s fed to the input of the rectifier - it’s AC-coupled via C4, removing the Vcc/2 offset. The 0 in the pseudocode is correct – correct for the canonical output of the rectifier – which feeds the lowpass filter of R8/C1. This lowpass obscures some of the detail in the peak-tracking behavior of the rectifier, but results in a better behaved signal at the input to the Schmitt trigger.

  • And now, having had the weekend to turn this over in my head, it sounds like it might be a great project to tackle with a Microview.

  • OK, thanks for the explanation. That doesn’t seem too tough.

    If you can use two analog inputs, simply set up a pair of dividers around the switches, using whatever resistors are handy – 1K or 10K would be an OK starting point. Use one for the ones digit, the other for the tens digit.

    If you can hang tight for a week or two, I’ve got a breakout PCB for these rotary switches that will make this really easy to do.

  • Two factors, mainly:

    First, the application determined the minimum number of pins required:

    • Three ADC pins for the pots.
    • One pin on a timer output for the servo control, configurable as PWM of suitable period & pulse width. A 16-bit timer, with a 1 MHz clock, let me have 1 uSec pulse resolution, which is better than many servos.
    • One pin for the switch input.
    • In-System-Programming & debugging make development easier, but can constrain how those pins can be used by the application. If I hadn’t had the single wire debug, I’d probably still be working out bugs.
    • Some extra pins for configuration jumpers were a bonus…in the end, I came up with even more modes than I had jumpers for.

    Of course, the pins and peripherals also have to be setup such that the functions aren’t mutually exclusive. That caused some problems with the 8-pin Tinies that I looked at.

    Second, availability. We already use the 84 in the Tiny USB Programmer stick, so it’s a part that’s already in our pipeline. We also have the DIP-14 version in stock, which I built my initial prototype around.

    So, yeah, pins and availability.

  • I just bounced this off some of my colleagues, and we could use a little more detail. Your question is open-ended enough that it’s hard to recommend a single solution.

    • What are the voltages involved? What sort of supply input, and what outputs needed?
    • What sort of step size are you looking for? It’s going to be hard to have 100,000 discernible steps.
    • How much current do you need?
    • What’s the intended application?

    If you’re not drawing a lot of current, a voltage divider is one possible solution. The hangup is that if you need much current, the top leg of the divider (the series resistor) limits the current it can pass. If the top leg is variable, then the available current varies with the setting. This won’t be ideal for some situations.

    A possible solution to that limitation is to use an op-amp follower as a buffer amplifier after the divider. An LM358 can source 20 mA. There are other op-amp configurations you could consider, like building a gain stage that uses the decade resistance as the feedback resistor, but they’ll still be limited to 20 mA.

    For more current above that, consider using an LM317 adjustable voltage regulator. You set the voltage output using a pair of resistors – refer to the calculator linked from that page. With a heat sink, they’re good to better than an Ampere.

  • That poor lil' Tiny84 is almost out of pins. The only ones currently unused are MISO and SCK, not quite a full SPI bus. You could conceivably bit-bang an output on those pins (write-only 2-wire SPI, or bit-banged UART), though.

    Thinking about this a tiny bit more - 50 BPS is a very low, but standard, baud rate – you’ll see it in some terminal programs. It also happens to match the servo pulse rate! You could add a tiny bit of code to print out the pulse widths from within the timer IRQ.

    Alternatively, you could use a second microcontroller, with a timer in input-capture mode to measure the pulse widths, and display them. Or just use cursor mode on an oscilloscope.

  • If you set it correctly, “A” sets how fast it drives one direction while the switch is open, “B” sets how fast it drives the other direction while it’s closed. “T” Sets the time it takes to decelerate, re-accelerate when the switch changes state.

    You could also set it so it’s stopped at “A” and moving at “B”, or vice versa.

    Keep in mind that continuous rotation servos have an internal trimpot that sets their center-point response, and that will interact with the A and B settings.

    If you want to load different firmware, there’s a toggling mode that I devised to control continuous servos. It’ll run one way until a switch closure, then run the other way until it closes again. I built a little cart with switches in the bumpers that would drive back and forth using it. Check the Expert Exercises in the hookup guide, and get the firmware from GitHub.

  • According to this link, the B+, A+ and Pi 2 model B all share the same GPIO pinout.

    So the B+ Wedge should work with all of them.

  • I knew I shoulda just said “DEC!”