Jump to content

digital attenuator


kevin gilmore
 Share

Recommended Posts

On 3/20/2017 at 7:23 AM, Kerry said:

I've got my controller boards working pretty well now with the digital attenuators.  I like the larger one because it has a really nice feel as you turn the volume knob (...yes I see it :P).

I went and added a USB input to the board itself, though this is really overkill - which is why I did it.

IMG_0315.thumb.JPG.0d463cef57a0e76e4e32c49ab3835d8b.JPG

 

Here I'm updated with the TX / RX LEDs blinking away.

IMG_0313.thumb.JPG.f843a2dd0446734d726b1df0d22eb590.JPGIMG_0314.thumb.JPG.49108924af68518ce41335f0f66addb4.JPG

 

EDIT: I've got to do one more round of cleaning...

Hey Kerry - Just wondering, what motorised encoder/pot are you using? I tried googling the # on the sticker, but didn't turn up anything >< Putting my BOM for the boards together now :)

Thanks mate.

 

edit: I’m going with this one in case anyone else is interested, https://au.mouser.com/ProductDetail/688-RK16812MG099

Edited by Aive
Update
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • 11 months later...
On 6/16/2019 at 4:54 PM, sbelyo said:

I wouldn't mind doing a run for all the boards needed for a complete system with volume control and source selection.  I know Kerry was working on or has code for the volume control

Any plans for a group buy?

Any bare or assembled boards available for sale?

Anyone has an updated BOM or are any of the parts unavailable by now?

Edited by starcat
Link to comment
Share on other sites

Preparing 4 layer board out of the 3 layer attenuatorsmtv42flipground7.zip as follows. Any other tips that I should take care for, like impedance controlled PCB? 

Going with thickness of 1.6mm and 1oz copper for the top and bottom layers and 0.5oz per each of both mid layers. 

 

screenshot_22.thumb.jpg.d27834473f301a6685240e4bdf0d8f32.jpg

Link to comment
Share on other sites

  • 6 months later...
On 8/16/2011 at 11:45 PM, Kerry said:

Here's the code I used for the rotary encoder and the Uno board....

 

On 8/24/2011 at 2:41 PM, stv1756 said:

Here is code to control two attenuators (i.e. balanced) with a potentiometer. Wire pot pins 1 and 3 to 5v and ground, and the wiper to A0 (analog input 0). Should work for a single board as well. For balanced configuration jumper id pins 1 and 2 of the second board (to change the address). Based on the code previously posted by Kerry....

 

On 3/19/2017 at 4:40 PM, Kerry said:

Here's the code.  Just rename the PDF to Zip and expand it into a folder under your .../Documents/Arduino directory....

 

Blast from the past! After 10 years, I finally managed to build two v1.0 of these boards. A couple of questions, if anybody is still familiar with the project....

I have used the original code from @Kerry the get the relays clacking away with an encoder and Arduino Uno, I just needed to replace the deprecated wire.send with wire.write. But I really want to use a potentiometer. The code from @stv1756 won't build (incompatible types in assignment of 'int' to 'int [12]'), and it seems like Kerry's 'all in one' code is more advanced - but I'm not nearly clever enough to work out how to configure it for the v1.0 boards.

I can work out how to disable the OLED (comment out "active OLED = .... lines), but I'm still throwing compile errors (flexible array member 'Font::_data' not at end of 'class Font') which suggests it is still trying to include a display, and I'm obviously missing several configuration options.

Anybody got any hints, or known-good code that works with v1.0 and a potentiometer?

Relay Attenuator.jpg

Edited by Beefy
Link to comment
Share on other sites

It's been a while since I looked at this, but I'm pretty sure there are just parameters you can set.  There should be some comments in the code for SPI vs I2C and you should set the version down to 1.0 or something like that.

I don't have time now to really jump in deep to this, but good luck :) 

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Kerry said:

It's been a while since I looked at this, but I'm pretty sure there are just parameters you can set.  There should be some comments in the code for SPI vs I2C and you should set the version down to 1.0 or something like that.

I don't have time now to really jump in deep to this, but good luck :) 

Luck is usually all I've got going for me! But I think I have worked it out. I can get a successful build with the all-in-one code in your post from 2017/3/12 using Arduino IDE 1.8.19. My only concern is some very unpleasant turn on/off behaviour. My relays all seem to mute on power down, but then first volume movement on power up temporarily opens full signal volume before settling down. I suspect this is something on the volume board themselves, rather than the software issue.

 

In any case, I have it set up with:

10k linear pot connected to A1, 5V and GND

 

Within VolumeController:

Line 101 and 102 both commented out; doesn't change anything, but keeps the program smaller.

Line 127, dattnActive = dattnv1 to set it to the V1 board. Not even sure this is necessary, but it works.

Line 147 myPot.setMinMax(0, 255); needed to allow 255 steps for maximum volume

 

Within DATTN.cpp

Line 105, vSet = 255 - v; needed to allow 255 steps for maximum volume

 

Within font.h:

Line 26 "unsigned char *_data[];" this is the only line that really stops it building, and can just be commented out.

 

Within rotarypot.cpp, some parameters need to be tweaked to give faster volume control. Otherwise, small volume changes take an excruciatingly long time with very gentle pot movements. Zero idle relay chatter with these aggressive settings, surprisingly enough. Currently I have changed:

Line 17 maxValue = 255

Line 21 potChangeThreashold = 1

Line 22 potLockThreashold = 5

 

Now, I just need to test balanced configuration. Seems to be just a change on line 126, from false to true:

dattnV1 = new DATTN(1.0, true);

Edited by Beefy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...