Categories
Raspberry-pi

TDA7439 drived with Raspberry & Nodered

In the follow a way to interface TDA7439 to a Raspberry drived from Nodered platform.

TDA 7439 is an old audio equalizer with 3 bands (Bass, Middle, high) filter, drived from I2C bus.

It also is an 4 channel stereo commutator and Volume control.

Circuit diagram is simple and is needed very few discrete component in the out:

For communicate with it in I2C you can use Python or Nodered to write the correct register for set-up input channel, volume control, bass, mid, high tone . .

From Datasheet i2C address of ic in hex is 0x88 and register are:

0x00 —> Input selector

0x01 —> Input gain

0x02 —> Volume

0x03 —> Bass gain

0x04 —> Mid-range gain

0x05 —> Treble gain

0x06 —> Speaker attenuation, R

0x07 —> Speaker attenuation, L

I’ve used Nodered to drive it:

For simplicity copy and import this in your Nodered flow:

[{"id":"3b5ed20e.9352fe","type":"ui_slider","z":"438a418a.5513a","name":"","label":"Bass","tooltip":"","group":"8be244e9.a8f2a8","order":1,"width":0,"height":0,"passthru":true,"outs":"end","topic":"","min":"-14","max":"14","step":"2","x":330,"y":100,"wires":[["ee828547.bdafa8","b2011498.4b7408","bfede0fa.36fb2"]]},{"id":"995a6829.24fe38","type":"range","z":"438a418a.5513a","minin":"2","maxin":"14","minout":"14","maxout":"8","action":"scale","round":true,"property":"payload","name":"","x":670,"y":80,"wires":[["2f366336.673e8c"]]},{"id":"d40ed2ec.4065","type":"range","z":"438a418a.5513a","minin":"-14","maxin":"0","minout":"0","maxout":"7","action":"roll","round":true,"property":"payload","name":"","x":670,"y":120,"wires":[["2f366336.673e8c"]]},{"id":"ee828547.bdafa8","type":"switch","z":"438a418a.5513a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"2","vt":"num","v2":"14","v2t":"num"},{"t":"btwn","v":"-14","vt":"num","v2":"-2","v2t":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":510,"y":120,"wires":[["995a6829.24fe38"],["d40ed2ec.4065"],["f220cb7.f037d38"]]},{"id":"f220cb7.f037d38","type":"change","z":"438a418a.5513a","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"7","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":180,"wires":[["2f366336.673e8c"]]},{"id":"2f366336.673e8c","type":"function","z":"438a418a.5513a","name":"pass Bass","func":"bass = msg.payload;\nmsg.address = 68;\nmsg.command = 3;\nmsg.payload = bass;\nreturn msg;","outputs":1,"noerr":0,"x":930,"y":140,"wires":[["a839be67.3f349"]]},{"id":"fbe52a26.445c58","type":"ui_slider","z":"438a418a.5513a","name":"","label":"Treble","tooltip":"","group":"8be244e9.a8f2a8","order":3,"width":0,"height":0,"passthru":true,"outs":"end","topic":"","min":"-14","max":"14","step":"2","x":350,"y":560,"wires":[["75312d69.7d2d84","1a5b9d8c.da21c2","9a8c3413.9b88b8"]]},{"id":"447596c1.cd2018","type":"range","z":"438a418a.5513a","minin":"2","maxin":"14","minout":"14","maxout":"8","action":"scale","round":true,"property":"payload","name":"","x":690,"y":560,"wires":[["f57c9138.bf6b6"]]},{"id":"853df475.d4f098","type":"range","z":"438a418a.5513a","minin":"-14","maxin":"0","minout":"0","maxout":"7","action":"roll","round":true,"property":"payload","name":"","x":690,"y":600,"wires":[["f57c9138.bf6b6"]]},{"id":"75312d69.7d2d84","type":"switch","z":"438a418a.5513a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"2","vt":"num","v2":"14","v2t":"num"},{"t":"btwn","v":"-14","vt":"num","v2":"-2","v2t":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":510,"y":600,"wires":[["447596c1.cd2018"],["853df475.d4f098"],["b28dcd7b.c2273"]]},{"id":"b28dcd7b.c2273","type":"change","z":"438a418a.5513a","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"7","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":660,"wires":[["f57c9138.bf6b6"]]},{"id":"f57c9138.bf6b6","type":"function","z":"438a418a.5513a","name":"pass treble","func":"treble = msg.payload;\nmsg.address = 68;\nmsg.command = 5;\nmsg.payload = treble;\nreturn msg;","outputs":1,"noerr":0,"x":910,"y":600,"wires":[["a839be67.3f349"]]},{"id":"ebe2105c.6725","type":"inject","z":"438a418a.5513a","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":660,"wires":[["d24c60c1.0c7d4","d70ceba8.59e748","d99d8b69.b10ec8","a7e9a567.de8108"]]},{"id":"b2011498.4b7408","type":"file","z":"438a418a.5513a","name":"","filename":"/home/pi/bass.txt","appendNewline":false,"createDir":false,"overwriteFile":"true","x":510,"y":60,"wires":[[]]},{"id":"1a5b9d8c.da21c2","type":"file","z":"438a418a.5513a","name":"","filename":"/home/pi/treble.txt","appendNewline":false,"createDir":false,"overwriteFile":"true","x":550,"y":520,"wires":[[]]},{"id":"d24c60c1.0c7d4","type":"file in","z":"438a418a.5513a","name":"","filename":"/home/pi/bass.txt","format":"utf8","chunk":false,"sendError":false,"x":310,"y":140,"wires":[["3b5ed20e.9352fe"]]},{"id":"d70ceba8.59e748","type":"file in","z":"438a418a.5513a","name":"","filename":"/home/pi/treble.txt","format":"utf8","chunk":false,"sendError":false,"x":310,"y":600,"wires":[["fbe52a26.445c58"]]},{"id":"a839be67.3f349","type":"i2c out","z":"438a418a.5513a","name":"","address":"68","command":"","payload":"payload","payloadType":"msg","count":"1","x":1140,"y":780,"wires":[]},{"id":"4c3d0e20.97eef","type":"link in","z":"438a418a.5513a","name":"","links":["518e0fc.aa4d5f"],"x":215,"y":1080,"wires":[["4cd2ad09.200994"]]},{"id":"1f88c2a0.4b5d0d","type":"inject","z":"438a418a.5513a","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":210,"y":1160,"wires":[["4cd2ad09.200994"]]},{"id":"c0234174.dfbb9","type":"function","z":"438a418a.5513a","name":"Input slector","func":"selector = msg.payload;\nmsg.address = 68;\nmsg.command = 0;\nmsg.payload = selector;\nreturn msg;\n\n\n//msg.address = 68;\n//msg.command = 0;\n//msg.payload = 3;\n//return msg;","outputs":1,"noerr":0,"x":750,"y":860,"wires":[["a839be67.3f349"]]},{"id":"3bfd838f.32809c","type":"function","z":"438a418a.5513a","name":"Input Gain Zero","func":"msg.address = 68;\nmsg.command = 1;\nmsg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":1120,"wires":[["8cd900ff.02bba"]]},{"id":"5d5ff3af.e249bc","type":"function","z":"438a418a.5513a","name":"Volume Max","func":"msg.address = 68;\nmsg.command = 2;\nmsg.payload = 0\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":1160,"wires":[["8cd900ff.02bba"]]},{"id":"ec92cf14.74861","type":"function","z":"438a418a.5513a","name":"Attenuation Speaker Left 32 dB","func":"msg.address = 68;\nmsg.command = 6;\nmsg.payload = 20;\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":1200,"wires":[["8cd900ff.02bba"]]},{"id":"4bd271f6.c6f21","type":"function","z":"438a418a.5513a","name":"Attenuation Speaker Right 32 dB","func":"msg.address = 68;\nmsg.command = 7;\nmsg.payload = 20;\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":1240,"wires":[["8cd900ff.02bba"]]},{"id":"929aa363.4127a","type":"ui_slider","z":"438a418a.5513a","name":"","label":"Middle","tooltip":"","group":"8be244e9.a8f2a8","order":2,"width":0,"height":0,"passthru":true,"outs":"end","topic":"","min":"-14","max":"14","step":"2","x":350,"y":300,"wires":[["148bde1e.5de332","175ace89.5e2121","9794d209.42a3c"]]},{"id":"3e13f596.0f2e3a","type":"range","z":"438a418a.5513a","minin":"2","maxin":"14","minout":"14","maxout":"8","action":"scale","round":true,"property":"payload","name":"","x":690,"y":300,"wires":[["7a022566.d2459c"]]},{"id":"24211112.2c023e","type":"range","z":"438a418a.5513a","minin":"-14","maxin":"0","minout":"0","maxout":"7","action":"roll","round":true,"property":"payload","name":"","x":690,"y":340,"wires":[["7a022566.d2459c"]]},{"id":"148bde1e.5de332","type":"switch","z":"438a418a.5513a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"2","vt":"num","v2":"14","v2t":"num"},{"t":"btwn","v":"-14","vt":"num","v2":"-2","v2t":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":530,"y":340,"wires":[["3e13f596.0f2e3a"],["24211112.2c023e"],["29627fbc.362a3"]]},{"id":"29627fbc.362a3","type":"change","z":"438a418a.5513a","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"7","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":400,"wires":[["7a022566.d2459c"]]},{"id":"7a022566.d2459c","type":"function","z":"438a418a.5513a","name":"pass middle","func":"middle = msg.payload;\nmsg.address = 68;\nmsg.command = 4;\nmsg.payload = middle;\nreturn msg;","outputs":1,"noerr":0,"x":930,"y":340,"wires":[["a839be67.3f349"]]},{"id":"175ace89.5e2121","type":"file","z":"438a418a.5513a","name":"","filename":"/home/pi/middle.txt","appendNewline":false,"createDir":false,"overwriteFile":"true","x":550,"y":260,"wires":[[]]},{"id":"d99d8b69.b10ec8","type":"file in","z":"438a418a.5513a","name":"","filename":"/home/pi/middle.txt","format":"utf8","chunk":false,"sendError":false,"x":310,"y":340,"wires":[["929aa363.4127a"]]},{"id":"9794d209.42a3c","type":"ui_text","z":"438a418a.5513a","group":"8be244e9.a8f2a8","order":5,"width":0,"height":0,"name":"","label":"Middle","format":"{{msg.payload}}","layout":"row-spread","x":530,"y":220,"wires":[]},{"id":"9a8c3413.9b88b8","type":"ui_text","z":"438a418a.5513a","group":"8be244e9.a8f2a8","order":6,"width":0,"height":0,"name":"","label":"Treble","format":"{{msg.payload}}","layout":"row-spread","x":530,"y":480,"wires":[]},{"id":"bfede0fa.36fb2","type":"ui_text","z":"438a418a.5513a","group":"8be244e9.a8f2a8","order":4,"width":0,"height":0,"name":"","label":"Bass","format":"{{msg.payload}}","layout":"row-spread","x":470,"y":20,"wires":[]},{"id":"8cd900ff.02bba","type":"link out","z":"438a418a.5513a","name":"","links":["66284e5e.9fbbf"],"x":1015,"y":1160,"wires":[]},{"id":"66284e5e.9fbbf","type":"link in","z":"438a418a.5513a","name":"","links":["8cd900ff.02bba"],"x":1075,"y":1060,"wires":[["a839be67.3f349"]]},{"id":"4cd2ad09.200994","type":"function","z":"438a418a.5513a","name":"pass msg","func":"\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":1160,"wires":[["3bfd838f.32809c","5d5ff3af.e249bc","ec92cf14.74861","4bd271f6.c6f21"]]},{"id":"5fef718.0b4089","type":"ui_slider","z":"438a418a.5513a","name":"","label":"Input selector","tooltip":"","group":"c0219c29.ce3b2","order":5,"width":0,"height":0,"passthru":true,"outs":"end","topic":"","min":"1","max":"4","step":1,"x":340,"y":840,"wires":[["48a31fc6.c225c","42f3fc6f.c71354","c3efa8cf.1733c8"]]},{"id":"a7e9a567.de8108","type":"file in","z":"438a418a.5513a","name":"","filename":"/home/pi/selector.txt","format":"utf8","chunk":false,"sendError":false,"x":320,"y":880,"wires":[["5fef718.0b4089"]]},{"id":"c3efa8cf.1733c8","type":"ui_text","z":"438a418a.5513a","group":"c0219c29.ce3b2","order":6,"width":0,"height":0,"name":"","label":"Input selected","format":"{{msg.payload}}","layout":"row-spread","x":540,"y":740,"wires":[]},{"id":"48a31fc6.c225c","type":"file","z":"438a418a.5513a","name":"","filename":"/home/pi/selector.txt","appendNewline":false,"createDir":false,"overwriteFile":"true","x":580,"y":780,"wires":[[]]},{"id":"42f3fc6f.c71354","type":"range","z":"438a418a.5513a","minin":"1","maxin":"4","minout":"0","maxout":"3","action":"clamp","round":true,"property":"payload","name":"","x":550,"y":860,"wires":[["c0234174.dfbb9"]]},{"id":"8be244e9.a8f2a8","type":"ui_group","z":"","name":"Settings","tab":"17de850b.6e062b","order":1,"disp":true,"width":"6","collapse":false},{"id":"c0219c29.ce3b2","type":"ui_group","z":"","name":"Amplifier","tab":"b65bd0fc.b1074","disp":true,"width":"6","collapse":false},{"id":"17de850b.6e062b","type":"ui_tab","z":"","name":"Equalizer","icon":"dashboard","disabled":false,"hidden":false},{"id":"b65bd0fc.b1074","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

After you can control Tone and channel input from your browser:

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *