Virtual, variable resistors, with saved presets recallable by MIDI

He recomemded to try upping the input voltage to 12v, and using a 7809 voltage regulator for supplying 9v to the pedal's PCB and a 7805 to supply 5v to the Arduino.

I can't see how this would help with the problem at all from what you have described.

Googling "isolated DC to DC Converter" is coming up with lots of results. Is there an IC I could use for this, or is it more complex than that?

It is not just an IC but a method of designing the circuit and normally involves a transformer. You can buy ready made isolated DC-DC converter modules, the main consideration / cost being how much current you want to draw from it. Your peddle should not take too much current.

Much cheaper is two mains supplies which are isolated from each other by default. That is to say that all mains power supply are isolated from the mains and so will be isolated from each other. If you only want one lead then connect it to two converters inside the box.

OK - if you're determined to do it with one wallwart, the enclosed should work ..

Values for R3 and R4 might be a bit high - check for 5v across the arduino ( use the 5v pin) .

They must be equal.

regards.....

Allan

pedal.pdf (21.3 KB)

Just to make things a bit clearer....

Allan

pedal1.pdf (21.3 KB)

or if you want to be posh... the opamps must be rail-rail ...

Allan

pedal3.pdf (22 KB)

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.