Author Topic: Stero Control via Cloud A 1988 Receiver Update  (Read 8273 times)

DrJFM

  • Newbie
  • *
  • Posts: 31
Stero Control via Cloud A 1988 Receiver Update
« on: July 24, 2016, 06:03:13 pm »
I have a perfectly serviceable 1988 vintage Onkyo TX-82 Receiver.  This was one of the first generation of receivers with an IR controller and used a cable to extend this remote control to the companion cassette deck.  I have a much newer Sony 5 Disc CD player attached to it.  It lives in my finished basement but I have speakers wired upstairs.  So -- can the stereo system be controlled from upstairs, using a smart phone, the internet and an Oak?  Yes, that was a rhetorical question.  Of course it can.

Besides being an Oak Kickstarter backer, I backed the Blynk Kickstarter campaign and this type of functionality was why I backed them both.  You shouldn't have to program for your smart phone and your Oak and your PC and the web just to do some simple control.  The Particle cloud gets part way there. OakTerm is an even easier way to see the you are connected, monitor if your code is running via PC, but Blynk does make smart phone control a straightforward proposition. 

The downside of all these is that a lot of bits are trying to talk to your Oak while it is working and these cloud systems seem to go wonky once a week or more.  I wouldn't want to control a dialysis machine this way or any other real critical function, but my downstairs music sytem, sure.  Worst case I can always walk down stairs and push a few buttons.

Since so many bits are trying to do moderately time sensitive routines on the Oak, I was reluctant to try and do the carrier frequency modulation that IR remote control  signals require to be functional using interrupts.  I found references to modulating an IR LED or other signal using a common and cheap 555 timer IC.  I had worked with IR signals earlier and made sure some of the standard IRLib library routines would control my devices using an Arduino UNO with no fancy wifi etc.  If you are just getting going w Oak/Arduino stuff with only and Oak, get your self an UNO to help develop your control code before moving to full wifi etc.  The UNO also works well as a USB to Serial device to allow you to program (ie restore) your Oak via serial programing.  Just make sure you buy one with a the Atmel 328 in a socket.  You pop out the MCU to use it as a serial interface for your Oak.  I also have used the AnalysIR software (https://www.analysir.com/blog/2015/09/01/simple-infrared-pwm-on-arduino-part-3-hex-ir-signals/) to great effect.  They are a good resource for learning about IR control with Arduino etc. 

The AnalysIR software provide me with not only the Sony CD player codes (using my UNO to read the Sony remote into the software) but showed me that the 1988 Onkyo used NEC codes that are still used and recognized by the software.  If you feel intimidated by trying to read IR codes from remotes, many of the common device codes can be gotten with a bit of internet searching.

I made note of the Hex representation of the codes I wanted to implement.  Power ON for both stereo components is a toggle type function by remote, not a separate Power ON Power OFF code.  The old receiver even needs to be powered on by hand and the turned "Off" or actually put in a standby mode using the original remote in order to respond to the IR signals.  I recorded codes for volume control CD track and disc skip functions, Pause, Play Mute and switching to the FM Tunner of the Onkyo and changing preset stations.

The more modern CD player had an optical out port that let me use a photodiode to detect power to the unit.  No light, turn it on.

The NEC will only function if left in standby so can be assumed to have power in -- I just needed to sense if left on or in standby.  I ended up using a Hall Sensor and placing a magnet on the volume control knob.  If "ON" then I can turn volume up or down and see the Hall sensor toggle.  If it doesn't change state, send an IR "ON" signal and try again.  Works pretty well with a small rare earth magnet and about a 1/4 inch gap to the Hall.  (the volume control by IR actually turns a motor to rotate the volume pot/knob. NO fancy digital controls in 1998).

It is working decently and now I am looking at several follow on steps:
a) Hook the speakers up to a relay board -- selecting speakers was not an IR control on the Onkyo
b) Solder up a prototype board version and get it into an enclosure (the Oak and Breadboard system sit out of the way but is a bit messy for the long haul)
c)Try and move to a full PC board version for the experience of doing the PCB layout etc. (no one said messing with this stuff would be dirt cheap did they?)

I am attaching a screenshot of my Blynk smartphone control App, snap of the type of Hall sensor I used and a picture of a somewhat newer version of the Onkyo I am controlling.  A schematic of the 555 timer and IR LED driver circuit is attached.

The code for the Oak is heavily commented for my documentation and to perhaps help others.

James

DrJFM

  • Newbie
  • *
  • Posts: 31
Re: Stero Control via Cloud A 1988 Receiver Update
« Reply #1 on: July 24, 2016, 07:07:35 pm »
Here is my Oak sketch.  It is heavily commented, so would not paste in and is attached as an Arduino sketch .ino file.
I am afraid there is a fair amount of redundancy between the initial descriptive post and the comments in the code.
Feel free to ignore.....

James

emardee

  • Full Member
  • ***
  • Posts: 135
Re: Stero Control via Cloud A 1988 Receiver Update
« Reply #2 on: July 30, 2016, 06:42:26 pm »
Awesome! I find these posts inspirational. Thanks for posting your project.

Embassy7771

  • Newbie
  • *
  • Posts: 1
Re: Stero Control via Cloud A 1988 Receiver Update
« Reply #3 on: August 03, 2016, 05:01:33 am »
Thanks for the tip to rather use UNO to get things work first and then move on to oak.Will do that