Projector ballast bypass

frankwilsonshat:
I was on version 1.2.08, now on 1.2.10 and my logic save loads ok on that.

I have version 1.1.15 installed so that's probably the cause.

You don't seem to have enough high/low transitions in the timing arrays you created but as I cannot read the Salea file I cannot be sure.
Attached is a possible means to do the job but you would need to check its output and compare to what you want.
This would easily run on a smaller AVR like the Tiny85 if you needed to reduce size.

sketch_jul15a_Projector.ino (1.28 KB)

Okay, I downloaded the latest Saleae software onto my other PC (I don't want to risk mixing versions between work and home) and the file loads okay now.
Checking it and I have to disagree with your 2600,10,N,1 serial protocol assumption as it looks more like 2400,9,N,1 to me.
This opens another option to you as you could find a serial library that supports 9 bit data and just use that to send the byte data or just continue down the bit banging route.

Checking it and I have to disagree with your 2600,10,N,1 serial protocol assumption as it looks more like 2400,9,N,1 to me.

You are absolutely right, after adjusting the analyser settings in Saleae to 2400,9,N,1
all looks 100%.

I'll have a go with your code first of all, and like you point now there's the option for using a 9bit library.
As this is a one off project I'm more than happy to stick with bit banging code you posted.

Thanks for your help,

I noticed my delays were off, I have sorted these, now when I run the code I am getting the first bit of each byte (or start byte of each byte sequence) as a state change, but after this first high I am not getting the remaining changes.
It's as if the first number in the array is being read, but not the following numbers.
So it's almost there if I could find out why the array is not being read?

Try the below code.
You will need to adjust the timing arrays to match you findings but it now does all the values in an array and not just the first one over.

sketch_jul15a_Projector.ino (1.66 KB)

Have updated your code with my new timings.
Had to experiment a little with the numbers to get as close a match to the original signal as possible as this seems quite critical to the projector.
Your code works 100%, no issues at all with that:-)
The projector now starts up as it would when the bulb and ballast are good, albeit with the ballast disconnected and the bulb removed.
Where I'm running into problems is with the repeating sequence, there seems to be more to this than just a regular pulse, the timings possibly.

I have added more lines of code to try and emulate the timings of the original;

delay(3528);

xSend 3 bytes

delay(3108);

xSend 3 bytes

delay(3239)
etc,etc (May have to run original again for longer to check for repetition, can't see any so far)

before I did this it was getting to this point and cutting off, now it does run for longer, however it is still cutting off so I am looking at running the SA again on the complete projector for a closer look.
I have a number of options here, suffice to say I'm fairly confident the projector is very close to staying on.
I may even do what I did before and run it next to the good projector with the ballast wire and gnd wires linked over to check what happens on a longer run time etc.

As the signal your trying to emulate is a serial signal it might have both the RX & TX connected, and maybe the module/thing that is sending it only does so when requested by the ballast?
might be worth looking for a return serial signal (or maybe something as simple as a line pulsed high/low) from the ballast that is a request signal.

As the signal your trying to emulate is a serial signal it might have both the RX & TX connected

That's what it's doing, I'm going to have to reorganise my setup and take another look, not had a chance to do much at the moment.

There's a 2400 baud signal being sent out by the projector to the ballast, will write back as soon as I've got an idea on the bytes being sent.

Sorry for the delay on this, after moving to a more practical area to continue with this project I am getting plagued with noise on the signal analyser, however after applying a glitch filter to the data I can confirm it is indeed just a single pulse that is being sent from the projector to the ballast.
I'm thinking that some sort of amendment to the code like this might be worth a try,

if DigitalRead = HIGH then

xSend(x22D, s22D);
xSend(x139, s139);
xSend(x2C1, s2C1);

if DigitalRead = HIGH then

xSend(x20C, s20C);
xSend(x2C1, s2C1);

if DigitalRead = HIGH then

xSend(x02C, s02C);
xSend(x20C, s20C);

Does the serial data transmission start on the rising edge of the pulse or the falling edge? The pseudo code you posted is the right idea but you might need to wait for the pin to go low after sending a serial burst else the code might move on to the next section while the pulse pin is still high.

 if DigitalRead = HIGH then

  xSend(x22D, s22D);
  xSend(x139, s139);
  xSend(x2C1, s2C1);

 while (DigitalRead == HIGH){};

From what I can see the logic level starts high (normal) then drops low, back to high, then the ballast sends back the 9bit serial data 22D,139,2C1 etc.
So every time pin 1 goes low and back to high the data is sent, if that makes sense?

frankwilsonshat:
From what I can see the logic level starts high (normal) then drops low, back to high, then the ballast sends back the 9bit serial data 22D,139,2C1 etc.

So just reverse the logic and have something like this before each sequence send

while (DigitalRead == HIGH){};// Wait till pin goes low
while (DigitalRead == LOW){};// Wait till pin goes high

I've changed over to another projector due to various problems, now I'm getting a clean signal into the Saleae.
I can now see a 9bit serial signal (2400/9-N-1) on the tx pin, I've provisionally unplugged all unnecessary cables. From the picture I took, it looks like the projector is sending out this two byte signal expecting the ballast to send back(Arduino code).
All is not lost though as I expect the state change routine I posted before will still be valid as all that is required is a timing reference for sending the three byte sequence.

Is is possible to get the Arduino to monitor say pin 8 for these 9bit bytes, before starting its output?

You might be as well just using one of the available modified hardware serial libraries that allow 9 bit serial send and receive and then your responding to the correct commands instead of just hoping the message you receive is what your expecting.

I had a look at the 9bit serial option when you first mentioned it and from what I've read it looks like more trouble than it's worth.
However since the 9bit tx from the projector is purely needed as a timing reference I have found that it is reliably being interpreted on 2400n1 (8bit) as decimal 81 and 13.
Further to that I accidentally discovered that all the projector needs to start up is the 3 byte sequence, the bytes before that could be some sort of status signal for the lamp as it warms up.

I have also changed the delay from 3.1 seconds on this loop to about 900 milliseconds and it more or less stays on,
it would be much better if I could read the 81 and 13 on the tx line and sync it to the loop, something like this possibly;

if serial read = 13 then

xSend(x22D, s22D);
xSend(x139, s139);
xSend(x2C1, s2C1);

if serial read = 81 then "go to 10"

I've tried doing it by modifying the "while" loop you posted but did not have any success, apart from my accidental 3 byte "shortcut"

Try this one. It just replaces the loop code you used for reading the values using serial and all the xSend routine.

while(Serial.available > 0){  // Serial byte(s) available?
  if(Serial.read() == 13){  // Yes, Is it 13
    xSend(x22D, s22D);  // Yes, so send reply
    xSend(x139, s139);
    xSend(x2C1, s2C1);
  }
}

Lost interest on this but I eventually have the leds I wanted, have them mounted on heatsinks inside the lightbox
red green and blue.
Will post pictures if all goes to plan.

frankwilsonshat:
Lost interest on this but I eventually have the leds I wanted, have them mounted on heatsinks inside the lightbox
red green and blue.
Will post pictures if all goes to plan.

That would be good to see the final project. Is the code working as expected now?

I'm having to tidy the projector away until after the New Year, so here are two pictures in the meantime.

Been having problems getting the rx opto-isolation part running, however I'm certain your code is going to be
okay, so will work on that part once I have tidied all the wires up and installed a usb port for 5V.
(Possibly to add Firestick etc...)

The red led is one of those pinkish type colours, it will be getting swapped out for a red led that I have ready to go in.

I've got quite a bright white light coming out of the lens once it's in place, however due to heat constraints I may have to move the leds back from the polarizer filters (plastic frames). If that is the case then there is the possibility for radically expanding the case and fitting 100w leds with condenser lenses.

I have disconnected all non essential fans and run the tacho wires from a working fan to the disconnected tacho lines and the board is happy to run like this, except the main lamp fan which seems to have a different tacho signal, I would like to completely remove this fan, will check it with the SA next year. Could I run some code concurrently with the bit-banging routine, or would I just be as well to use another Arduino?

Happy New Year for now