Problems with photodiode IR Receiver

I'am currently doing a project which im trying to receive i signal from a remote in IR and read it, but the remote is costum made and i cant figure out its frequency, i dont have no money or way to check its frequency, i am only sure that it isnt 38kHz since ive tried it with an TSOP that i had, so i'am trying to do an photodiode that receives the signal and then i wanted to analyse it with an arduino to read the bits, and then be capable of reading the message, but i am having trouble in reading the signal with the photodiode because i can't understand how it works, and im also having an hard time amplyfing the signal.
Hera are the components i used :
The photodiode (BPV22NF)
Amplifier (OPA344PA)
And this is the current schematic that i used for the OPA344PA

I'am out of ideas, i tried a lot of different things but nothing seems to work, at first i was capable of reading a tiny difference on voltage from the photodiode but now i cant read anything at all, i'am out of ideas, i can't buy an oscilloscope, can someone please help me out?

Please post a complete and correct schematic. The op amp is not powered.

1 Like

I picked this schematic and copied it but that isn't even the main issue anymore, so as i said in the last post i have an TSOP (32238) and i was trying to read the signal sent by a costum remote control, but i only got random raw values, and i did the same test with a samsung remote controller and it worked out perfectly, so i got the idea that it was the wrong frequency, then i decided to read the signal with arduino to try and read the bits that were sent, but with the TSOP as you might guess doesn't work, any "rule" (like trying different thresholds) you might try the bytes are always different for the same button, so i wanted to do it with an photodiode ( BPV22NF), but i can't understand how this photodiode works since its not splicit what is the anode what is the cathode and i cant read any peaks, is it because im not yet amplifying it? still i also was reading with the analog the voltage that was going out and it wouldnt go up even if i sent IR.

Is it because i really need to amplify the signal? And if i do how does an OPA344PA works? Because ive tried this too :


that is in the data sheets but it seems i cant amplify anything at all.

I saw a system with the same remote controller that it worked but it is in the company i work for so i cant give much details, but if i might resume they just used also photodiodes and modelated the signal.
I would like to do something like that or to find out the frequency so i can buy the right TSOP.
Any ideas?

Like what kind of? Did you save any?
Are you sure the remote is working?


These are some exemples of what i get when i use the TSOP with the costum remote controller.

Also i'am sure it is working since i saw the IR lighting using my phone camera and there is that device at work that uses photodiodes that can read the IR signal.

Would you like to see my code?

Doesn't look raw output of any kind.
What code are you using?

I also did this code to check the highs and lows as i explainned to try to see a patterns (i did it using the TSOP that i have)

#include <LiquidCrystal_I2C.h>  
#include "Arduino_LED_Matrix.h"

#define IR_PIN 2

unsigned long durations[100];
int count = 0;

LiquidCrystal_I2C lcd(0x27,  16, 2);

void setup() {
  pinMode(IR_PIN, INPUT);
  Serial.begin(115200);

    lcd.init();                      // initialize the lcd 
  lcd.backlight();

}

void loop() {
  while (digitalRead(IR_PIN) == HIGH); // Wait for signal to go LOW
  count = 0;

  while (count < 100) {
    unsigned long duration = pulseIn(IR_PIN, LOW);
    durations[count++] = duration;
    duration = pulseIn(IR_PIN, HIGH);
    durations[count++] = duration;
  }

  Serial.println("Signal:");
  for (int i = 0; i < count; i++) {
    Serial.print(durations[i]);
    Serial.print(" ");
    }

  Serial.println("\n---");
  delay(1000); // Small pause between readings
}

189482 756 1614 726 1637 729 2035 728 2286 758 1869 728 2647 730 1656 728 2500 728 1498 726 1762 729

201357 728 2071 728 1929 731 2621 728 1762 730 2751 727 1552 730 1551 757 2504 728 1656 726 1993 727

212653 754 1692 730 1849 730 2841 730 2037 730 2566 730 1413 728 2301 757 1799 728 2048 732 1854 728
Here are some exemples of what i got, each time it is different but we can clearly see that there is a bigger time in the beggining showing the start of a new arriving information, like most of the IR communication protocols, but then it is impossible to understand the bits received.

This is my main code where i did the raw IR values :

#include "CodigoGeral.h"


void setup(){

  pinMode(PINREAD, INPUT);
  pinMode(PINWRITE, OUTPUT);


	Serial.begin(9600) ;
  matrix.begin();
  irrecv.enableIRIn(); // Start the receiver
  irrecv.blink13(true);

  //lcd_on() ;
  lcd.init();                      // initialize the lcd 
  lcd.backlight();


}



void loop(){

  int value = analogRead(PINREAD);
 
  float voltage = value*(5.0/1023.0) ;
  bool currentState = value > threshold;

  if (currentState != lastState) {
    unsigned long now = micros();
    unsigned long duration = now - startTime;
    startTime = now;

    //Serial.print(lastState ? "HIGH: " : "LOW: ");
    //Serial.print(duration);
    //Serial.println(" us");

    lastState = currentState;
}

  lcd.setCursor(0, 0);
  lcd.print("DOCA");
  lcd.setCursor(0 ,3); //Coloca o cursor do display na coluna 1 e linha 2
  lcd.print("PESCA");  // Comando de saida com a mensagem que deve aparecer na coluna 2 e linha 4
  lcd.backlight();  
  lcd.setCursor(6, 0);

  if(irrecv.decode()){

    lcd.print(irrecv.decodedIRData.decodedRawData, HEX);


    Serial.println(irrecv.decodedIRData.decodedRawData);
    irrecv.resume(); // Receber proximo valor 
  }
  
  lcd.setCursor(8 ,3); //Coloca o cursor do display na coluna 1 e linha 2
  lcd.print(voltage); 
  lcd.setCursor(13 ,3); //Coloca o cursor do display na coluna 1 e linha 2
  lcd.print("v"); 


    LedMatrixFish () ;





}

This is the Header

#include <SPI.h>
#include <RF24.h>
#include <Wire.h>
#include <IRremote.h> 
#include <LiquidCrystal_I2C.h>  
#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;
const int threshold = 512; // Adjust this based on your signal level
unsigned long startTime;
bool lastState = false;

#define PINREAD A0
#define PINWRITE D7

IRrecv irrecv(2);
LiquidCrystal_I2C lcd(0x27,  16, 2);

uint8_t frame[8][12] = {
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};

void Fish(void){
  

  frame[0][7] = 1;
  frame[0][8] = 1;

  frame[1][4] = 1;
  frame[1][5] = 1;
  frame[1][6] = 1;
  frame[1][8] = 1;

  frame[2][3] = 1;
  frame[2][8] = 1;
  frame[2][11] = 1;

  frame[3][2] = 1;
  frame[3][5] = 1;
  frame[3][9] = 1;
  frame[3][10] = 1;

  frame[4][2] = 1;
  frame[4][9] = 1;
  frame[4][10] = 1;

  frame[5][3] = 1;
  frame[5][4] = 1;
  frame[5][7] = 1;
  frame[5][8] = 1;
  frame[5][11] = 1;

  frame[6][4] = 1;
  frame[6][6] = 1;

  frame[7][5] = 1;
  frame[7][6] = 1;

  frame[3][10] = 1;
  frame[4][10] = 1;
  frame[5][11] = 1;
  frame[2][11] = 1;

  frame[1][11] = 0;
  frame[2][10] = 0;
  frame[4][11] = 0;

  frame[6][11] = 0;
  frame[5][10] = 0;

  matrix.renderBitmap(frame, 8, 12);



}

void FishUp(void){
  


  frame[1][11] = 1;
  frame[2][10] = 1;

  frame[4][11] = 1;

  frame[4][10] = 0;
  frame[5][11] = 0;
  frame[2][11] = 0;



  matrix.renderBitmap(frame, 8, 12);



}

void FishDown(void){
  


  frame[6][11] = 1;
  frame[5][10] = 1;
  frame[4][10] = 1;


  frame[3][10] = 0;
  frame[5][11] = 0;
  frame[2][11] = 0;



  matrix.renderBitmap(frame, 8, 12);



}

void LedMatrixFish(void){

Fish();
delay(55) ;
FishUp() ;
delay(55) ;
Fish();
delay(55) ;
FishDown();
delay(55) ;


}

2nd and 3rs sample look pretty much same. I wonder if it would not work when transmitted.

Did you ever try to receive/decode with IRremote library example code?

I did and i got the random values that i sent you earlier, the random raw values i talked about, and the 2nd and 3nd look similar but i tried multiple times and they are always different, but then again im sure that this costum remote control is not at 38kHz so the TSOP might be eraising or changing information, thats why i wanted to use the photodiode still i cant put it to work.

That output on your image is not from Irremote example.
Install the new library 4.4. and try with SimpleReceiver.ino

and post what you get on serial monitor.

If everything else fails, you could use TSMP58000 or TSMP98000, from Vishay. They are without demodulation and should be able to receive 30-60kHz signals.

This is what i got

Still lot of shifting, maybe you're right about the frequency.

Remove the line
#define DECODE_NEC
from the example code.
Let's see if it can decode something.


Same random values, is there any way to do it using an photodiode BPV22NF and an amplifier OPA344PA or i need other material?

It's strange. Marks are quite solid 700us, but space varies quite a lot. Also sum varies.
But definitely a signal, not some random crap.

I don't know, but I doubt you easily get better output with that setup.

Can you post a copy of your circuit of the IR tranmitter, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Tom.... :smiley: :+1: :coffee: :australia:

The only problem is that in where i live i dont have easy access to TSMP98000 or TSMP58000, the only shop i have access is https://mauser.pt/catalog/, so my only options are either try buy some TSOP's and try them out (there are TSOP's of 30kHz and 36kHZ), but still i cant be sure of what frequency i'am at or i would need to try improving the photodiode, because the system used in my work to read the IR signal from the remote control is also something similar, with photodioded and amplifiers, i was trying to do something like that but i'am not that good.

Wait, if you get some replies from smarter guys than me.

I can't really imagine how the signal can be like this.
I could understand if signal +750, -750, +750, -750 was corrupted the way it was read +750, -2250.
But the output shows that's not the case:


There is too much difference between two signals.

Thats why i was struggling the most, i don't understand how it was possible to read this signal, i guess the difference in values is because of the frequency, since the TSOP must have a bandpass filter at 38kHz, i will wait to see if there is any other people that could help.
Thanks anyways for everything.

Even if the frequency was wrong, the time shouldn't change like that.
Look at the circled values, there are rock solid 750us marks on both side but the space between varies a lot between two "equal" signals.

If you have any 3.3V arduino board, you could hardwire the remote emitter to arduino pin.