Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[WIP] Cambridge Audio / Raspi Remote control
#1
Short intro/background:

Bought a new amp (Cambridge Audio CXA61) for my hifi system, and spotted a RS232 9 pin header on the back, which according to CA can be used to steer it. This resulted in the idea to build a webserver which should steer the amp and the pi I use to run moode. I also wanted something to really power off the pi, because during runtime it consumes around 1A/5V (5W) and when shut down 200mA/5V (1W).

After some testing, I decided to go with the following hardware components and connections:

[Image: PrWLEvG.png]

The webserver will run on the ESP-07s. Because of some restrictions around timing and controlling the whole system, it is not directly linked to the rest of the hardware, but only exchanges data with an Arduino ATMega328p using TTL. I decided to use a barebone arduino chip, because why not and to save some space in the box hosting the components.
The AT is connected to the Pi over two connections to check the power state of the pi and to request the shutdown. Then it is also connected to a relais which is used to cut off the power supply of the pi after shutdown to conserve some energy. Last but not least, the AT speaks with the amp and is connected to it over a TTL/RS232 connection. Throw in some LEDs and two buttons for steering the whole thing locally, and we have a web based remote for Moode/pi and CA.

Planned features are:
- turn on/off the CXA61 via web front end
- change the input source of the amp
- mute/unmute the amp
- automatic shutdown and booting of the pi whenever the amp is switched off/on
- an override control (plus button) to keep the pi running even when the amp is turned off
- a button to manually shutdown the pi and to cut off the power supply
- three LEDs for: HiFi status on/off (nad LED blink when muted); Relais power on/off; Pi on/off (and blink for overriding the automatic shut down).


Current status: aliexpress is pretty busy in sending me various orders with parts I still need, but....
- the communication between AT and CXA61 works, just like it works between the ESP and the AT

- the webserver is making progress. The Pi related buttons are still missing, but I am happy now to have my own size reduced version of the required fonts and found a way to store all static data in the flash memory of the ESP. No need to add a sd card for this, and the control buttons also don't look too bad.

[Image: MhhqdCI.png]

- the power switch/relais is working. I am using two USB-C ports for routing the power through the steering element. Maybe I remove the hot glue, I just needed something to fix everything without having to wait for hours.

[Image: is26OAg.jpg]

- wiring the hardware is also almost complete and working (on the bread board). Some parts like the Pi are simulated using a button for its power state, and the CXA61 is not connected yet in the test system.

[Image: MRHLvbO.jpg]

Now I can go back to the web server and work on the communication between AT and ESP, and hopefully in some weeks more hardware is here to build all the cables and connectors.
Reply
#2
Forgot to mention: if your amp has a remote control, then I am sure it can be steered in a similar way, even if it doesn't have a serial link. Replace the TTL/RS232 cable with an IR diode and let the AT send commands.
Reply
#3
Looks like a fun project.

Hot glue is a step up from some of the dodgy ways I've held bits and pieces together in weekend builds Tongue .

Regards,
Kent
Reply
#4
... I just hope that the glue is not the ordinary type, I would pay top dollar/euro for an audiophile glue (:-)
Reply
#5
(11-04-2021, 12:48 PM)CallMeMike Wrote: ... I just hope that the glue is not the ordinary type, I would pay top dollar/euro for an audiophile glue  (:-)

Doh, why didn't I think of that? Yet one more demonstration that I was cut out to be a researcher and not an entrepreneur.

If you were coating the edges of your CDs with a green marker pen then you'll definitely want a case of CallMeMike's Audiophile glue.  

Regards,
Kent
Reply
#6
(11-04-2021, 01:22 PM)TheOldPresbyope Wrote:
(11-04-2021, 12:48 PM)CallMeMike Wrote: ... I just hope that the glue is not the ordinary type, I would pay top dollar/euro for an audiophile glue  (:-)

Doh, why didn't I think of that? Yet one more demonstration that I was cut out to be a researcher and not an entrepreneur.

If you were coating the edges of your CDs with a green marker pen then you'll definitely want a case of CallMeMike's Audiophile glue.  

Regards,
Kent

Just be sure to mark which direction the glue should fed into the hot gun.  I've heard of many a high end system improved just by flowing the glue the right way.
----------------
Robert
Reply
#7
Glue isn't the most important issue here. I am pushing the poor electrons through a mosfet based power switch bought on ali for less than 1 USD, before they fire up the pi. Think about all the noise I am adding, totally destroying the sound quality of the output. Zero chance this piece of gear is audiophile approved. And the cables, ooooh man, the cables....

And now back to writing html/css (which I am absolutely no expert in....) and some soldering tutorials on YT.
Reply
#8
A quick note:

I plan to use a barebone ESP-07s for the webserver instead of the more common ESP boards, like the Wemos D1 pro, for three main reasons.

1) Size - here are the two board types:
[Image: Xns6Zv0.jpg]

2) energy consumption. The D1, like many other boards, has an built in USB connector, some LEDs and other gimmicks which make programming easy, but are not needed during runtime.

3) External antenna. The ESP-07s is pin compatible with other ESPs like the ESP-12E, but offers the ability to use an external antenna. An important detail for me because the router is in a different room and the connection is not the best.

The easiest way to program an ESP-07s is using a dedicated programming board which can either be made or ordered from ali for maybe 6 USD:

[Image: 020hf7h.jpg]

Just got the board today, now I can test the webserver on the ESP. Until now it was running on a rock64 SBC I used to write/change all this html and css stuff.
Reply
#9
Working on the ESP<-> Arduino communication now.

This is the minimum required hardware to run the ESP and the ATMega using a 5V power supply (aka what I get when I connect this to the relais/box I already have built):

[Image: 2wwGaq4.jpg]

[Image: VPxBvMc.png]
A pretty simple design. On the right 5V in via USB, converted to 3.3V. On the left the AT which only requires VCC, GND and the two connectors (yellow/green) for the serial signal, and in the middle the ESP. 

The AT328p required some changes using a program called avrdude to run. There are three bytes on the chip which regulate several settings, e.g. at which speed it should run, if it should use an internal oscilator to generate the frequency and some more. There are pages dedicated to this topic. What I did was to switch the chip to the internal 8MHz osci, plus I had to disable the brown out detector so it wouldn't reset all the time instead of running at 3.3V. The low fuse byte was changed to E2, the extened one to 07, the high one I didn't touch.

To program such an AT, the easiest way is to buy an ATMega Uno and a programming shield. Upload a special script/program to the Uno (included in the installation), then change the target chip for programming to Arduino mini pro/3.3V, 8MHz and upload scripts via the  "Upload using programmer" function after plugging the barebone AT328p into the blue ZIF socket.
[Image: r7sM4Y0.jpg]



The ESP can run in two modes. The default mode is the AT mode where it works just like a good old serial modem, connected to the serial port of a computer. To change this behaviour, three pins need to pulled to high/low using 10kohm resistors. Then the ESP runs whatever you upload to it instead of accepting AT commands. The problem now is: with the 3 resistors in place you can only run programs, but not upload them. Instead of adding more hardware, I decided to replace the ESP-07s with a pin compatible ESP-12e which doesn't have the external antenna, but offers a better way to solder some wires  to it:

[Image: u94XmCF.jpg]

For (re)programming, I plug the ESP into the ESP shield, for running/testing, I just connect it to the breadboard using the wires I soldered to it.


Now I am hunting a strange bug/problem related to the serial connection. The webserver becomes unresponsive for a second or two after a refresh and doesn't accept a new connection.
Reply


Forum Jump: