• TalkBass has been independent since 1998. Add your voice.
    Create a free account to reply to discussions, view embedded media, and browse with fewer display ads.
    Join freeLog in
    Want zero display ads or expanded classifieds tools? Compare plans.

Natural tone preamp

Good to hear from you Charlie!

Thanks for the tip, I hadn't seen the 2145 yet. So a quick look at the datasheet shows a bit lower quiescent current, which is nice, a bit higher voltage noise, but much lower current noise which is probably dominant on a high-Z input amplifier. Looking forward to hearing about your experience in case you find anything else notable about it.

Hey Jeff,

I've finally been able to listen to and/or measure a couple of different builds with the OPA2145. It sounds good in my applications, shows exceptional headroom for a low current piece, and gets a big thumbs up from me so far. I'll be popping a new three band preamp in my #1 fretless, maybe as soon as this afternoon, and will go into long term test mode next.

I'm enjoying watching your progress, stay in touch if I can be of any help.
 
Last edited:
Hey Jeff,

I've finally been able to listen to and/or measure a couple of different builds with the OPA2145. It sounds good in my applications, shows exceptional headroom for a low current piece, and gets a big thumbs up from me so far. I'll be popping a new three band preamp in my #1 fretless, maybe as soon as this afternoon, and will go into long term test mode next.

I'm enjoying watching your progress, stay in touch if I can be of any help.

Thanks, I may take you up on that offer!
 
  • Like
Reactions: Passinwind
I think I have settled on the design of the analog circuit. It features four separate buffer circuits, each with an independent gain control. Each buffer has effectively zero load on the pickup (somewhere over 100 GΩ) so it should be able to take any pickup as input, including piezos.

After that there is a single inverting summing amplifier that has a master volume and a tone control. The tone should behave somewhat like a typical passive tone control with a smaller cap, but because of the way it is wired it is "no load" when off, meaning the response is perfectly flat. The final amp is just an inverting follower to provide the non-inverting output.

Below is a block diagram of the analog components. The pots are all 50K and the series fixed resistors are 5K-ish (gain of 5) as I haven't decided on the total gain yet. The cap is 0.01 uF which spice says should give about 600 Hz cutoff frequency at high gain and increasing as gain decreases.

Click on the image to make it a bit bigger/easier to read.

Analog Schematic.png
 
  • Like
Reactions: Jazz Ad
More progress on the LEDs. I purchased some loose low power LEDs and they were... not at all like the ones I was using for testing. Each LED has an onboard controller and the ones I tested originally with ran on about 300 uA when idle. That's only 20% of the 1.5 mA power budget so no worries. The ones that I just purchased ran at about 1100 uA, or about 75% of the power budget!

So I ordered some other standard versions and they were somewhere in the middle at 750 uA quiescent. Still half the power budget but workable.

So I coded them into the software. A configurable "default" color for the markers, with the option for a different color on some (like the octave markers). There is a bulb test when first powered on, then the default color. When a preset is changed the corresponding position marker temporarily lights up in bright white before fading back to the default colors. There is also a color changing battery indicator. The number of position markers, as well as the color of the markers, is used to indicate the state of the battery, or whether the battery is charging.

Which brings me to the next change: integrated battery charging. After the suggestion from @Jazz Ad to add a rechargable option I changed the power section to allow any excess energy from phantom power to charge the batteries. It is designed to work on 8.4 V NiMh batteries but is voltage limited to make it possible to keep alkalines topped up also.
 
  • Like
Reactions: Jazz Ad
Have you thought about using an 8x8 (or even 16x16) matrix switcher? Such as the Analog Devices ADG2188. I'm using one for an effects switcher and it's working great.

Yes, I did look at matrix switch options, actually I think it was the first thing I considered. I don't remember all the reasons I rejected the idea but it was one or more of:
  • Hand solder unfriendly packaging
  • Not rail-rail capable on a single 5 V supply
  • Expensive for the size of matrix I would need (at least 11 inputs)
Glad to hear the 2188 is working out for you!
 
  • Hand solder unfriendly packaging
  • Not rail-rail capable on a single 5 V supply
  • Expensive for the size of matrix I would need (at least 11 inputs)
I'll give you the soldering part. They are rated for 0.5 V below negative rail and 0.5 V above positve rail, btw, so more than rail to rail. Price is relative, of course. The sheer flexibility of routing, ease of control, and circuit simplification seems worth it.
 
  • Like
Reactions: Jeff Siddall
I'll give you the soldering part. They are rated for 0.5 V below negative rail and 0.5 V above positve rail, btw, so more than rail to rail. Price is relative, of course. The sheer flexibility of routing, ease of control, and circuit simplification seems worth it.

Yes, there are some chips that met most of the requirements, but none met all of them and so they seemed less good than just using SPST switches. Also, when you get above 8x8 the selection really starts to drop and the prices start to get crazy.

Flexibility of routing isn't really a concern. It all just gets mapped to a bunch of bitmasks in software no matter how the switches are arranged.
 
Update: I discovered the issue with the digital pots and it wasn't a damaged chip as I had suspected. Instead, it appears the SPI library defaults won't send CLK on an 8 MHz processor like I am using for testing. Once I changed the library settings to a lower clock speed things started working. Yay! Now I need to do a similar test for the switches and then wire up an analog test circuit to check all the core parts together, albeit with a simplified 2 coil, 2 op amp configuration. I will also need to finish the neck on my pickup mule and wire up some old pickups for testing. So yeah, it will be a while yet before I have any results to post, but when I do I will see if I can record some kind of demo video to give a flavor how all this will work.

After @JKos suggestion of looking at using a crosspoint switch I went back and revisited my switch selection again, but nothing much had changed in terms of part availability.

The 2188 does seem like the closest part to meeting my requirements, and looking back at it again an 8x12 matrix would be enough to do what I need in one chip. However, it misses a few other requirements. First, the 0.5 mm lead spacing would be tricky to hand solder, but the bigger issue is the power supply is a single +5 V, due to the microcontroller requirements, but the 2188 isn't specified to run off a single 5V supply. Also, while the absolute maximum ratings allow for analog signals 0.3 V above/below the supply rails, the specified operating analog signal range is only to Vdd−2 V. So, at least for now, the switches will stay as they were.
 
Another small update: I have finished the main development of the microcontroller code. Up to 545 lines now, excluding comments/blank lines, and [of course] took longer than expected. However, I think the results are worth it. New features added since the original design include:
  • Battery power option
    • Run on dual 9 V batteries -- either alkaline 9 V or rechargeable 8.4 V can be used
    • New "show battery" command added to the USB command line interface which will display the current battery voltage
    • New color coded purple/green/yellow/red battery voltage bar graph on the fretboard LEDs, displayed whenever the volume knob is increased from off. Purple indicates batteries are charging.
    • Automatic deep sleep mode when the volume is turned off for more than a couple of minutes, automatic wake up when the knob is cranked up.
    • Battery will be charged/maintained when plugged into a device which provides standard IEC phantom power
    • Battery runtime on 2x9 V should be about 4 days with LEDs off, 2 days with LEDs on and about 2 years in deep sleep
    • Battery power automatically used when required (auto switching)
  • Addressable LED support
    • Color scheme support with fully customizable colors
    • Separate brightness/color for individual LED indicators plus a background color with optional contrasting octave markers
    • Color scheme control uses same 2 knobs as pickup presets and can be changed while playing with no change to the preamp preset or volume
    • Preset number indicated with flash of corresponding fretboard LED when changed
    • Fade effect on most transitions so LEDs blend from current color into next. This looks cool, but was far more difficult to make look right at low brightness than I had expected!
  • New ATmega32U4 controller with integrated USB
    • Software automatically detects when USB port is unplugged from the computer and shuts down the USB interface to save power
  • New low quiescent switch mode power supply
    • Required to harvest enough energy to allow running LEDs but also enabled the automatic deep sleep mode
  • Automatically store/load presets from EEPROM
  • Added hysteresis to controls so vibrations or a small bump of knob will not change the current settings
  • Added preset activation delay so intermediate presets are not activated when jumping past them (ex: jumping from 1 to 3 will not activate preset 2 if it is done quickly)
This is all good in theory, but means I need some new components. Unfortunately the new power supply chip is backordered, as are the output capacitors, which need to be bipolar now that I added the battery power option. Without those I can't verify power consumption or battery charging.

In the meantime I am continuing to build a hand-wired prototype to prove out the rest of the functionality, but with some of the parts not likely to be available before the summer this whole project could get significantly delayed as I will move back into the garage to work on the wood and carbon fiber bits for several other projects. Hopefully I can get the prototype done, and video out, before then!
 
Jeff, what power supply chip is it and what are you current demands? For a recent DSP based project I ended up rolling my own little 5V regulator boards using more or less obsolete ones I found on eBay for little money. I might be able to send you one as a stopgap if the specs align.
 
  • Like
Reactions: Jeff Siddall
Thanks for the offer Charlie!

The part I am looking for is an AP63205:

Link Removed

In the world of low uA quiescent current, low noise, low component count high efficiency switching converters, it turns out there isn't a lot of choice. If you have some other suggestions I'll definitely look into them. Current requirements are moderate as it needs to run off 9 V batteries, so I sized the inductor for 200 mA, but most of the time it will run in the 10s of mA.
 
Last edited:
PCB layout mostly done now. Current dimensions are 24.8 mm x 74.9 mm, or just under 1" x 3" not including the USB header which sticks out a bit further. Total is about an inch thick, mostly due to the large bipolar output capacitors. I am considering an alternative part that doesn't seem to be as high quality but is 7.5 mm shorter.

Top:
pcb_front.png


Bottom:
pcb_rear.png


The microcontroller module will mount over top of the components in the bottom right corner of the top image:
Beetle (crop).jpg


The autorouter is still running. I guess I didn't give it an easy task on this one, but will post a picture of the traces once it finishes.
 
Update: I spent far too much time working on power management code and while the software finally does the fancy stuff I wanted, like restarting the USB interface after being in power down mode, the actual power numbers are dismal.

Without any power management the prototype board draws upwards of 50 mA, including 9 mA from one op amp. I will assume the op amp draw is high because I haven't hooked up most of the pins yet, so who knows what it's actually doing.

But the microcontroller is even worse. Active current is about 3 times higher than it should be and in the lowest power mode it is almost 1000 times what it should be. Instead of half a uA it's actually about half a mA!
supply_current.png


There are plenty of reports of counterfeit ATmega328 chips and what I am seeing is so far from the datasheet numbers that I am wondering if it is possible I have boards with fake ATmega32U4s. For now I have ordered some DFRobot Beetles as an alternative, despite the less ideal form factor. Since since they are available from big retailers (Mouser, Allied etc.) hopefully they contain genuine parts. Once I have tested them out I will know if the problem I am having is related to the low power library or the chips themselves. Sigh.
 
Last edited:
Update: I received my genuine DFRobot Beetle module order. Unfortunately only a bit of good news there. It does appear that the original CJMCU beetle I had been using for testing was drawing too much current, but it doesn't appear that it was because it was a fake but rather just defective. Some more testing using another identical board from the the same order used much less current.

The DFRobot beetle board current draw was virtually identical to the second module from the original order. Distressingly, the lowest I could get them to go in power down mode was about 60 uA. Add to that the power supply and other component losses and battery life would be just over a year when when idle. Not great. Some reading found others having the same issue but no resolution. Hmmm...

So I ordered yet another microcontroller, this one based on a SAMD21 chip. We'll see if 3rd time is a charm!
 
Good news: despite initial issues, I finally found a way to get decently low active current on the new microcontroller:
Seeeduino-XIAO-preview-1.jpg


These are available at a pretty reasonable price from Mouser, DigiKey etc:
Link Removed

The always-on power LED is really the only thing wrong with this board for this project. There is no way to disable that in software, but a minute with a utility knife took care of it. Everything else I like:
  • Tiny! (about 0.75" square)
  • Shielded
  • Integrated USB C port
  • Fast 48 MHz ARM Cortex M0+ CPU
  • Modest 29 uA sleep current
  • CPU has clock divider so speed can be dropped down when USB is disconnected
  • Relatively low 1.7 mA steady state current
With the step-down converter, and without the programmable LEDs, a pair of 9 V alkalines should last through about 300 hours of play time and about a year and a half of standby. With programmable LEDs running at moderate brightness the playtime should still be over 60 hours.

Of course, if plugged into a phantom source under the same conditions the batteries will stay fully charged.

There are significant software changes required to get power consumption as low as possible, including a non-trivial CPU speed governor, but it looks possible. Other more trivial changes are required around interrupts, pin mappings etc.

Then there is a new PCB layout because of the different footprint. I needed to create a new package because the manufacturer provided footprint is for surface mounting, but to minimize space by allowing components to be surface mounted underneath the module, it needs to be mounted on risers. This one has really taken on a life of its own!

Anyway, with a solution found I can get onto finishing the prototype board and then the on to pickup mule bass to put it into!
 
Last edited:
A bit more progress while TB was away: I finally got my parts order placed. The one switching regulator I really needed for this build finally came back in stock and even though chip shortages were conspiring against me, with many other misc parts going out of stock in the mean time, I was able to find substitutes for everything else and get the order in. Oddly, they said it would be delivered yesterday, which seemed optimistic. I just checked and it is still in Memphis with no estimated delivery date now. Oh well, I don't have any time constraints for a this project so I can wait a while longer.

I had originally planned on only shutting down the op-amps in power saving modes, and doing that using a ground-lift MOSFET. However, upon further consideration I realized that won't really work because the ESD protection diodes will cause any pins with a ground path to become power sinks for the device, thus effectively preventing the device from being turned off. Then it becomes a slippery slope of how much stuff you can power down without putting any device out of spec. Connecting 5 V devices to a 3.3 V MCUs also adds headaches there. I considered various power control chips but ended up deciding that shutting down the switching regulator 5 V supply entirely, and then only powering the MCU, was really the best way to get the lowest standby current while also minimizing the number of things that have to be controlled in standby state. Of course, that required another power supply, but I found a low quiescent linear device that should work well.

After solving all that I managed to get the prototype mostly assembled from parts on hand. The analog side isn't wired yet but the digital stuff is now done. After after much debugging, the pots, switches and LEDs are all playing nicely together. There were so many things to work out along the way, but I won't try to detail them. Here is the mostly finished board, including working LEDs (though a bit hard to see):
20210405_005327.jpg


I will move onto testing the power section once all the regulator parts arrive. I need to decide soon whether I am going to continue to try to hand wire all those parts or just order some PCBs. I will almost certainly need to make some changes to the initial board design, and the minimum quantity of 3 boards means 2 of them will probably go straight into the trash, but it would be a lot easier than trying to hand wire a bunch of SMD devices. Hmmm...
 
One somewhat unexpected discovery in ordering parts is that the guitar pots (longer bushings) which I wanted aren't readily available in 1M linear versions. That left me with a choice of using a more generic linear pot, or "fixing" the taper in software. To figure out how to do that I made some measurements of an actual pot, by attaching a protractor template:
20210411_203830.jpg


Then created an antilog algorithm to reverse it back to linear:
bourns_a2_tapers.png


The purple points/lines are measurements of the Bourns A2 pot, and the green line is the antilog software model of the pot. I tested it out, and even just a simple 2 segment linear fit works great. Nice progressive linear motion across the wiper range.

I also developed a custom volume S (or W) taper, where the top and bottom 30% of rotation adjusts about 10 dB at the quietest and loudest ends of the range, and the middle 40 % covers the remaining 24 dB. The result is more precise control over the first third of the volume control range. Now to test it out and see if I like it.

One thing I was concerned about from early on is that the digital pots only have an amplitude control range of about 48 dB. This is notably less than what is theoretically possible with a manual pot. However, if you look at the data points (the "+" symbols) in the plot above, the first non-zero measurement is only a 10 degree rotation from zero (equivalent to 3% of the rotation range) but that works out to a level jump to -43 dBFS, so pretty comparable. You would have to be extremely precise with your volume knob adjustment to get something quieter than -48 dBFS but not actually off.