Go Down

Topic: Virtual, variable resistors, with saved presets recallable by MIDI (Read 9681 times) previous topic - next topic

allanhurst

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

Note use of a TLC2262 opamp

Allan

Stoopalini

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.

Stoopalini

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.





Stoopalini

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?

allanhurst

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


Stoopalini

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 :)

Stoopalini

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.

allanhurst

What psu are you using for these tests?

The ardiuno 5v has a limited current capability if powered from an external higher voltage via vin...


Allan

Stoopalini

Further reading tells me that chips like the MAX7219, and similar, cause fluctuations in the 5v reference signal, and that must be what's happening.  So the analogReads of the POTs are moving around because the 5v is fluctuating.  

To test it, I ran the ardunio off of USB, and then used my 5v power supply to power the breakout box with the display and rotary encoder in it.  I connected the 5v from the breakout box to the 5v of the separate power supply, and then connected the GND of the separate power supply to the GND of the arduino.  

This worked, and the problem is gone.  

So is there anything I can do to help with the noise?  pull up resistors on the SDA and SCL lines maybe?  Or capacitors in the 5v feed to the display?  I would try these just to see, but I'm not sure how to size the resistors and/or caps properly.


I was typing the above when you replied .....


What psu are you using for these tests?

The ardiuno 5v has a limited current capability if powered from an external higher voltage via vin...


Allan
I'm just plugged into the USB port on my computer.  So not feeding in through Vin or the 5v pin.  Direct to the USB port.

Stoopalini

Ok, so maybe this won't be an issue. 

I just tested, using a 9vdc wall-wart through a 7805 transistor, and hooked the output of the 7805 up to the Arduino's 5v pin, as well as the display breakout box.  And it's stable like this. 

So it appears it's probably related to being powered off the USB port.  When I've measure the USB port voltage in the past, it's always around 4.5v - 4.6v.  Maybe it's not enough, or it can't keep up when the display is connected?

So when I build the power supply you designed for the device, I may just add a 7805 into the 9v supply lead, dedicated to feeding power to the breakout box.  Just to further isolate the LED driver chip from the Arduino's 5v reference signal. 

I guess the past couple days of learning about power supplies is starting to pay off :)

Later tonight I may try dual 7805's:  one for the breakout box, and one for the Arduino.  Then also have the effect pedal Y'ed into the same wall-wart ... just to see if it helps with the audio noise.  I doubt it, but I've got the parts, so worth experimenting. 

Grumpy_Mike

Quote
through a 7805 transistor
A 7805 is not a transistor it is a voltage regulator. You must use them with a capacitor on the input and the output.

Stoopalini

A 7805 is not a transistor it is a voltage regulator. You must use them with a capacitor on the input and the output.
Thanks .... I knew it was a voltage regulator, but mistakenly thought it was a transistor. 

I tried using one with a .1uf ceramic capacitor at the output and a .047uf ceramic at the input, but I still get the fluctuation in the 5v reference signal when the display is connected.

I know the .047uf value one should be .33uf, but I had these caps left over from a previous project so gave it a shot.  I have some .22uf electrolytic caps here too.  Should I try placing one in parallel to the output?

The rest of the components for the power supply Allan recommended will be here today, so maybe this testing is all a moot point anyway ... although I am learning quite a bit through the process.

Stoopalini

I got the power supply circuit laid out today.  470ohm resistors was butting out around 4.4v.  I tried 330ohm, and it was around 4.7.  I ended at 220ohn resistors, and it's at 4.95v.

This is without any load though.  So after I get a chance to connect it to the Arduino, I'll test again.  The big test will be if the noise is removed ... I'll know soon enough!


Thanks so much Allan!  Really appreciate you drafting this up for me.

Here is what I built:




And here is how it laid out on the breadboard.  Now I just need to get it soldered up so it'll fit inside the pedal.



allanhurst

The load should make almost no difference up to >100mA load.

The voltage change you see is down to the highish dynamic resistance of a zener.

A TL431 would be better.

But it'll do.  +/- 10% is good enough .

Allan

Stoopalini

Well, the circuit completely removed the noise!  

The display still causes wild fluctuation in the analog POT readings though.  So I put a 7805 in parallel to the incoming 9v (with some .1uf capacitors), and connected the breakout box's 5v lead to it (the button on the rotary encoder and the display are both running off of it) and it resolved the issue.

So it's quiet and stable now!  

Basically I did this, using the 9v supply POS and NEG leads:



Would it be a better idea to try and solve the issue without the regulator though?  Maybe an electrolytic cap between the 5v and GND buses?  Or should I just stick with the 7805 and use it for just the display?


I've also been working on the display.  I have it coded to show the analog POT values when turning one of them, and give an indication if the current value is above or below the currently recalled preset value.  So when recalling a preset, if I want to make a fine adjustment, I can turn the knob and get visual feedback as to where the saved value is.

I plan to work on having the Digi-POTs not change value until the analog POT crosses over the currently recalled value.  So if I'm doing this live on stage, it doesn't blast at 100% if I move the knob with the POT located at 100% but the recalled value is only 30% or so.  This will also help protect against any electrical anomalies which may cause the POT readings to go erratic again.


Go Up