Virtual, variable resistors, with saved presets recallable by MIDI

Well it might work but it is not isolated is it.

Nope - but it positions everything round the centre-point of the audio electronics supply , so should be OK.

If one could identify the internal '0v' , you could use a couple of 2.5v references (TL431's?) round that to get the arduino's 5v - that would be a better approach.

But I think it'll work.

Allan

Thanks for this Allan. I'm stuck on one wall wart due to wanting the design to be usable for other pedals as well. This is mainly my "proof of concept" to design a solution for adding MIDI to any effect pedal which uses analog POTs to control parameters. Most pedals use 9vdc, although some use 12v and even 18v. I'm keeping the scope here to the 9v ones though. So having the circuit not require an additional power supply is very desirable.

I have the resistors and the diode, but I don't have an opamp on hand right now to put this together. I can certainly order one though.

The diagram makes sense to me, except for the following connection points:

  • Does point #1 remain "floating" (ie: not connected to anything), or do I need to find the artificial ground within the pedal's PCB and attach it there?
  • Is point #2 a connection point, or is it just the line extending on the drawing?
  • Where do point numbers 3 and 4 connect on the pedal PCB?
  • I'm assuming point 5 is the "5v" pin on the Arduino, and point 6 is the "GND" pin on the arduino, correct?

Thanks again, this is very appreciated.

The diagram you post is probably the easiest - the opamp is my guess at what's inside the pedal - you don't need another one! Note the box saying 'pedal audio electronics' . All inside that is my guess.

Points 1 and 2 are the (guessed) internal mid-rail supply generated within the pedal - it's '0v' reference.. They're not really floating, as they're derived from the 9v supply.

3 and 4 are the internal + and - supply rails within the pedal. 5 and 6 are as you say.

My diagram pedal3 in the next post makes these points clearer - but you can get away without the external opamps.

All you need are the bits ouside the pedal - the 2 digipots, 2 resistors , a 5v zener diode, and of course the arduino . You may be better using 2 220's or even 100's - I'm not sure of the arduino's consumption.
Adust so you get a steady 5v across the arduino.
Allan

Ahh, ok ... got it. I thought that represented the pedal enclosure, but I understand now you mean the existing electronics on the pedal's PCB.

So essentially, it's dropping the voltage from 9vdc to ~5vdc by splitting the drop between the 9vdc + and -, thereby keeping the center, well, centered. If that statement makes sense, then I guess I understand the concept here.

I'll also venture a guess that after I add a display (currently planning for a two or four character 7 segment display), I'll need to recheck the voltage due to the increased load, right?

I'll give it a go and let you know.

Thanks again!

I think you've got the idea... good luck.

LED displays take a fair bit of current - maybe a LCD?

Allan.

allanhurst:
My diagram pedal3 in the next post makes these points clearer - but you can get away without the external opamps.

Sorry, I just saw this. Don't know how I missed it.

Could I use a single LM358P (dual opamp) for both sides?

LM358P Datasheet

allanhurst:
LED displays take a fair bit of current - maybe a LCD?

I looked at an LCD, but am space constrained. I really only need 2 characters to display the preset number. Do you know of a small LCD which plays nicely with Arduino? I saw the 128x128 ones, but they're too big.

If you only need 2 digits, how about a small 2-digit seven segment display?
Sparkfun carries this little 4-digit bubble display, I use 2 of them on this 8-digit display board

1/ You don't really need opamps - it just takes the guesswork out of finding r3,4 values.
2/ A LM358 won't quite do - you need a rail-rail opamp.
3/ If you intend to use high current displays, opamps would be a good idea - but be sure they've got enough drive capability.

LED display - the worst case is displaying '88', with 14 segments on. Allowing 5mA each that's 70mA - more than most opamps can handle..

But, of course, you could drive them directly from the supply with suitable drivers.....

I'll have a ponder...

Allan.

Just saw your post , crossroads - neat little displays. But this is (I think) next to his pedal - 4-6 feet away? so perhaps too small - and of course the reading angle is limited.

CrossRoads:
If you only need 2 digits, how about a small 2-digit seven segment display?
Sparkfun carries this little 4-digit bubble display, I use 2 of them on this 8-digit display board

Ya, that's very similar to what I was planning. a 2 digit, 7 segment display, which operates on SPI. The problem is I can't find a 2 digit one. I found some 4 digits ones though.

Do you know of a 2 digit, 7 segment display, that works with SPI? One design constraint is I only have 8 wires to go between the Arduino and the breakout box, which is where the rotary encoder with push button and the display goes.

Rotary encoder/push button needs 5 wires: Vcc, GND, 1 data wire for button, 2 data wires for rotary encoder.
7 Segment display, with SPI, needs 5 wires, but only 3 additional: (Vcc and GND shared with rotary encoder) then SCK, CS and SI.

Here are 4 different sizes of 2-digit displays, 0.3, 0.4, 0.56, 0.8 inch:

Add MAX7219 to make it SPI.
It's available SMD & thruhole, I don't about SMD except from Digikey/Mouser

allanhurst:
1/ You don't really need opamps - it just takes the guesswork out of finding r3,4 values.
2/ A LM358 won't quite do - you need a rail-rail opamp.
3/ If you intend to use high current displays, opamps would be a good idea - but be sure they've got enough drive capability.

LED display - the worst case is displaying '88', with 14 segments on. Allowing 5mA each that's 90mA - more than most opamps can handle..

But, of course, you could drive them directly from the supply with suitable drivers.....

I'll have a ponder...

Allan.

Ok, I'll give it a shot without the opamps 1st. The diodes I have are rectifier diodes, so I'm ordering some 1N4733a diodes. I figure I'll add some opamps to the order, just to have them on hand if I need them. If the LM358 doesn't work, can you suggest one that would?

As you can tell, I'm a bit over my head when it comes to power supplies ... but learning.

allanhurst:
Just saw your post , crossroads - neat little displays. But this is next next to his pedal - 4-6 feet away? so perhaps too small - and of course the reading angle is limited.

Exactly. The device will be on my pedal board, on the floor, while I am standing. Typically in a poorly lit environment as well. And to boot, I am color blind :stuck_out_tongue: (my 10 year old daughter has to help me with resistor identification LOL) This is why I was looking for a 2 digit, standard size, 7-segment display. But a small LCD would work too, if I can find one that fits.

BTW: Can I just say the "one post per 5 minute" rule on this forum is extremely annoying....?

CrossRoads:
Here are 4 different sizes of 2-digit displays, 0.3, 0.4, 0.56, 0.8 inch:
7-Segment Through-Hole Display, 2-Digit 7-Segment LEDs

Right, I actually have some 1/2" ones on the way already. It's the SPI interface I was struggling with.

CrossRoads:
Add MAX7219 to make it SPI.
It's available SMD & thruhole, I don't about SMD except from Digikey/Mouser
https://www.digikey.com/products/en/integrated-circuits-ics/pmic-display-drivers/729?k=max7219

Great, thanks! I should be able to fit this into the breakout box. Any idea on the mA draw of the MAX7219 and 2 7 segment displays?

A beefier psu capable of at least 100mA is enclosed.

Note use of a TLC2262 opamp

Allan

pedsup.pdf (22.5 KB)

Fantastic, thanks Allan!

In trying to determine total mA draw, from what I can tell, I would have:

  • Arduino Nano = 19mA
  • Two MCP41100 Digi-Pots = I think they're 1mA each based on datasheet, so 2mA
  • One 4N35 Opticoupler = Nt sure how to figure this one, or if I even need to
  • One Rotary Encoder with Push Button = 1mA
  • Two 100k Analog Potentiometers operating at 5v = .5mA each (if I did the match correctly), so 1mA
  • 2 Character 7-Segment Display w/ SPI Control = looks like 30mA using the SPI capable Sparkfun 4 digit, 7-char display specsheet

so if I'm understanding this correctly, I shouldn't really be pulling anymore than 60mA, and therefore 100mA capacity will be just fine.

Quick update before I head to bed ... it's finally free from the breadboard!

The 1/8" jack is the MIDI input, D2 and D3 are the rotary encoder inputs, D7 is the rotary button's input, A2 and A3 are the analog POT inputs, then the six wires on the left side are the Digi-POTs outputs.

The two bare wires sticking out of the side at the RX0 and RST pins are from the RX0 pin and the MIDI input signal. I have a "normally closed" momentary switch I connect to it, so I can hold the switch to disable the MIDI while I upload new code to the Arduino.

The power supply parts should be here tomorrow, so hopefully by the end of the weekend, I'll have it fitted into the enclosure.

My plan right now is to cut a hole in the pedal enclosure's side so the USB jack is accessible, drill a hole for the 1/8" jack on the other side of the pedal, fit an RJ45 jack somewhere on the pedal's enclosure for connecting the breakout box, and then drill another very small hole with the momentary button mounted behind it, so I can use a pin to push the MIDI serial disconnect when an update is needed.

allanhurst:
A beefier psu capable of at least 100mA is enclosed.

Note use of a TLC2262 opamp

Allan

I received the power supply components today, just one question: Are the R1 and R2 470ohm resistor values critical? Unfortunately I don't have any 470 values, and to run some in series would be 5 resistors (220 + 220 + 10 + 10 + 10).

I have 10, 100, 220, 330, and then 1k plus. Hopefully, I can use 330 or 1k, as I'd like to keep it small. But if I need to string some in series, can I get away with just 2 of the above values?

Abolutely not!

as I earlier suggested , so long as the two are the same it'll be OK. Suggest 330's. Not too much higher as most zeners are specc'd at 5-10 mA

Allan

Ok great ... thanks. And just to be clear, I'm going with the "pedsup" design you posted last, for the 100mA capability.

I ordered the parts yesterday, but unfortunately I missed the fact that one transistor is a NAP (BC337) and the other a PNP (BC327), and I had just ordered the BC337 ones. I just placed another order though for mounting hardware, header pins, etc ... so I added some BC327's to it. I also added some 470ohn resistors, just in case it was critical.

I did get the 7-segment display today though, so at least I have something to work on while waiting :slight_smile:

I got my display in today, and I got it working ... although it's causing some strange behavior. I think it's related to the level of current it's pulling.

I got an Adafruit 4 character, 7 segment display with backpack. I have it connected to 5v, GND, and then the SDA lead to A4, and the SCL lead to A5.

I'm displaying the preset number on the display using the Adafruit_LEDBackpack library.

The display is working, but if I display anything greater than "1", the readings from my analog potentiometers (attached to A2 and A3) start to fluctuate wildly.

When those readings change, it triggers a function to update the values in the program, so these 2 functions (one for each analog POT) are triggering constantly.

How can I stabilize the power system with the 7 segment display attached? Do I need to look at trying to stabilize the draw the display is creating, or do I need to go after the analog POTs and somehow stabilize them?

The analog POTs have 5v on H, GND on L, and the wipers are connected to A2 and A3.

For testing purposes, I currently have the Digi-Pots setup with 5v on H, GND on L, and the wipers connected to LEDs. The other side of the LEDs run through a 1k resistor to ground.

I even tried disconnecting the LEDs to see if they were causing the issue, but the functions continue to run constantly so long as the 7 character display is attached.

To verify the issue, I displayed "0", and let both functions repeat constantly (watching in serial monitor). Then I disconnected the GND wire to the display, and everything stabilized; but of course I lost the display.