DIY controllers

Looks like a damn bop-it

image

Huh… i wonder if a bop-it has been made into a midi controller.

2 Likes

I had no idea what that meant so I looked it up on Wikipedia. Then I went to YouTube and found this highly topical video.

5 Likes

From last time we talked Bop-Its, I give you:

(He takes a small one apart in the “making of” video, in case anyone wonders what’s inside. Should be really easy to MIDIfy.)

Related:

5 Likes

JoeJoeJoeJoeYorkshire puddingJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeYorkshire puddingJoeJoeJoeJoeJoeJoeJoeWar of the RosesJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoeJoe

2 Likes

I often prefer to see the non optimiesd code, you see exactly what NEEDS to be done without any fancy stuff arround it.

It’s a common frustration of mine that many EXAMPLES are too meaty and try to show too much in a 1st sketch…

I like the control.surface 1st sketch.


#include <Control_Surface.h>
`USBMIDI_Interface midi;
CCPotentiometer pot = { A0, MIDI_CC::General_Purpose_Controller_1 };

void setup() { Control_Surface.begin(); }
void loop() { Control_Surface.loop(); }


This thread has helped my understand a few of the questions I had in my head about the library. Mainly running multiple muxes…

This is my re-purposed desk going into QLC

5 Likes

Can I use the 74HC4051 also for push button input or would that be stupid?

Also, would a nano be able to read 24 potentiometers, ~12 buttons, an encoder, a display and still run something similar to the 8 step sequencer + a quantizer code or is that too much for that little chip?

That would need the two hardware interrupts for the encoder, the timer for the PWM for the CV out. Clock in should also use an interrupt, right? Then it would already be too little…

2 Likes

The 4051 could be used, they only thing you have to be aware of is it can’t read two buttons at the same time. so you could not say do an if statement to compare to buttons.

I tried using an interrupt for clock in, but it suffered from bounce in my experiment. (but I was just pressing a button).

Sams code does not use interrupts.

instead just loops waiting for a state change on a digital read.

So that means you only need the interrupt for the encoder.

the display can use i2C

The encoder could use i2c as well which may make life easier…

3 Likes

I found the 74HC 165
in another circuit for reading buttons (Kassutronics Quantizer), It is a bit cheaper than the 4051, any other pro’s or con’s?

Yeah, the display will be i2c or 7 segment display(s) via a shift register…
Rotary encoder via i2c would be very nice! But those are on a tiny pcb and I would like to put them on my “main pcb”… so I need to look if I can reproduce their circuit (it uses some kind of microcontroller to convert to i2c, I assume?)

2 Likes

Why use a shift register when you can use a multiplexer?

1 Like

That is what I am asking, but the other way round :grin:
I think the shift register might be better, because I can chain a lot of them together and still only use 5(?) pins on the arduino, while with the multiplexer I have to add one pin per multiplexer (per 8 channels, because I found larger multiplexer only in smd format so far).
But I have never used either of them, so I am asking :wink:

3 Likes

Using shift registers lets you sample all buttons at once, instead of polling one button at a time. And unless I’m missing something, you only need 3 pins (LOAD and CLOCK as outputs, DATA/QH as input).

Having all the buttons as bitmasks also makes debouncing & deglitching easy, if you want to do that: use a timer to sample all buttons every N ms, store the bytes in a circular buffer, and & them all together when you need to check the current (debounced) value.

5 Likes

If you are already using a nano, i have not had any latency using mux. Using the Control_Surface lib handles any de-bouncing of digital inputs, and filtering of analog inputs and is really simple to setup (see earlier post i made).

I use a 74HC4051 8-channel mux:
https://www.taydaelectronics.com/cd74hc4051-74hc4051-744051-ic-8-channel-analog-multiplexer.html
image

You also can share the address lines, which lets you piggyback off of the same address select pins, you output each mux to a separate pin of the nano, but the address select is shared. You just need to make sure you use analog with analog and digital with digital when you chain the mux to the same bus.

You can also use shift registers with that lib, and i have done the same. It also does the heavy lifting for you. What i dont understand is why you would use a shift register over a mux in this use case. Unless you dont plan to ever use analog inputs/outputs.

If you are handling only digital data and you really need those pins maybe i can see doing it, but the nano has more than enough pins to support most diy controller projects, and supports analog inputs as well.

It takes like 7 digital pins to start using this setup, and +1 digital pin per input (pin 3 on mux). That will support 48 analog inputs, or 104 digital inputs (using the analog pins as digital).

Maybe people need more than that, but im good with that so far.

3 Likes

Muxes may be faster at Random Access (when you want only one button at a time), but when you want all the buttons states, it will be the same speed as shift registers.

For digital applications you may want to use a dedicated digital multiplexer, by the way (the 74HC151 for example).

You can also use IO expander, like the MCP23x1x series (MCP23S18 would be nice for buttons). They offer 16 I/O on SPI/I²C, and already have Arduino libraries for them.

And if you want to be extra fancy, you can use a dedicated debounce IC, like the MC14490!

3 Likes

just ordered a couple of these…

3 Likes

Let me know how it goes, i will report back with my method with the MCP23017. :slight_smile:

3 Likes

Yeah, hopefuly get them sooner rather than later.

1 Like

They arrived last week, had a bad start as the board markings threw me off in terms of the wiring. But got there in the end and managed to get two encoders working on the I2C on different addresses.

The code to use them seems a bit wastefull, or at least my interpretation. I could not find an example of using multiples so just had to duplicate all the functions with different names. maybee it’s possible to slim it down but I am not a “C” expert. Will post up the code this evening.

2 Likes

yes they are on internet and I have tried some , with success

1 Like

Found a snippet of code down a rabbit hole from the designer that shows multiple encoders in use. I have a lot on tonight but I will try and use that code to get a better working example, and if it does I will order more. ( was a bit slow mind, and did not respond to my question)

1 Like

I want to add multiple rotary switches (not encoders) into my Arduino project and I am now thinking if it would be better to use voltage dividers with analog inputs or digital inputs with shift registers. I want to have 8 switch positions and probably 16 rotary switches. So far I am leaning towards analog multiplexers, which means a lot of resistors (resistor arrays?) instead of many shift registers, but I would like to hear your thoughts :slight_smile:

3 Likes