home.social

#potentiometer — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #potentiometer, aggregated by home.social.

  1. #Werbung #Reklame in eigener Sache:

    Liebe #vintagehifi Freunde:
    Sicherlich kennt Ihr das auch:
    Du hast ein tolles Radio, aber es fehlen die Bedienknöpfe.
    Statt dessen ragt nur die nackte Welle aus dem Gerät,
    wie auf dem Bild ganz links.

    Nun sind Potentiometerköpfe recht leicht zu bekommen, wenn die Welle einen Durchmesser von 6mm hat.
    Die Kofferradios haben aber Wellen von 4,5mm mit einer D förmigen Aussparung.
    Um dies Problem zu lösen haben wir einen Adapter gezeichnet und gedruckt der es erlaubt auf 4,5mm D Wellen einen Potiknopf mit 6mm (glatt) Innendurchmesser zu montieren.

    Auf diese Weie könnt Ihr sogar Potiköpfe von E-Gitarren auf Eure Kofferradios montieren.

    Hier könnt Ihr den Adapter kaufen:
    neufeldt-kuhnke.de/shop/Wellen

    #kofferradio #bedienknöpfe #upcycling #restomod #madeingermany #madeinkiel #madeineu #hifi #vintagehifigear #recycling #potikopf
    #potentiometer #ersatzteile

  2. #Werbung #Reklame in eigener Sache:

    Liebe #vintagehifi Freunde:
    Sicherlich kennt Ihr das auch:
    Du hast ein tolles Radio, aber es fehlen die Bedienknöpfe.
    Statt dessen ragt nur die nackte Welle aus dem Gerät,
    wie auf dem Bild ganz links.

    Nun sind Potentiometerköpfe recht leicht zu bekommen, wenn die Welle einen Durchmesser von 6mm hat.
    Die Kofferradios haben aber Wellen von 4,5mm mit einer D förmigen Aussparung.
    Um dies Problem zu lösen haben wir einen Adapter gezeichnet und gedruckt der es erlaubt auf 4,5mm D Wellen einen Potiknopf mit 6mm (glatt) Innendurchmesser zu montieren.

    Auf diese Weie könnt Ihr sogar Potiköpfe von E-Gitarren auf Eure Kofferradios montieren.

    Hier könnt Ihr den Adapter kaufen:
    neufeldt-kuhnke.de/shop/Wellen

    #kofferradio #bedienknöpfe #upcycling #restomod #madeingermany #madeinkiel #madeineu #hifi #vintagehifigear #recycling #potikopf
    #potentiometer #ersatzteile

  3. #Werbung #Reklame in eigener Sache:

    Liebe #vintagehifi Freunde:
    Sicherlich kennt Ihr das auch:
    Du hast ein tolles Radio, aber es fehlen die Bedienknöpfe.
    Statt dessen ragt nur die nackte Welle aus dem Gerät,
    wie auf dem Bild ganz links.

    Nun sind Potentiometerköpfe recht leicht zu bekommen, wenn die Welle einen Durchmesser von 6mm hat.
    Die Kofferradios haben aber Wellen von 4,5mm mit einer D förmigen Aussparung.
    Um dies Problem zu lösen haben wir einen Adapter gezeichnet und gedruckt der es erlaubt auf 4,5mm D Wellen einen Potiknopf mit 6mm (glatt) Innendurchmesser zu montieren.

    Auf diese Weie könnt Ihr sogar Potiköpfe von E-Gitarren auf Eure Kofferradios montieren.

    Hier könnt Ihr den Adapter kaufen:
    neufeldt-kuhnke.de/shop/Wellen

    #kofferradio #bedienknöpfe #upcycling #restomod #madeingermany #madeinkiel #madeineu #hifi #vintagehifigear #recycling #potikopf
    #potentiometer #ersatzteile

  4. #Werbung #Reklame in eigener Sache:

    Liebe #vintagehifi Freunde:
    Sicherlich kennt Ihr das auch:
    Du hast ein tolles Radio, aber es fehlen die Bedienknöpfe.
    Statt dessen ragt nur die nackte Welle aus dem Gerät,
    wie auf dem Bild ganz links.

    Nun sind Potentiometerköpfe recht leicht zu bekommen, wenn die Welle einen Durchmesser von 6mm hat.
    Die Kofferradios haben aber Wellen von 4,5mm mit einer D förmigen Aussparung.
    Um dies Problem zu lösen haben wir einen Adapter gezeichnet und gedruckt der es erlaubt auf 4,5mm D Wellen einen Potiknopf mit 6mm (glatt) Innendurchmesser zu montieren.

    Auf diese Weie könnt Ihr sogar Potiköpfe von E-Gitarren auf Eure Kofferradios montieren.

    Hier könnt Ihr den Adapter kaufen:
    neufeldt-kuhnke.de/shop/Wellen

    #kofferradio #bedienknöpfe #upcycling #restomod #madeingermany #madeinkiel #madeineu #hifi #vintagehifigear #recycling #potikopf
    #potentiometer #ersatzteile

  5. #Werbung #Reklame in eigener Sache:

    Liebe #vintagehifi Freunde:
    Sicherlich kennt Ihr das auch:
    Du hast ein tolles Radio, aber es fehlen die Bedienknöpfe.
    Statt dessen ragt nur die nackte Welle aus dem Gerät,
    wie auf dem Bild ganz links.

    Nun sind Potentiometerköpfe recht leicht zu bekommen, wenn die Welle einen Durchmesser von 6mm hat.
    Die Kofferradios haben aber Wellen von 4,5mm mit einer D förmigen Aussparung.
    Um dies Problem zu lösen haben wir einen Adapter gezeichnet und gedruckt der es erlaubt auf 4,5mm D Wellen einen Potiknopf mit 6mm (glatt) Innendurchmesser zu montieren.

    Auf diese Weie könnt Ihr sogar Potiköpfe von E-Gitarren auf Eure Kofferradios montieren.

    Hier könnt Ihr den Adapter kaufen:
    neufeldt-kuhnke.de/shop/Wellen

    #kofferradio #bedienknöpfe #upcycling #restomod #madeingermany #madeinkiel #madeineu #hifi #vintagehifigear #recycling #potikopf
    #potentiometer #ersatzteile

  6. This is one of the precision potentiometers I'll be using in my tube preamp build. They are stepped (like 24 or 27 steps) made with precision film resistors on a small circuit board in there with the stepping mechanism.

    I want to get rid of the little nubby sticking up on each pot. I don't have the tools to do this anymore so I'm looking for any suggestions that you might have. I want to get rid of the nubby without damaging the rest of these beautiful things.

    #Potentiometer #Help #Suggestions

  7. This is one of the precision potentiometers I'll be using in my tube preamp build. They are stepped (like 24 or 27 steps) made with precision film resistors on a small circuit board in there with the stepping mechanism.

    I want to get rid of the little nubby sticking up on each pot. I don't have the tools to do this anymore so I'm looking for any suggestions that you might have. I want to get rid of the nubby without damaging the rest of these beautiful things.

    #Potentiometer #Help #Suggestions

  8. This is one of the precision potentiometers I'll be using in my tube preamp build. They are stepped (like 24 or 27 steps) made with precision film resistors on a small circuit board in there with the stepping mechanism.

    I want to get rid of the little nubby sticking up on each pot. I don't have the tools to do this anymore so I'm looking for any suggestions that you might have. I want to get rid of the nubby without damaging the rest of these beautiful things.

    #Potentiometer #Help #Suggestions

  9. This is one of the precision potentiometers I'll be using in my tube preamp build. They are stepped (like 24 or 27 steps) made with precision film resistors on a small circuit board in there with the stepping mechanism.

    I want to get rid of the little nubby sticking up on each pot. I don't have the tools to do this anymore so I'm looking for any suggestions that you might have. I want to get rid of the nubby without damaging the rest of these beautiful things.

    #Potentiometer #Help #Suggestions

  10. This is one of the precision potentiometers I'll be using in my tube preamp build. They are stepped (like 24 or 27 steps) made with precision film resistors on a small circuit board in there with the stepping mechanism.

    I want to get rid of the little nubby sticking up on each pot. I don't have the tools to do this anymore so I'm looking for any suggestions that you might have. I want to get rid of the nubby without damaging the rest of these beautiful things.

    #Potentiometer #Help #Suggestions

  11. A detailed view of one of my mixing consoles {Yamaha}

    Composed in 85F warming light using my Philips Spot Light which I've had since I was a 17 years old teenager!

    #Yamaha #JOYO #Console #mixing #faders #potentiometer #AUX #Auxiliary #BUS #gain #Phantom #Power #48V #technology #Audio #music #signal #flow

  12. A detailed view of one of my mixing consoles {Yamaha}

    Composed in 85F warming light using my Philips Spot Light which I've had since I was a 17 years old teenager!

    #Yamaha #JOYO #Console #mixing #faders #potentiometer #AUX #Auxiliary #BUS #gain #Phantom #Power #48V #technology #Audio #music #signal #flow

  13. A detailed view of one of my mixing consoles {Yamaha}

    Composed in 85F warming light using my Philips Spot Light which I've had since I was a 17 years old teenager!

    #Yamaha #JOYO #Console #mixing #faders #potentiometer #AUX #Auxiliary #BUS #gain #Phantom #Power #48V #technology #Audio #music #signal #flow

  14. A detailed view of one of my mixing consoles {Yamaha}

    Composed in 85F warming light using my Philips Spot Light which I've had since I was a 17 years old teenager!

    #Yamaha #JOYO #Console #mixing #faders #potentiometer #AUX #Auxiliary #BUS #gain #Phantom #Power #48V #technology #Audio #music #signal #flow

  15. A detailed view of one of my mixing consoles {Yamaha}

    Composed in 85F warming light using my Philips Spot Light which I've had since I was a 17 years old teenager!

    #Yamaha #JOYO #Console #mixing #faders #potentiometer #AUX #Auxiliary #BUS #gain #Phantom #Power #48V #technology #Audio #music #signal #flow

  16. Atari 2600 Controller Shield PCB Revisited – Part 3

    Following on from Atari 2600 Controller Shield PCB Revisited – Part 2 someone on Mastodon made the point that the reason they tended to use RC circuits to read paddles “back in the day” was due to the expense of ADCs.

    Which triggered a bit of an “oh yeah” moment.

    The whole point was not to worry about the analog levels at all, and just measure the time it takes for the pin to read HIGH again.

    So this looks back at removing the whole ADC thing with a simple “if (digitalRead(pin))” condition!

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    The Code

    The overarching principles are the same as for Atari 2600 Controller Shield PCB Revisited – Part 2 but instead of all the bespoke code to read the analog to digital converter, I’m relying on the following:

    • A digital input pin has a threshold for which the input is considered HIGH.
    • We can wait for the input reading to register as HIGH instead of looking for absolute thresholds of an analog value.
    • For an ATMega328P the threshold is 0.6 x VCC or around 3V. This is equivalent to just over 610 on a 0 to 1023 scale of an equivalent analog reading.

    Taking this into account and using largely the same ideas as before, I can reuse most of the code but with the following timing and threshold values instead:

    • Start scaling (the 0 point): 10
    • End scaling (the 1023 point): 350

    The timer TICK is still 100uS and the “breakout” point is still 1000.

    When it comes to reading the digital INPUT, I’m using PORT IO once again for speed and expediency.

    for (int i=0; i<4; i++) {
    if ((PINC & (1<<i)) == 0) {
    // Still not HIGH yet
    }
    }

    Here is the complete, now greatly simplified, basic code:

    #include <TimerOne.h>

    #define RAW_START 10
    #define RAW_END 350
    #define RAW_BREAK 1000
    #define RAW_TICK 100

    unsigned padState;
    unsigned padCount[4];
    unsigned atariValue[4];

    void atariAnalogSetup() {
    Timer1.initialize(RAW_TICK);
    Timer1.attachInterrupt(atariAnalogScan);
    padState = 0;
    }

    void atariAnalogScan (void) {
    if (padState == 0) {
    DDRC = DDRC | 0x0F; // A0-A3 set to OUTPUT
    PORTC = PORTC & ~(0x0F); // A0-A3 set to LOW (0)
    padState++;
    } else if (padState == 1) {
    DDRC = DDRC & ~(0x0F); // A0-A3 set to INPUT
    for (int i=0; i<4; i++) {
    padCount[i] = 0;
    }
    padState++;
    } else if (padState > RAW_BREAK) {
    for (int i=0; i<4; i++) {
    atariValue[i] = 1023 - map(constrain(padCount[i],RAW_START,RAW_END),RAW_START,RAW_END,0,1023);
    }
    padState = 0;
    } else {
    for (int i=0; i<4; i++) {
    if ((PINC & (1<<i)) == 0) {
    padCount[i]++;
    }
    }
    padState++;
    }
    }

    int atariAnalogRead (int pin) {
    return atariValue[pin-A0];
    }

    void setup() {
    Serial.begin(9600);
    atariAnalogSetup();
    }

    void loop() {
    Serial.print(padState);
    Serial.print("\t[ ");
    for (int i=0; i<4; i++) {
    Serial.print(atariAnalogRead(A0+i));
    Serial.print("\t");
    Serial.print(padCount[i]);
    Serial.print("\t][ ");
    }
    Serial.print("\n");
    }

    Closing Thoughts

    Sometimes one really can’t see the “wood for the trees” and this was one of those occasions. I was so took up with thinking about how a modern system might think about a problem without thinking about the original reason for the particular solution.

    It makes so much more sense thinking about it in these terms now. All it took was an observation from another, namely:

    “So I know the RC timer is the classic way to sense analog paddles but they also didn’t have cheap ADCs back then.”

    Many thanks “Chip” for that observation 🙂

    Kevin

    #arduinoUno #atari #atari2600 #include #potentiometer #TICKs

  17. Everything you ever (or never) wanted to know about Potentiometers in this >200 pages Handbook by Bourns from 1975.
    Fun, how it changes from serious to comic style in chapter 9: TO KILL A POTENTIOMETER

    bourns.com/docs/technical-docu

    #electronics #potentiometer #historical #book #handbook #guide

  18. Forbidden Planet “Krell” Display – MIDI CC Controller – Part 2

    This revisits my Forbidden Planet “Krell” Display – MIDI CC Controller using my Forbidden Planet “Krell” Display PCB with a Waveshare RP2040 to create more of a “all in one” device.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    PCB

    This requires a built of the Forbidden Planet “Krell” Display PCB with the following:

    • 2 potentiometers
    • MIDI IN and OUT

    I’ve used potentiometers that are their own knob, as they only poke through the casing by around 5mm or so.

    If it you are able to get longer shaft pots, then that would probably be worthwhile.

    Updated 3D Printed Case

    This requires the following from the Krell Display 3D Printed Case:

    This requires the following options in the OpenSCAD code:

    show_frame = 1;
    show_quadframe = 0;
    show_insert = 1;
    show_support = 0;
    show_quadsupport = 0;
    show_eurorack = 0;
    show_eurorack_support = 1;

    alg_pot1 = 1;
    alg_pot2 = 1;
    alg_cv = 0;

    The frame does not really take into account the PCB at present, but I’ve reached the “good enough I want to do something else” stage, so I’ve just added a couple of small cut-outs (using a hacksaw) for the two MIDI sockets, and am content that the components stick out a bit from the back.

    This cutout has to be 10.5mm from the end, 6mm wide, and 5mm deep.

    At some point I might go back and design a deeper frame that has the cut-outs included and some kind of snap-on back to make it a self-contained box.

    But for now, this is left as an exercise for, well, anyone else 🙂

    Construction

    I’ve used four brass 6mm spacers to screw into the mounting holes in the frame. Then the PCB can be inserted, taking care to squeeze in the 3D printed support around the LEDs and pots, and fixed with 20mm spacers which will also act as “legs”.

    The Code

    I’ve used a Waveshare Zero RP2040 and Circuitpython for this build. This is a combination of some of the test code used for the Forbidden Planet “Krell” Display PCB but with added MIDI.

    The code supports both Serial and USB MIDI.

    I wanted an equivalent of the Arduino map() and constrain() functions and didn’t immediate spot them in Circuitpython so wrote my own:

    def algmap(val, minin, maxin, minout, maxout):
    if (val < minin):
    val = minin
    if (val > maxin):
    val = maxin
    return minout + (((val - minin) * (maxout - minout)) / (maxin - minin))

    This allows me to map the analog read values (0 to 65535) down to MIDI CC values (0 to 127) whilst also allowing for some inaccuracies (I’ve treated anything below 256 as zero for example):

    alg1cc = int(algmap(alg1_in.value,256,65530,0,127))

    I’ve used the Adafruit MIDI library, which I’m still not really a fan of, but I wanted to include MIDI THRU functionality to allow the controller to sit inline with an existing MIDI stream. But it doesn’t seem to work very well.

    I was already only updating the LEDs/MIDI CC if the pot values had changed, to cut down on the number of Neopixel writes required.

    I experimented with changing the scheduling of the analog reads and MIDI but that didn’t seem to help very much. In the end I made sure that all MIDI messages queued up in the system would be read at the same time before going back to checking the pots.

        msg = midiuart.receive()
    while (msg is not None):
    if (not isinstance(msg, MIDIUnknownEvent)):
    midiuart.send(msg)
    msg = midiuart.receive()

    It will do for now. Moving forward, I might try the Winterbloom SmolMIDI library. If that still doesn’t give me some useful performance then I might have to switch over to Arduino C.

    Find it on GitHub here.

    Closing Thoughts

    The MIDI throughput is disappointing, but then I’ve never really gotten on with the Adafruit MIDI library. I use it as USB MIDI on Circuitpython is so easy, so will need to do something about that.

    I’m still deciding on the PCB-sized supports too. The original seemed to have nicer diffusion of the LEDs, but that could have been the difference between 5mm SMT neopixels and these THT APA106s which seem more directional in the first place.

    And I really ought to finish the 3D printed case properly too.

    So this is “that will do” for now, but I ought to come back and finish it off properly at some point.

    Kevin

    #APA106 #circuitpython #ForbiddenPlanet #Krell #midi #midiController #NeoPixel #potentiometer #rp2040 #WaveshareZero

  19. Forbidden Planet “Krell” Display – MIDI CC Controller – Part 2

    This revisits my Forbidden Planet “Krell” Display – MIDI CC Controller using my Forbidden Planet “Krell” Display PCB with a Waveshare RP2040 to create more of a “all in one” device.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    PCB

    This requires a built of the Forbidden Planet “Krell” Display PCB with the following:

    • 2 potentiometers
    • MIDI IN and OUT

    I’ve used potentiometers that are their own knob, as they only poke through the casing by around 5mm or so.

    If it you are able to get longer shaft pots, then that would probably be worthwhile.

    Updated 3D Printed Case

    This requires the following from the Krell Display 3D Printed Case:

    This requires the following options in the OpenSCAD code:

    show_frame = 1;
    show_quadframe = 0;
    show_insert = 1;
    show_support = 0;
    show_quadsupport = 0;
    show_eurorack = 0;
    show_eurorack_support = 1;

    alg_pot1 = 1;
    alg_pot2 = 1;
    alg_cv = 0;

    The frame does not really take into account the PCB at present, but I’ve reached the “good enough I want to do something else” stage, so I’ve just added a couple of small cut-outs (using a hacksaw) for the two MIDI sockets, and am content that the components stick out a bit from the back.

    This cutout has to be 10.5mm from the end, 6mm wide, and 5mm deep.

    At some point I might go back and design a deeper frame that has the cut-outs included and some kind of snap-on back to make it a self-contained box.

    But for now, this is left as an exercise for, well, anyone else 🙂

    Construction

    I’ve used four brass 6mm spacers to screw into the mounting holes in the frame. Then the PCB can be inserted, taking care to squeeze in the 3D printed support around the LEDs and pots, and fixed with 20mm spacers which will also act as “legs”.

    The Code

    I’ve used a Waveshare Zero RP2040 and Circuitpython for this build. This is a combination of some of the test code used for the Forbidden Planet “Krell” Display PCB but with added MIDI.

    The code supports both Serial and USB MIDI.

    I wanted an equivalent of the Arduino map() and constrain() functions and didn’t immediate spot them in Circuitpython so wrote my own:

    def algmap(val, minin, maxin, minout, maxout):
    if (val < minin):
    val = minin
    if (val > maxin):
    val = maxin
    return minout + (((val - minin) * (maxout - minout)) / (maxin - minin))

    This allows me to map the analog read values (0 to 65535) down to MIDI CC values (0 to 127) whilst also allowing for some inaccuracies (I’ve treated anything below 256 as zero for example):

    alg1cc = int(algmap(alg1_in.value,256,65530,0,127))

    I’ve used the Adafruit MIDI library, which I’m still not really a fan of, but I wanted to include MIDI THRU functionality to allow the controller to sit inline with an existing MIDI stream. But it doesn’t seem to work very well.

    I was already only updating the LEDs/MIDI CC if the pot values had changed, to cut down on the number of Neopixel writes required.

    I experimented with changing the scheduling of the analog reads and MIDI but that didn’t seem to help very much. In the end I made sure that all MIDI messages queued up in the system would be read at the same time before going back to checking the pots.

        msg = midiuart.receive()
    while (msg is not None):
    if (not isinstance(msg, MIDIUnknownEvent)):
    midiuart.send(msg)
    msg = midiuart.receive()

    It will do for now. Moving forward, I might try the Winterbloom SmolMIDI library. If that still doesn’t give me some useful performance then I might have to switch over to Arduino C.

    Find it on GitHub here.

    Closing Thoughts

    The MIDI throughput is disappointing, but then I’ve never really gotten on with the Adafruit MIDI library. I use it as USB MIDI on Circuitpython is so easy, so will need to do something about that.

    I’m still deciding on the PCB-sized supports too. The original seemed to have nicer diffusion of the LEDs, but that could have been the difference between 5mm SMT neopixels and these THT APA106s which seem more directional in the first place.

    And I really ought to finish the 3D printed case properly too.

    So this is “that will do” for now, but I ought to come back and finish it off properly at some point.

    Kevin

    #APA106 #circuitpython #ForbiddenPlanet #Krell #midi #midiController #NeoPixel #potentiometer #rp2040 #WaveshareZero

  20. Forbidden Planet “Krell” Display – MIDI CC Controller – Part 2

    This revisits my Forbidden Planet “Krell” Display – MIDI CC Controller using my Forbidden Planet “Krell” Display PCB with a Waveshare RP2040 to create more of a “all in one” device.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    PCB

    This requires a built of the Forbidden Planet “Krell” Display PCB with the following:

    • 2 potentiometers
    • MIDI IN and OUT

    I’ve used potentiometers that are their own knob, as they only poke through the casing by around 5mm or so.

    If it you are able to get longer shaft pots, then that would probably be worthwhile.

    Updated 3D Printed Case

    This requires the following from the Krell Display 3D Printed Case:

    This requires the following options in the OpenSCAD code:

    show_frame = 1;
    show_quadframe = 0;
    show_insert = 1;
    show_support = 0;
    show_quadsupport = 0;
    show_eurorack = 0;
    show_eurorack_support = 1;

    alg_pot1 = 1;
    alg_pot2 = 1;
    alg_cv = 0;

    The frame does not really take into account the PCB at present, but I’ve reached the “good enough I want to do something else” stage, so I’ve just added a couple of small cut-outs (using a hacksaw) for the two MIDI sockets, and am content that the components stick out a bit from the back.

    This cutout has to be 10.5mm from the end, 6mm wide, and 5mm deep.

    At some point I might go back and design a deeper frame that has the cut-outs included and some kind of snap-on back to make it a self-contained box.

    But for now, this is left as an exercise for, well, anyone else 🙂

    Construction

    I’ve used four brass 6mm spacers to screw into the mounting holes in the frame. Then the PCB can be inserted, taking care to squeeze in the 3D printed support around the LEDs and pots, and fixed with 20mm spacers which will also act as “legs”.

    The Code

    I’ve used a Waveshare Zero RP2040 and Circuitpython for this build. This is a combination of some of the test code used for the Forbidden Planet “Krell” Display PCB but with added MIDI.

    The code supports both Serial and USB MIDI.

    I wanted an equivalent of the Arduino map() and constrain() functions and didn’t immediate spot them in Circuitpython so wrote my own:

    def algmap(val, minin, maxin, minout, maxout):
    if (val < minin):
    val = minin
    if (val > maxin):
    val = maxin
    return minout + (((val - minin) * (maxout - minout)) / (maxin - minin))

    This allows me to map the analog read values (0 to 65535) down to MIDI CC values (0 to 127) whilst also allowing for some inaccuracies (I’ve treated anything below 256 as zero for example):

    alg1cc = int(algmap(alg1_in.value,256,65530,0,127))

    I’ve used the Adafruit MIDI library, which I’m still not really a fan of, but I wanted to include MIDI THRU functionality to allow the controller to sit inline with an existing MIDI stream. But it doesn’t seem to work very well.

    I was already only updating the LEDs/MIDI CC if the pot values had changed, to cut down on the number of Neopixel writes required.

    I experimented with changing the scheduling of the analog reads and MIDI but that didn’t seem to help very much. In the end I made sure that all MIDI messages queued up in the system would be read at the same time before going back to checking the pots.

        msg = midiuart.receive()
    while (msg is not None):
    if (not isinstance(msg, MIDIUnknownEvent)):
    midiuart.send(msg)
    msg = midiuart.receive()

    It will do for now. Moving forward, I might try the Winterbloom SmolMIDI library. If that still doesn’t give me some useful performance then I might have to switch over to Arduino C.

    Find it on GitHub here.

    Closing Thoughts

    The MIDI throughput is disappointing, but then I’ve never really gotten on with the Adafruit MIDI library. I use it as USB MIDI on Circuitpython is so easy, so will need to do something about that.

    I’m still deciding on the PCB-sized supports too. The original seemed to have nicer diffusion of the LEDs, but that could have been the difference between 5mm SMT neopixels and these THT APA106s which seem more directional in the first place.

    And I really ought to finish the 3D printed case properly too.

    So this is “that will do” for now, but I ought to come back and finish it off properly at some point.

    Kevin

    #APA106 #circuitpython #ForbiddenPlanet #Krell #midi #midiController #NeoPixel #potentiometer #rp2040 #WaveshareZero

  21. Forbidden Planet “Krell” Display – MIDI CC Controller – Part 2

    This revisits my Forbidden Planet “Krell” Display – MIDI CC Controller using my Forbidden Planet “Krell” Display PCB with a Waveshare RP2040 to create more of a “all in one” device.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    PCB

    This requires a built of the Forbidden Planet “Krell” Display PCB with the following:

    • 2 potentiometers
    • MIDI IN and OUT

    I’ve used potentiometers that are their own knob, as they only poke through the casing by around 5mm or so.

    If it you are able to get longer shaft pots, then that would probably be worthwhile.

    Updated 3D Printed Case

    This requires the following from the Krell Display 3D Printed Case:

    This requires the following options in the OpenSCAD code:

    show_frame = 1;
    show_quadframe = 0;
    show_insert = 1;
    show_support = 0;
    show_quadsupport = 0;
    show_eurorack = 0;
    show_eurorack_support = 1;

    alg_pot1 = 1;
    alg_pot2 = 1;
    alg_cv = 0;

    The frame does not really take into account the PCB at present, but I’ve reached the “good enough I want to do something else” stage, so I’ve just added a couple of small cut-outs (using a hacksaw) for the two MIDI sockets, and am content that the components stick out a bit from the back.

    This cutout has to be 10.5mm from the end, 6mm wide, and 5mm deep.

    At some point I might go back and design a deeper frame that has the cut-outs included and some kind of snap-on back to make it a self-contained box.

    But for now, this is left as an exercise for, well, anyone else 🙂

    Construction

    I’ve used four brass 6mm spacers to screw into the mounting holes in the frame. Then the PCB can be inserted, taking care to squeeze in the 3D printed support around the LEDs and pots, and fixed with 20mm spacers which will also act as “legs”.

    The Code

    I’ve used a Waveshare Zero RP2040 and Circuitpython for this build. This is a combination of some of the test code used for the Forbidden Planet “Krell” Display PCB but with added MIDI.

    The code supports both Serial and USB MIDI.

    I wanted an equivalent of the Arduino map() and constrain() functions and didn’t immediate spot them in Circuitpython so wrote my own:

    def algmap(val, minin, maxin, minout, maxout):
    if (val < minin):
    val = minin
    if (val > maxin):
    val = maxin
    return minout + (((val - minin) * (maxout - minout)) / (maxin - minin))

    This allows me to map the analog read values (0 to 65535) down to MIDI CC values (0 to 127) whilst also allowing for some inaccuracies (I’ve treated anything below 256 as zero for example):

    alg1cc = int(algmap(alg1_in.value,256,65530,0,127))

    I’ve used the Adafruit MIDI library, which I’m still not really a fan of, but I wanted to include MIDI THRU functionality to allow the controller to sit inline with an existing MIDI stream. But it doesn’t seem to work very well.

    I was already only updating the LEDs/MIDI CC if the pot values had changed, to cut down on the number of Neopixel writes required.

    I experimented with changing the scheduling of the analog reads and MIDI but that didn’t seem to help very much. In the end I made sure that all MIDI messages queued up in the system would be read at the same time before going back to checking the pots.

        msg = midiuart.receive()
    while (msg is not None):
    if (not isinstance(msg, MIDIUnknownEvent)):
    midiuart.send(msg)
    msg = midiuart.receive()

    It will do for now. Moving forward, I might try the Winterbloom SmolMIDI library. If that still doesn’t give me some useful performance then I might have to switch over to Arduino C.

    Find it on GitHub here.

    Closing Thoughts

    The MIDI throughput is disappointing, but then I’ve never really gotten on with the Adafruit MIDI library. I use it as USB MIDI on Circuitpython is so easy, so will need to do something about that.

    I’m still deciding on the PCB-sized supports too. The original seemed to have nicer diffusion of the LEDs, but that could have been the difference between 5mm SMT neopixels and these THT APA106s which seem more directional in the first place.

    And I really ought to finish the 3D printed case properly too.

    So this is “that will do” for now, but I ought to come back and finish it off properly at some point.

    Kevin

    #APA106 #circuitpython #ForbiddenPlanet #Krell #midi #midiController #NeoPixel #potentiometer #rp2040 #WaveshareZero

  22. Forbidden Planet “Krell” Display – MIDI CC Controller – Part 2

    This revisits my Forbidden Planet “Krell” Display – MIDI CC Controller using my Forbidden Planet “Krell” Display PCB with a Waveshare RP2040 to create more of a “all in one” device.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    PCB

    This requires a built of the Forbidden Planet “Krell” Display PCB with the following:

    • 2 potentiometers
    • MIDI IN and OUT

    I’ve used potentiometers that are their own knob, as they only poke through the casing by around 5mm or so.

    If it you are able to get longer shaft pots, then that would probably be worthwhile.

    Updated 3D Printed Case

    This requires the following from the Krell Display 3D Printed Case:

    This requires the following options in the OpenSCAD code:

    show_frame = 1;
    show_quadframe = 0;
    show_insert = 1;
    show_support = 0;
    show_quadsupport = 0;
    show_eurorack = 0;
    show_eurorack_support = 1;

    alg_pot1 = 1;
    alg_pot2 = 1;
    alg_cv = 0;

    The frame does not really take into account the PCB at present, but I’ve reached the “good enough I want to do something else” stage, so I’ve just added a couple of small cut-outs (using a hacksaw) for the two MIDI sockets, and am content that the components stick out a bit from the back.

    This cutout has to be 10.5mm from the end, 6mm wide, and 5mm deep.

    At some point I might go back and design a deeper frame that has the cut-outs included and some kind of snap-on back to make it a self-contained box.

    But for now, this is left as an exercise for, well, anyone else 🙂

    Construction

    I’ve used four brass 6mm spacers to screw into the mounting holes in the frame. Then the PCB can be inserted, taking care to squeeze in the 3D printed support around the LEDs and pots, and fixed with 20mm spacers which will also act as “legs”.

    The Code

    I’ve used a Waveshare Zero RP2040 and Circuitpython for this build. This is a combination of some of the test code used for the Forbidden Planet “Krell” Display PCB but with added MIDI.

    The code supports both Serial and USB MIDI.

    I wanted an equivalent of the Arduino map() and constrain() functions and didn’t immediate spot them in Circuitpython so wrote my own:

    def algmap(val, minin, maxin, minout, maxout):
    if (val < minin):
    val = minin
    if (val > maxin):
    val = maxin
    return minout + (((val - minin) * (maxout - minout)) / (maxin - minin))

    This allows me to map the analog read values (0 to 65535) down to MIDI CC values (0 to 127) whilst also allowing for some inaccuracies (I’ve treated anything below 256 as zero for example):

    alg1cc = int(algmap(alg1_in.value,256,65530,0,127))

    I’ve used the Adafruit MIDI library, which I’m still not really a fan of, but I wanted to include MIDI THRU functionality to allow the controller to sit inline with an existing MIDI stream. But it doesn’t seem to work very well.

    I was already only updating the LEDs/MIDI CC if the pot values had changed, to cut down on the number of Neopixel writes required.

    I experimented with changing the scheduling of the analog reads and MIDI but that didn’t seem to help very much. In the end I made sure that all MIDI messages queued up in the system would be read at the same time before going back to checking the pots.

        msg = midiuart.receive()
    while (msg is not None):
    if (not isinstance(msg, MIDIUnknownEvent)):
    midiuart.send(msg)
    msg = midiuart.receive()

    It will do for now. Moving forward, I might try the Winterbloom SmolMIDI library. If that still doesn’t give me some useful performance then I might have to switch over to Arduino C.

    Find it on GitHub here.

    Closing Thoughts

    The MIDI throughput is disappointing, but then I’ve never really gotten on with the Adafruit MIDI library. I use it as USB MIDI on Circuitpython is so easy, so will need to do something about that.

    I’m still deciding on the PCB-sized supports too. The original seemed to have nicer diffusion of the LEDs, but that could have been the difference between 5mm SMT neopixels and these THT APA106s which seem more directional in the first place.

    And I really ought to finish the 3D printed case properly too.

    So this is “that will do” for now, but I ought to come back and finish it off properly at some point.

    Kevin

    #APA106 #circuitpython #ForbiddenPlanet #Krell #midi #midiController #NeoPixel #potentiometer #rp2040 #WaveshareZero

  23. Forbidden Planet “Krell” Display EuroRack Module

    This project uses my Forbidden Planet “Krell” Display and the Forbidden Planet “Krell” Display PCB Design but with some slight variations that means it could be EuroRack mounted with a control voltage (CV) input.

    This is a DIY module only for use in my own DIY system.

    Do NOT use this alongside expensive modules in an expensive rack. It is highly likely to cause problems with your power supply and could even damage your other modules.

    https://makertube.net/w/qJqgTxxsEznTuF2DRVZT9o

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to microcontrollers, see the Getting Started pages.

    Parts list

    EuroRack 3D Print Design

    This is an evolution of my original Forbidden Planet “Krell” Display box, but fitting into EuroRack dimensions: 128.5 x 60, which essentially makes it a 12 HP module.

    It still takes the same inserts however, but now also includes options for holes for jack sockets or potentiometers:

    show_eurorack = 1;
    show_eurorack_support = 1;

    alg_pot1 = 1;
    alg_pot2 = 1;
    alg_cv = 0;

    I’ve also included a special “supports” option for use with the PCB and the EuroRack case.

    Krell Display PCB – EuroRack Build

    To build one of my Forbidden Planet “Krell” Display PCB Designs for use with a EuroRack, follow the previous Build Guide but note the following differences:

    • The MIDI circuits are not required when used as a CV input device.
    • The lower potentiometer should be replaced with a CV input circuit.
    • The upper potentiometer is optional, but I’m omitting it for my build.
    • Power will come via the 5V jumper headers from an additional EuroRack power PCB (details below).
    • Low-profile (e.g. 9mm high in total) headers should be used for the Waveshare Zero, but once again note the errata about the footprint on the PCB being too wide.

    Here are some build photos of a build for EuroRack use. For this build there are only two diodes (the two BAT43) and two resistors (22K and 33K). Also note that none of the 100nF ceramic capacitors are required either.

    Both electrolytic capacitors have been soldered into position on their sides as show below.

    The Thonkiconn style mono jack shares the footprint are of the lower potentiometer on the LED side of the board, but be sure to get use the correct mounting holes as shown by the orientation below.

    Nothing has been soldered to the power jumper yet. See the discussion below for how to link this to the power board.

    Krell Display Companion EuroRack Power PCB

    Bill of Materials:

    • Waveshare Zero “Krell” Display EuroRack power PCB (Github Link below).
    • L7805 TO-220 format regulator or equivalent (see discussion below).
    • 1x 16-way DIP EuroRack shrouded header.
    • 1x 1N5017 Zener diode.
    • 2x 47uF electrolytic capacitors.
    • 1x 100nF ceramic capacitor.
    • 2-way Jumper header socket and pins (probably need extended pins – see discussion).

    I’ve opted to use a DC-DC converter with a 7805 physical footprint as shown below.

    If a 7805 regulator is used then a heatsink will almost certainly be required. I’ve oriented the regular to allow for a “tab up” mounting which hopefully leaves plenty of room for some kind of heatsink to be used.

    Here are some build photos.

    There is an option on the PCB to install a 10R resistor as is sometimes recommended for EuroRack modules. From what I’ve read this seems to be to allow it to act as a “fuse” in the case of an incorrectly wired module. As I’ve discussed before (see here) I’m not sure this is so relevant for me, so I’m using the provided solder bypass bridge to leave it out.

    Note the orientation of the DC-DC converter.

    I’ve used extended pin headers for the power link between the two boards, but due to an error in positioning, they’ve had to be bent over slightly – more on that later.

    Physical Build

    A completed unit has the following parts:

    • 3D printed case, PCB supports, and two “krell” inserts.
    • Main PCB built for EuroRack use as described above.
    • Power PCB as described above.
    • M2.5 spacers and fixings as follows:
      • 4x 6mm M2.5 brass fixings.
      • 4x 15mm M2.5 nylon fixings.
      • 4x M2.5 nylon screws.

    The power link between the two PCBs has to be trimmed and slightly bent as shown below.

    Once the whole thing is put together, there isn’t room, at least on my build, for the nut to be put on the jack socket. Also, the 6mm and 15mm spacers might be slightly too short, depending on how far off the PCBs the LEDs ended up. Some experimentation and “encouragement” is probably required to get everything together.

    The Code

    The code is relatively straight forward, and is largely a mix of the analog and neopixel test code from the Forbidden Planet “Krell” Display PCB Build Guide.

    One quirk is scaling the analog read from 0..65535 to a useful 0-10 to allow for zero to 10 leds to light up. I’ve allowed for a range of values to be “basically zero” too to allow for some jitter or noise.

    As I only write out to the neopixels when something changes, this code seems to be quite responsive.

    This requires the following Adafruit Circuitpython Library Bundle libraries:

    • neopixel.mpy
    • adafruit_pioasm.mpy
    • adafruit_pixelbuf.mpy

    In fact, the entire Circuitpython code is given below.

    import time
    import board
    import neopixel
    from analogio import AnalogIn

    cv_in = AnalogIn(board.A3)

    pixel_pin1 = board.GP2
    pixel_pin2 = board.GP3
    num_pixels = 5

    pixels1 = neopixel.NeoPixel(pixel_pin1, num_pixels, brightness=0.3, auto_write=False, pixel_order=neopixel.RGB)
    pixels2 = neopixel.NeoPixel(pixel_pin2, num_pixels, brightness=0.3, auto_write=False, pixel_order=neopixel.RGB)

    col = (80, 35, 0)

    lastcv = -1
    while True:
    cv = cv_in.value / 256

    if (lastcv != cv):
    lastcv = cv
    led = cv / 25
    for pix in range(5):
    if (pix < led and cv > 5):
    pixels1[pix] = col
    else:
    pixels1[pix] = 0

    if (pix+5 < led and cv > 5):
    pixels2[pix] = col
    else:
    pixels2[pix] = 0

    pixels1.show()
    pixels2.show()

    GiHub Resources

    There is now an updated version of the OpenSCAD code for the case on GitHub and the PCB and code are also now available.

    Closing Thoughts

    This isn’t a perfect build in mechanical terms, but I’m not sure I ever do anything perfectly anyway, especially where mechanical things are concerned, but the final result is pretty pleasing.

    The video shows it running with a Pimoroni RP2040 in the driving seat. First a potentiometer provides a 0 to 5V input, then I’m using my Educational DIY Synth Thing‘s LFO to provide a 0 to 3V3 input.

    Kevin

    #circuitpython #EuroRack #Krell #NeoPixel #potentiometer

  24. Forbidden Planet “Krell” Display EuroRack Module

    This project uses my Forbidden Planet “Krell” Display and the Forbidden Planet “Krell” Display PCB Design but with some slight variations that means it could be EuroRack mounted with a control voltage (CV) input.

    This is a DIY module only for use in my own DIY system.

    Do NOT use this alongside expensive modules in an expensive rack. It is highly likely to cause problems with your power supply and could even damage your other modules.

    https://makertube.net/w/qJqgTxxsEznTuF2DRVZT9o

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to microcontrollers, see the Getting Started pages.

    Parts list

    EuroRack 3D Print Design

    This is an evolution of my original Forbidden Planet “Krell” Display box, but fitting into EuroRack dimensions: 128.5 x 60, which essentially makes it a 12 HP module.

    It still takes the same inserts however, but now also includes options for holes for jack sockets or potentiometers:

    show_eurorack = 1;
    show_eurorack_support = 1;

    alg_pot1 = 1;
    alg_pot2 = 1;
    alg_cv = 0;

    I’ve also included a special “supports” option for use with the PCB and the EuroRack case.

    Krell Display PCB – EuroRack Build

    To build one of my Forbidden Planet “Krell” Display PCB Designs for use with a EuroRack, follow the previous Build Guide but note the following differences:

    • The MIDI circuits are not required when used as a CV input device.
    • The lower potentiometer should be replaced with a CV input circuit.
    • The upper potentiometer is optional, but I’m omitting it for my build.
    • Power will come via the 5V jumper headers from an additional EuroRack power PCB (details below).
    • Low-profile (e.g. 9mm high in total) headers should be used for the Waveshare Zero, but once again note the errata about the footprint on the PCB being too wide.

    Here are some build photos of a build for EuroRack use. For this build there are only two diodes (the two BAT43) and two resistors (22K and 33K). Also note that none of the 100nF ceramic capacitors are required either.

    Both electrolytic capacitors have been soldered into position on their sides as show below.

    The Thonkiconn style mono jack shares the footprint are of the lower potentiometer on the LED side of the board, but be sure to get use the correct mounting holes as shown by the orientation below.

    Nothing has been soldered to the power jumper yet. See the discussion below for how to link this to the power board.

    Krell Display Companion EuroRack Power PCB

    Bill of Materials:

    • Waveshare Zero “Krell” Display EuroRack power PCB (Github Link below).
    • L7805 TO-220 format regulator or equivalent (see discussion below).
    • 1x 16-way DIP EuroRack shrouded header.
    • 1x 1N5017 Zener diode.
    • 2x 47uF electrolytic capacitors.
    • 1x 100nF ceramic capacitor.
    • 2-way Jumper header socket and pins (probably need extended pins – see discussion).

    I’ve opted to use a DC-DC converter with a 7805 physical footprint as shown below.

    If a 7805 regulator is used then a heatsink will almost certainly be required. I’ve oriented the regular to allow for a “tab up” mounting which hopefully leaves plenty of room for some kind of heatsink to be used.

    Here are some build photos.

    There is an option on the PCB to install a 10R resistor as is sometimes recommended for EuroRack modules. From what I’ve read this seems to be to allow it to act as a “fuse” in the case of an incorrectly wired module. As I’ve discussed before (see here) I’m not sure this is so relevant for me, so I’m using the provided solder bypass bridge to leave it out.

    Note the orientation of the DC-DC converter.

    I’ve used extended pin headers for the power link between the two boards, but due to an error in positioning, they’ve had to be bent over slightly – more on that later.

    Physical Build

    A completed unit has the following parts:

    • 3D printed case, PCB supports, and two “krell” inserts.
    • Main PCB built for EuroRack use as described above.
    • Power PCB as described above.
    • M2.5 spacers and fixings as follows:
      • 4x 6mm M2.5 brass fixings.
      • 4x 15mm M2.5 nylon fixings.
      • 4x M2.5 nylon screws.

    The power link between the two PCBs has to be trimmed and slightly bent as shown below.

    Once the whole thing is put together, there isn’t room, at least on my build, for the nut to be put on the jack socket. Also, the 6mm and 15mm spacers might be slightly too short, depending on how far off the PCBs the LEDs ended up. Some experimentation and “encouragement” is probably required to get everything together.

    The Code

    The code is relatively straight forward, and is largely a mix of the analog and neopixel test code from the Forbidden Planet “Krell” Display PCB Build Guide.

    One quirk is scaling the analog read from 0..65535 to a useful 0-10 to allow for zero to 10 leds to light up. I’ve allowed for a range of values to be “basically zero” too to allow for some jitter or noise.

    As I only write out to the neopixels when something changes, this code seems to be quite responsive.

    This requires the following Adafruit Circuitpython Library Bundle libraries:

    • neopixel.mpy
    • adafruit_pioasm.mpy
    • adafruit_pixelbuf.mpy

    In fact, the entire Circuitpython code is given below.

    import time
    import board
    import neopixel
    from analogio import AnalogIn

    cv_in = AnalogIn(board.A3)

    pixel_pin1 = board.GP2
    pixel_pin2 = board.GP3
    num_pixels = 5

    pixels1 = neopixel.NeoPixel(pixel_pin1, num_pixels, brightness=0.3, auto_write=False, pixel_order=neopixel.RGB)
    pixels2 = neopixel.NeoPixel(pixel_pin2, num_pixels, brightness=0.3, auto_write=False, pixel_order=neopixel.RGB)

    col = (80, 35, 0)

    lastcv = -1
    while True:
    cv = cv_in.value / 256

    if (lastcv != cv):
    lastcv = cv
    led = cv / 25
    for pix in range(5):
    if (pix < led and cv > 5):
    pixels1[pix] = col
    else:
    pixels1[pix] = 0

    if (pix+5 < led and cv > 5):
    pixels2[pix] = col
    else:
    pixels2[pix] = 0

    pixels1.show()
    pixels2.show()

    GiHub Resources

    There is now an updated version of the OpenSCAD code for the case on GitHub and the PCB and code are also now available.

    Closing Thoughts

    This isn’t a perfect build in mechanical terms, but I’m not sure I ever do anything perfectly anyway, especially where mechanical things are concerned, but the final result is pretty pleasing.

    The video shows it running with a Pimoroni RP2040 in the driving seat. First a potentiometer provides a 0 to 5V input, then I’m using my Educational DIY Synth Thing‘s LFO to provide a 0 to 3V3 input.

    Kevin

    #circuitpython #EuroRack #Krell #NeoPixel #potentiometer

  25. #Drilling holes and test fitting the #enclosure for my 10 step #sequencer
    On the front slope, there are ten #potentiometer, LEDs, and toggle switches. The LED fixtures are still missing.
    On the top, unsloped part will be the step selector, inputs and outputs.
    At the back side will be the power connector and the power switch.
    #diysynth #synthesizer

  26. Multi-Mode MIDI Step Sequencer – CDR Format – Part 3

    This post revisits the “CDR format” (CD Rack Format) panel version of my Multi-Mode MIDI Step Sequencer.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    Panel Design

    A key issue was that I hadn’t really documented the dimensions I’d used in the design of the original panel, but after finding the old cardboard cutout and comparing to my built panel I was able to reproduce the dimensions.

    It also turns out that I haven’t really listed the hole sizes I’ve been using for panels either, so that was part of the first task too.

    I had to create a custom KiCad part for an M7 hole. I based this on the existing M8 holes (one with a pad and one without).

    The rest of the holes used, that match the connectors I’m using, are as follows:

    PotentiometerM7 (7.4mm) mounting holeAudio OutM8 (8.4mm) mounting holeMIDI TRSM6 (6.4mm) mounting holeToggle SwitchM7 (7.4mm) mounting hole“Thonkiconn” Jack SocketM6 (6.4mm) mounting hole3mm LED3mm mounting hole5mm LED5mm mounting holePower Switch12.5mm diameter edge cut cutout

    The key dimensions are indicated below. The whole panel is 250×80 mm with mounting holes 10x10mm from each corner and 20mm clearance top and bottom for mounting.

    As I’m using a PCB design tool for the panel, I’ve included a rear GND zone, so left a small pad exposed near the bottom to solder to if required. I did think about using “pads” rather than plain holes to allow switches and potentiometers and so on to connect to the GND zone, but in the end opted for plain holes.

    Note: there is one error on the final PCB – the toggle switch was designed with a M6 hole and actually I need an M7, so I had to widen it slightly.

    There were a couple of complications with switching over, that I wouldn’t have had with a new build:

    • The power switch needed desoldering and resoldering as the nut is on the inside. Unfortunately I managed to damage the click mechanism and on first try, it was quite unreliable latching in the on position. I had to replace it completely.
    • Two of the three-way switches had their nut/shaft fail on me – I managed to do up the nut most of the way, but not completely and then the threaded shaft started rotating meaning I could neither do it up or undo it. They work, they are fixed in, but they are a little wobbly which is really annoying! But I’d need to desolder a fair bit to replace them. They’ll do for now. Sigh.

    Some enhancements were possible too whilst updating the board:

    • I’ve added a 10nF capacitor across the terminals of the toggle switch to aid debouncing.

    Other enhancements I’m considering that I might add at a later date:

    • Add capacitors across all pots for smoothing.
    • Add clamp Schottky diodes to the sync IN/OUT sockets, so they aren’t just a direct connection to the microcontroller’s GPIO ports. This was always something I meant to do anyway.

    In fact, I might even add a proper buffer stage for the sync jacks anyway – a transistor input stage and protected output stage, as used in my Arduino Drum Trigger to MIDI Shield PCB and my Arduino Clock Generator Shield PCB. Or even include a buffer in the shape of a 74HC14 or similar.

    Closing Thoughts

    I thought this would be a straight swap and relatively straight forward to do. Unfortunately the use of cheap components caught up with me on this one.

    Still, I think the result looks pretty good and it does all now work fine.

    It certainly looks great next to my MiniDexed TX816.

    Kevin

    #ATmega2560 #cdrFormat #digitalPins #led #midi #pcb #potentiometer #ProMega2560 #sequencer #stepSequence

  27. Arduino MIDI Master Volume Control

    This project uses an Arduino Uno or Nano with a potentiometer to create a MIDI Master Volume Control.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Circuit

    A potentiometer is connected to A0, 5V and GND. To help smooth out the readings a 100nF ceramic capacitor can be connected between A0 and GND.

    A MIDI OUT circuit is required. If full software MIDI THRU is required, then a MIDI IN circuit is also required, but it is not necessary to work. In fact a simple “two resistor” MIDI OUT interface would do the trick too (see DIY MIDI Interfaces).

    I’ve used my Arduino Nano Mozzi Experimenter Shield PCB simply because it has a built-in MIDI interface and readily available potentiometers, but most of the additional circuitry is unused in this case.

    The Code

    This is a variation of the Arduino Serial MIDI Program and Control Messenger in principle, but in practise there are significant differences. Whilst the MIDI Control Change messages include a volume control, it has been long considered that this should be treated as a “channel message volume control” and not meant for “whole device” operation.

    Consequently, at some point it was decided that one of the System Exclusive, System Real-time messages would be reserved as a “whole device” master volume control. That is what is required here.

    The MIDI specification describes the require message as follows:

    The Arduino MIDI library includes a sendSysEx function which has to be given a byte-sequence containing the required message. If the last parameter is “true” then it expects the SysEx start and end bytes to be included in the message.

    Note that this MIDI message is using the common MIDI method for higher resolution values – it splits a 14-bit value (0 to 16363) into two “almost bytes” of 7-bits each so this has to be accounted for in the code.

    Also, as the control will come from an Arduino analog INPUT port the starting values will be 0 to 1023, so they need to be scaled to the required MIDI range. This all happens in the function below.

    void setMasterVolume (int volume) { 
    uint16_t midivol = map(volume, 0, MAX_POT, 0, 16383);
    byte sysex[9] = {0xF0, 0x7F, 0x7F, 0x04, 0x01, 0, 0, 0xF7, 0};
    sysex[5] = midivol & 0x7F; // LSB
    sysex[6] = (midivol >> 7) & 0x7F; // MSB
    MIDI.sendSysEx(8, sysex, true);
    }

    I’ve also used, and slightly updated, the analog read averaging routine I used in Arduino PSS-680 Synth Editor- Part 2. This code maintains a “running average” reading to smooth out any jitters in the readings.

    One thing I was finding though, especially at full-reading (1023), it was still quite jittery even with the smoothing, then I realised that this is because of integer arithmetic always rounding down to the last whole number. This means that no matter how many of the sampled readers were at the full value of 1023 if there was just a single reading of 1022 the rounding down would make the “average” also 1022.

    The way around that was to use a single decimal place for each reading and then add 0.5 to the final averaged value to ensure it would also round to the nearest integer rather than round down.

    To save having to move into floating point arithmetic I multiply the value by 10 giving me a pseudo single fixed-point decimal.

    The complete averaging routine is thus as follows:

    #define AVGEREADINGS 32
    int avgepotvals[AVGEREADINGS];
    int avgepotidx;
    long avgepottotal;

    int avgeAnalogRead (int pot) {
    int reading = 10*analogRead(pot);
    avgepottotal = avgepottotal - avgepotvals[avgepotidx];
    avgepotvals[avgepotidx] = reading;
    avgepottotal = avgepottotal + reading;
    avgepotidx++;
    if (avgepotidx >= AVGEREADINGS) avgepotidx = 0;
    return (((avgepottotal / AVGEREADINGS) + 5) / 10);
    }

    Notice how the analogRead() is multiplied by 10 and then once the average is calculated in the last line 5 is added (or 0.5 when we know it is a fixed-single-point decimal) prior to the final divide by 10 to get back into the 0 to 1023 range.

    Coupling this with a capacitor across the signal of the potentiometer as shown in the schematic, this gives me a much more stable reading, which is important for a MIDI controller as it means there is no MIDI messages being sent unless something has really changed.

    The code is using the MIDI serial transport which has MIDI THRU enabled by default. This means that the board could be used within an existing MIDI link by connecting both MIDI OUT and IN. This would add Master Volume control alongside whatever else is being transmitting and as the MIDI library works on the basis of complete MIDI messages, it should work relatively intelligently while merging the two MIDI streams.

    Find it on GitHub here.

    Closing Thoughts

    There are many directions this code could go next. The obvious ones are:

    • Include options for additional MIDI interfaces, especially USB MIDI.
    • Support Master Balance in addition to Master Volume.
    • Switch to a rotary encoder rather than a potentiometer.

    Kevin

    #arduinoNano #arduinoUno #masterControl #midi #potentiometer #sysex #systemExclusive

  28. ESP32 WROOM Mozzi Experimenter PCB Build Guide

    Here are the build notes for my ESP32 WROOM Mozzi Experimenter PCB Design.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    Bill of Materials

    • ESP32 WROOM Mozzi Experimenter PCB (GitHub link below)
    • ESP32 WROOM 32-D DevKit (see photos and PCB for pinout – in particular note position of 3V3 and GND pins)
    • 1x H11L1 optoisolator
    • 1x 1N4148 or 1N914 signal diode
    • 1x 10Ω, 1x 33Ω, 1×220Ω, 1×470Ω, 2x1K, 2x2K resistors
    • 8x 10K potentiometers (PCB mount, see PCB and photos for footprint)
    • 2x 100nF ceramic capacitors
    • 2x 10uF non-polar capacitors (electrolytics probably fine too)
    • 1x 100uF electrolytic capacitor
    • 1x 3.5mm stereo TRS socket (PCB mount – see photos/PCB)
    • Either 2x 180 degree DIN sockets (PCB mount – see photos/PCB)
    • Or 2x 3.5mm stereo TRS sockets
    • 1x 2.1mm barrel jack socket (PCB mount – see photos/PCB)
    • Optional: 2x or 4x 15-pin header sockets
    • Optional: 1x 6 way DIP socket
    • Optional: pin headers
    • Optional: jumpers
    • Optional: SPDT slider switch, 2.54mm pitch connections (see photos/PCB)

    Build Steps

    Taking a typical “low to high” soldering approach, this is the suggested order of assembly:

    • All resistors and diode.
    • DIP socket (if used) and TRS socket(s).
    • Disc capacitors.
    • Headers.
    • Switch (if used).
    • Barrel jack.
    • Non-polar and electrolytic capacitors.
    • DIN sockets (if used).
    • Potentiometers.

    Here are some build photos.

    There are several options for headers – there is an additional breakout of all the pins of the ESP32 module and these can be populated with sockets, pins or just left unpopulated as shown below.

    And finally adding the potentiometers.

    Configuration Options

    Two of the potentiometers, RV1 and RV2, have configurable GPIO connections, which are selected by solder jumpers on the rear of the board. The default has them mapped as follows:

    RV1GPIO 13RV2GPIO 12

    The alternative is configured by cutting the default track between the top solder pads and re-soldering to the bottom pads:

    Only one can be changed if required. The alternative configurations are:

    RV1GPIO 39RV2GPIO 36

    Testing

    I recommend performing the general tests described here: PCBs.

    Functionality testing is covered by the Sample Applications given below.

    PCB Errata

    There are the following issues with this PCB:

    • The UART jumper is labelled UART0 and UART1, but in actually, UART1 is almost certainly going to end up being UART2 as UART1 is typically used for onboard flash memory.

    Enhancements:

    •  I could add a slightly larger prototyping area, perhaps mirroring the layout of a mini solderless breadboard and still keep within a 100x100mm footprint.

    Find it on GitHub here.

    Sample Applications

    Recall that the GPIO used can be found listed in the ESP32 WROOM Mozzi Experimenter PCB Design.

    Potentiometer Analog Read Test

    The following code will echo the values from all 8 potentiometers to the serial monitor.

    #define NUM_POTS 8
    int potpins[NUM_POTS] = {
    13, 12, 14, 27, // ADC 2.4, 2.5, 2.6, 2.7
    33, 32, 35, 34 // ADC 1.4, 1.5, 1.7, 1.6
    };

    void setup() {
    Serial.begin(115200);
    }

    void loop() {
    for (int i=0; i<NUM_POTS; i++) {
    int aval = analogRead(potpins[i]);
    Serial.print(aval);
    Serial.print("\t");
    }
    Serial.print("\n");
    delay(100);
    }

    DAC Write Test

    The following code will generate two sawtooth waveforms on the two DAC pins, GPIO25 and GPIO26, which are connected to the audio output L and R channels.

    GPIO 25 will generate a 440Hz saw tone, and GPIO26 will generate a 880Hz saw tone.

    This works, as the code generates a 6-bit (i.e. 0 to 63) value saw wave, updating the value every time through the loop() function. The value is effectively scaled up to 8-bits (0 to 255) by multiplying by 4. The frequency is doubled for pin 26 by multiplying by 8.

    In reality, I’m actually taking advantage of the fact that “count” is a uint8_t – i.e. only an 8-bit value – and will automatically wrap around back to zero when the value gets to 255. So in the code, every time the actual “count” variable wraps (0 to 255), the multiplied by 4 version will have wrapped 4 times (i.e. 0 to 63 four times – well, actually it is going 0 to 255, but in steps of 4 at a time, so it will do that 4 times). Similarly the multiplied by 8 version will have wrapped 8 times.

    The code has to output these 64 values, 440 times a second, to generate the 440Hz saw tone – so 64 x 440 = 28,160 values a second. That means there is one value required every 35 uS or so. I use the ESP32 microsecond timer to manage this.

    uint8_t count;
    uint32_t timer;
    void setup() {
    count = 0;
    timer = 0;
    }

    void loop() {
    uint32_t newtime = esp_timer_get_time();
    if (newtime >= timer) {
    dacWrite(25, count*4); // Auto wraps at 256
    dacWrite(26, count*8); // Twice frequency of wrapping...
    count++;
    timer = newtime + 35; // 35 uS in future of last timer read
    }
    }

    MIDI Test

    The ESP32 Simple MIDI Monitor code can be used for a simple MIDI test. The code is configurable for either UART0 or UART1 (in reality mapped onto UART2 in the ESP32) for MIDI.

    In use, on reception of any NoteOn message the onboard LED will light up. Also, any MIDI data received over MIDI IN is software-THRU echoed to MIDI OUT.

    When using UART1 (UART2) then there will also be a MIDI message dump to the serial monitor.

    Closing Thoughts

    This board seems to work well. But I have a bit of a problem at the moment. There seems to be a problem with the current (at the time of writing) Mozzi library and the ESP32. There is an incompatibility with the I2S driver used for streaming data out to the DAC.

    So at the time of writing, as a Mozzi experimenter board, my options are a little limited. But as soon as Mozzi is updated to the latest ESP32 SDK I2S interfaces, hopefully I’ll be able to properly get going. Watch this space.

    Kevin

    #dac #esp32 #midi #mozzi #pcb #potentiometer

  29. I was able to repair my trusty Cyber-Accoustics 2.1 CA-3310 #speakers 🔈 💻 Its volume control was behaving badly and messed the #audio I had to redo the bottom cover of the right speaker, since the cover needs to be destroyed to access the main electronics (the main issue with the design).
    A clean #potentiometer and a bolted wooden replacement bottom cover did the trick.
    I used it several years, as its fits in my desktop.