Arduino based LDR volume and source selection controller

Teensy based

Couldn't resist to build one with a Teensy:

  • 4 PWM channels up to 16bit
  • Easy Arduino IDE integration
Using the same 5V supply for both, Teensy and relays. But I kept the 12V design for the LDRs, as my amp's supply has a 12V, anyway. The FETs are TN0604.
Can't wait to try it :D


Thanks to all those who contributed so far!
 

Attachments

  • 20210912_154446.jpg
    20210912_154446.jpg
    119.9 KB · Views: 501
@fvzeppelin this looks amazing! Were you able to test it yet? :D I was actually curious as to what it would take to create a version of this using the Raspberry Pi Pico and implementing the code in either CircuitPython or MicroPython.


Thank you :) The attenuator itself works great :D Nevertheless, my system still has a light hum issue and I haven't found the time yet to fix it :mad:

Thinking of your idea, the first thing that came to my mind besides the re-programming, is the 3.3V IO voltage of the Pico: I guess it would require different FETs and resistors.
 
So I tried to use the code from Github and it compiles nicely, but when i try to upload the code to a brand new arduino Nano I get this error message:
Arduino: 1.8.16 (Windows Store 1.8.51.0) (Windows 10), Board: "Arduino Nano, ATmega328P"

Sketch uses 26504 bytes (86%) of program storage space. Maximum is 30720 bytes.

Global variables use 1329 bytes (64%) of dynamic memory, leaving 719 bytes for local variables. Maximum is 2048 bytes.

An error occurred while uploading the sketch

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x11

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x11



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


What is this and how do I fix this?
 
I got the code uploaded to the Arduino Nano , but it doesn't work in the board.
Wisely I kept the original Arduino Nano with unchanged program code , and it works fin.

The new Nano puts out error 20 and the led stays red on the Nano (it turns green on the original)

It tells me that there is something wrong with the code , right?
Unfortunately I cannot find the code I originally used for the Nano. It has been deleted somehow ;-(
Any suggestions?
 
It still puzzles me what the problem was with the code from GitHub. It is the code there is something wrong with, because I found the original code, that I used on the original Nano on an old harddisk and uploaded that , with the modifications I wanted, to the new Nano, and this works perfectly---- No error 20!
 
It is annoying when apparently identical code won't work:confused: Pleased to hear you were able to resurrect the old code, make changes and get your board working ok.

One thing I found after migrating from the Arduino app over to using PlatformIO/Visual Studio Code was the benefits of its integrated capability for using GIT archiving and the ability to link to Github. If your code gets messed up it's quite easy to revert back to the old code or to compare old to new. It's well worth looking at it.