Control of BBB-based audio appliances - diyAudio
Go Back   Home > Forums > Commercial Sector > Manufacturers > Twisted Pear
Home Forums Rules Articles diyAudio Store Gallery Wiki Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Twisted Pear Superior quality electronic kits

Reply
 
Thread Tools Search this Thread
Old 30th October 2015, 06:55 PM   #1
diyAudio Member
 
Join Date: Mar 2007
Location: Longmont, CO
Default Control of BBB-based audio appliances

Thanks largely to the persistence of Miero and his work on Botic, the capabilities of BBB-based music players are steadily expanding. However, it is unreasonable to expect Miero to anticipate the preferences or needs of every builder. This thread is intended as a place to share our individual solutions to various control and integration scenarios - from the routine to very specialized. I hope you will consider showing off what you have done with your own hardware and software. I will do the same with my very basic efforts as progress is made. I'm keeping it as simple as possible using bash and python. Be forewarned, my approach here will be as a beginner whose knowledge is gained from trial-and-error with heavy emphasis on the error!

To start, let me go 'pie in the sky' and present a couple of possibilities for controllers that I am thinking about but with which i have zero experience. The ideas and possibilities seem really transformative - really worth learning about. These control methods use mobile device apps (iOS and Android) that allow one to construct their own "remote controls" for lots of different kinds of devices. (Who doesn't have a retired smartphone that could be put into service?) Here, I'm thinking of controlling things like system inputs and outputs (e.g., a TPA OttoII), volume, other play parameters, etc. This can be done from a SSH command line, but these controller programs are truly multifunctional. I don't want to duplicate the many excellent controllers for MPD or Squeezelite, but how about controlling other equipment or room lighting from the same hand-held device? The internet of things is arriving.

NetIO is a fairly well-developed platform with an online design application for configuring controllers. A variety of widgets can be incorporated into the controls, like buttons, switches, sliders, displays, etc. Advanced controllers can be multi-page and programmed to change pages as the functions require. If I'm not mistaken, the control panel can also display information gathered from the 'slave' device. The interface between the mobile control device and the slave device is limited. Quoting the developer:
Code:
NetIO does not support SSH connections. It is only TCP sockets , UDP or HTTP and 
HTTPS.  
However, there is a project from simi-chan http://netioapp.com/de/projects/681 
that enables the execution of bash commands via NetIO without a special 
self-programmed server.
@kushal_mehta51 hostnames work, so if you have a dyndns address and the router 
configured correctly, you can just use the dyndns address to connect from the 
internet.
Blynk is the other DIY controller App. This is less expensive and is perhaps more broadly applicable, being employed in "lower-level" device control tasks as well as at the level of Linux development boards. If I'm not mistaken, there is javascript server code that runs on Rpi but that has not been ported to BBB. Both NetIO and Blynk host user forums, and it seems the level of discussion is more technical with Blynk. The Q/A is harder for me to understand. So I don't know which of the two systems would be easier to use after gaining working knowledge.

Are any readers experienced with either of these two systems? What is your advice?

Because my BBB is wired and not wifi, opening a TCP port doesn't worry me. So I will probably try NetIO using TCP enabled by Python scripts. I will report back when I know more. I will also share the interrupt and control scripts that are now about 50% done - along with photos, of course!

...looking forward to your thoughts and ideas...
  Reply With Quote
Old 5th November 2015, 04:53 AM   #2
diyAudio Member
 
Join Date: Mar 2007
Location: Longmont, CO
I have a question for anybody with an electronics background.

Background:
On my BBB/Hermes/Cronus build, I wanted front panel indicator LEDs for the system inputs and outputs. Plus, I wanted momentary buttons to control the BBB via GPIO inputs. I decided to use small buttons with incorporated LEDs - the LED is not controlled by the switch. To drive the LEDs from BBB, I used BS270 FETs as suggested by Derek Molloy and connected the gate to the GPIO header. Power to the LED came from the 3.3v supply on the Hermes prototype area.

Problem:
All was well until I decided to reboot the system by merely cutting power and letting the LiPO battery shut down the BBB. After that, all 5 of the BS270s were shorted. I can't imagine what happened to the FETs because all of the voltages and currents are supposedly well within the normal operating range. In order to avoid this kind of headache in the future, I need to understand what happened. Any suggestions? Any remedies?

Thanks in advance!

Frank
Attached Images
File Type: jpg FullSizeRender-1.jpg (737.8 KB, 310 views)
File Type: jpg FullSizeRender-2.jpg (538.8 KB, 305 views)
  Reply With Quote
Old 5th November 2015, 08:47 AM   #3
smanz is offline smanz  Spain
diyAudio Member
 
Join Date: Jul 2008
For your application, I thing is more easy to use the ULN2803.

Cheers

Click the image to open in full size.

http://www.ti.com/lit/ds/symlink/uln2803a.pdf
  Reply With Quote
Old 6th November 2015, 05:49 AM   #4
diyAudio Member
 
Join Date: Mar 2007
Location: Longmont, CO
Quote:
Originally Posted by smanz View Post
For your application, I thing is more easy to use the ULN2803.
Thanks for the suggestion! Today I got a ULN2003 for testing. The internals seem the same as the part you referenced. Obviously the BS270 FETs are more fragile than I imagined! Regards, Frank
  Reply With Quote
Old 6th November 2015, 08:02 PM   #5
diyAudio Member
 
Join Date: Mar 2007
Location: Longmont, CO
Thanks again for the suggestion, @smanz! I am using an older analogue of the ULN2003 - a MCT1413 - and it is working perfectly. A battery-powered shutdown did no harm (with a breadboard setup). I will make a new switch/LED interface board and then continue working on the scripts that will run the various switch functions. When the details are all working, I will post the setup and code in this thread.

I read one piece of advice regarding Rpi that seems worth passing along to those who may be customizing their BBB-based systems. It may be obvious to many, but it is this: For GPIO outputs that are controlling other circuits, it is best to choose pins that are inputs by default. This prevents a disorderly activation of the external circuits by default output pins that could occur during the boot process. As a final step in preparing the BBB to run, the default input pins can be re-assigned as outputs, set high or low, and the chances of frizzing the BBB will be lower. Under Botic, those include unclaimed GPIO pins P8_7 to P8_10 (input, high) and P8_11 to P8_19 (input, low).
  Reply With Quote
Old 10th November 2015, 04:39 PM   #6
diyAudio Member
 
Join Date: Mar 2007
Location: Longmont, CO
I am working on the question of digital volume control for the three BIIIse DACs in my system - one stereo DAC for bass, one for midrange, and one for high frequencies. Ideally, it would be great to have individual control of volume for each DAC. [...tweak the driver blend at different volumes]

I2C directly to the ES9018 works, but is limited to two channels. Using a buss extender seems inconvenient. Thus, I would like more information about the stock micro controller on the Buffalo, which is the default potentiometer-controlled method.

Questions:
How many taps or volume levels does the micro controller implement in the ES9018?
How much current does each micro controller draw through the external potentiometer?

Bottom line: I am wondering if it is feasible or inadvisable to use one I2C-controlled multi-channel digital pot to drive each onboard micro controller on each Buffalo board.
  Reply With Quote
Old 10th November 2015, 05:58 PM   #7
miero is offline miero  Czech Republic
diyAudio Member
 
Join Date: Jun 2011
Location: Prague
francolargo, you could use another I2C bus of BBB (it has 3) for controlling 3rd ES9018 ... but you need to add I2C isolator for that one
__________________
BeagleBone Black with I2S, DSD and SPDIF interface (Linux driver)
http://bbb.ieero.com/
  Reply With Quote
Old 10th November 2015, 06:01 PM   #8
smanz is offline smanz  Spain
diyAudio Member
 
Join Date: Jul 2008
Its easy. You can use this IC 4 Channel I2C Multiplexer

This is the modified Hifiduino (Arduino) code to write registers. Some comments are in spanish, but is easy to understand. I have conected four buffalos. Two of this with addres jumper mounted and another two without jumper. Are in quad mono configuration.


// The default mode is for the address 0x48 to be the left chip
void writeSabreLeftReg(byte regAddr, byte regVal)
{
Wire.beginTransmission(0x70); //Llamo al multplexador
Wire.write(0x04); //Selecciono canal 0
Wire.endTransmission();
Wire.beginTransmission(0x48); //Hard coded to the the Sabre/Buffalo device address
Wire.write(regAddr); // Specifying the address of register
Wire.write(regVal); // Writing the value into the register
Wire.endTransmission();
Wire.beginTransmission(0x70); //Llamo al multplexador
Wire.write(0x05); //Selecciono canal 1
Wire.endTransmission();
Wire.beginTransmission(0x48); //Hard coded to the the Sabre/Buffalo device address
Wire.write(regAddr); // Specifying the address of register
Wire.write(regVal); // Writing the value into the register
Wire.endTransmission();
}

// In dual mono, sometimes different values are written to L and R chips
#ifdef DUALMONO
void writeSabreRightReg(byte regAddr, byte regVal)
{
Wire.beginTransmission(0x70); //Llamo al multplexador
Wire.write(0x04); //Selecciono canal 0
Wire.endTransmission();
Wire.beginTransmission(0x49); //Hard coded to the the Sabre/Buffalo device address
Wire.write(regAddr); // Specifying the address of register
Wire.write(regVal); // Writing the value into the register
Wire.endTransmission();
Wire.beginTransmission(0x70); //Llamo al multplexador
Wire.write(0x05); //Selecciono canal 1
Wire.endTransmission();
Wire.beginTransmission(0x49); //Hard coded to the the other Sabre/Buffalo device address
Wire.write(regAddr); // Specifying the address of register
Wire.write(regVal); // Writing the value into the register
Wire.endTransmission();
}

More information about register functions is in Hifiduino sketch.

Regards
  Reply With Quote
Old 10th November 2015, 09:13 PM   #9
diyAudio Member
 
Join Date: Mar 2007
Location: Longmont, CO
Thanks for the suggestions, Miero and Smanz!

Brian let me know that the firmware uses 255 steps of 0.5 dB, which seems excellent for being controlled by a digipot with 8 bit resolution. So I will continue with learning about I2C reads/writes, and see if I can make it work well enough.

I do have a problem caused by planning the hardware without all the information about I2C that I needed. The system will use 2 boxes - one plain rack box and one smaller, nicer chassis that will show. At the moment most of the wiring is still very untidy! All of the power supplies (1-9 in the photo) and the DACs (A-C) are in the rack box. The BBB and associated hardware will be separate in the smaller chassis, with a multi-function cable between them. I only gave myself 4 wires for communication between the two boxes. The PCA9544A seems like a great solution but I wonder if 4 wires are enough? Vdd and Vss could come from a BIII...

I will continue learning and testing the 1 channel 8-bit digipot. If it seems like a workable solution, then I will try a 4 channel version inside the rack box. But if it doesn't work well, I will drop the idea and try a different approach.

Best,

Frank
Attached Images
File Type: jpg IMG_2633.jpg (1.02 MB, 237 views)
File Type: jpg IMG_2635.JPG (962.5 KB, 228 views)
File Type: jpg Panel.jpg (536.2 KB, 61 views)
File Type: jpg IMG_2634.jpg (1,011.1 KB, 71 views)
  Reply With Quote
Old 10th November 2015, 10:30 PM   #10
smanz is offline smanz  Spain
diyAudio Member
 
Join Date: Jul 2008
Quote:
Originally Posted by francolargo View Post
Thanks for the suggestions, Miero and Smanz!

The PCA9544A seems like a great solution but I wonder if 4 wires are enough? Vdd and Vss could come from a BIII...

,Frank
If you mount PCA9544 in Buffalo chassis, you only need two wires, SDA and SCL. You can obtain 3,3v Vdd from buffalo, and Vss is common ground between buffalo and clean side of hermes.

Regards
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a volume control to a TPA3122-based audio kit i336 Class D 2 9th June 2015 07:50 AM
How do I use my appliances on a Furman PL8CE? Akins Equipment & Tools 21 20th May 2015 06:24 PM
Powering non-speaker appliances with an amp cspirou Everything Else 4 4th November 2014 11:34 AM
Household Appliances repair forum Tarzan Everything Else 7 22nd August 2012 08:54 PM
Transformer-based volume control wboyd Analogue Source 4 18th August 2004 05:57 PM


New To Site? Need Help?

All times are GMT. The time now is 05:07 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Copyright 1999-2016 diyAudio

Content Relevant URLs by vBSEO 3.3.2
Wiki