Sana IR Transmitter question

Hi,guys I was able to run the sana ir receiver,but what I need to do to send ?
Can someone explain me what I need to connect to the spi and pin1 ?
Can I just hook up the ir led with one 2N3904 transistor and transmit ?

You need an AND gate to gate the modulation PWM with the data, like in the Sana schematic?

Ok I can see from where MOSI is comming,but I dont understand where the IR_CARRIER signal is comming because my imp dont have PINC on it I have only pins 1,2,5,7,8,9.
I am using IMP001 not IMP002, I hope that is not game changing.

You just need to pick another spare pin and configure it as PWM.

So I can replace after Q1 the jack with single IR LED and control any media ?

Yep, remember the current limiting resistor!

ok,so I was able to figure out the schematic so here what I did:
First I uploaded ir_receive to get on/off command code which is 001101000011010001111000100001111.
I made this using logic level converter because I saw the tsop output voltage is 5V.
Then I used ir_transmitting I set pin8 as ir_carier and 257 as SPI where pin7 is MOSI.
Because I couldnt find SN74AUP1G08DCKR I saw it is 2-AND gate so I replaced it with quad AND gate SN74HC08N where I use only pins : 1,2,3,7,14.
When I send the above code and check the voltage level from SN74HC08N pin3 to ground at range of 20V its showing me something like 0.20-0.14 as output.
I connect to pin3(SN74HC08N ) one IR diode and the other end to ground,but maybe I have to use one transistor as switch to power the diode with 3V,because I now can see the code with my camera phone but maybe the voltage of 0.20V is not enought to power the diode so that is why my device wont turn on.
What do you think,did I messed up something ?

You need to configure the pins as GPIO (both PWM and data) and set them high to check the AND gate output. As it is changing so fast, a meter can’t pick it up - you’d only be able to see the full swing on a scope.

Ok,I just tested the AND gate when pin1,pin2 is high pin3 is also high in all other cases is low.
So why I cant turn on my dvd player with the ir led ?
`START_TIME_HIGH = 3300.0;
START_TIME_LOW = 1700.0;

/* Pulses are non-information bearing; the bit is encoded in the break after each pulse.
 * PULSE_TIME sets the width of the pulse in microseconds. */
PULSE_TIME 					= 420.0;

// Time between pulses to mark a "1" (in microseconds)
TIME_LOW_1					= 1200.0;
// Time between pulses to mark a "0" (in microseconds)
TIME_LOW_0					= 420.0;

// PWM carrier frequency (typically 38 kHz in US, some devices use 56 kHz, especially in EU)
CARRIER 					= 38000.0;

// Number of times to repeat a code when sending
CODE_REPEATS  				= 2;

// Time to wait (in seconds) between code sends when repeating
PAUSE_BETWEEN_SENDS 		= 0.05;`

I can see there are some parameters maybe I need to change but ir_receiver is not providing them so how to set them for every device ?
I did another measure while the imp is sending data and pwm is rated at 1.5V and the output from pin7 MISO is 0.54 with this kind of data I think that the AND gate cant give the output I want.

As I said, you can’t measure these lines with a meter.

1.5v = nearly 50% of 3.3v, which would make sense as the PWM is half on, half off. Your meter is just averaging the value.
MISO being 0.54v indicates that the data you’re sending is about 16% 1 bits.

How do you have your LED connected to the AND gate? ie, which side of the LED is connected to the output?

i tryed with positive and the negative side and the result was the same I actually dont have transistor after the AND gate I dont see the point using it in this configuration but maybe I had to ?

Well, with the and gate you need to have the LED in so the short leg (negative, goes to the bigger bit of metal in the LED package) goes to ground, and then the long leg goes to the AND gate output with a current limiting resistor.

If this is the wrong way round then the pattern will be inverted. But still, how sure are you that the pattern you’re sending is correct?

Well I use ir_receiver sketch to get the data from the remote and then I replace the code variable inside ir_transmitter with the code I received from ir_receiver.
However still not working tryed already with two remotes.
I dont have the resistor connected to LED but it will die without it I dont believe one resistor to mess the whole signal. :slight_smile:

This is the schematic I am using,maybe this way it will be easier to understand what wrong with with my sender. :slight_smile:

That schematic shows your power and ground rails mixed up (coming from the power supply breakout) - although that might just be an artifact of sketching it up in Fritzing?

yeah its from Fritzing my bad sorry :slight_smile:

…you also have no current limiting resistor in the LED path, and the LED is the wrong way round?

When I reserve it the result are the same :slight_smile:

Like I said, in that case maybe you’re not sending the right code. You’re sending something, but if it’s not correct then obviously it won’t control anything.

Ok so how to get the right code ?