Tsop4038 updating to tssp?

Yes, a solderless breadboard has a life expectancy :woozy_face:.

90% of the solderless breadboard jumper wires I use have male Dupont pins.

Very short jumpers, ~1 inch, I use are 22AWG solid copper wire.

I just did an experiment with the following IR detectors which I had in my parts box:

  1. TSSP58038 light barrier sensor
  2. TSOP58238 remote control (legacy long burst)

I used a 38KHz carrier unmodulated with a distance between IR led and IR detector of 3 meters using the code below and a logic analyser to monitor the output of the detector.

// basic 38khz Uno

const uint8_t irPin = 3 ;

void setup() {
  pinMode( irPin, OUTPUT ) ;
  tone( irPin, 38000UL ) ;
}

void loop() { }

The TSOP58238 failed as predicted. If the beam is momentarily broken, it detected when the beam had been restored but then, after a few milliseconds, failed once again to detect the carrier. It appears to reject the constant carrier as interference.
The TSSP58038 performed correctly with a constant carrier. However, if the beam is not quite well aligned, then the detector registered spurious beam breaks of about 1ms at random intervals.

Brilliant, thank you for taking the time to do that. I had progressed to figuring out that the receiver is doing something this morning, with an led and a 220 resistor on the output leg I get a flicker as I pass the beam but it is inconsistent. I shall try with the new breadboard later

I just made a monumental discovery totally by accident, so much so that this could be made into a comic sketch and I've either been really stupid or missed something that by chance I got away with for 8 years of using the originals.
I nudged the board I've been playing on and it partially turned around, my led flickered, I turned it a little, then a little more (you see where we're going now right?) until I had spun it 180 degrees and my little yellow led gave me a glow of approval. I passed my hand through the beam and it made a sad face, removed my hand again and it smiled it's little face off!
Forgive me if I've been a monumental plonker, but for the last 8 years I've had 16 tsop4038s pointing their bulbous side at a couple of tsal6200s working perfectly, but the tssp wants to be flat side out?!
Continuing on rather more promisingly than I was at least. Hopefully it will make you smile. :rofl:

:sunglasses:

Just because something works for 8 years doesn’t mean it was designed right.

:nerd_face:

still a little funky, but certainly stepping forwards, shocking really

1 Like

47 ohm current limit on the ir and I'm only achieving a couple of feet at best and not pulling low properly so I'm still missing something.

Everything I'm looking at suggests the bulbous side of the sensor is the front as I originally thought, so maybe what I'm receiving is bounced ir

am functioning properly, as I should be using this code on an uno which helps massively, now I just need to work out what I am missing in the original code on the micro that I somehow got away with all these years. I had always intended to return and switch to an uno as between myself an an old friend with greater knowledge and equipment for testing we concluded that the accuracy for timing was better on them. can't thank you enough so far

It may not be the Micro. You have said that you use lm339 chips to interface to the TSOP4038 / TSSP4038 chips. Maybe the trigger voltage on the comparator is set too close to a tolerance. Without a schematic to look at this is pure speculation.

:+1:

I hold up my hands, I built it, it worked and I thought no more. Even on the breadboard though I have a distinct difference using the sketch provided vs the original to generate my 38khz. I have low when it should be low, not lower than it was ish

I'm not even sure I could create a schematic now in all honesty, I did draw it all out but I'm missing that from the folder of notes I made at the time.
Possibly something in the 50% duty cycle from the original code, my multimeter registers it as 76khz with a 50% duty cycle, I had no idea at the time what it was doing, I used the code provided by Nick Gammon and it worked, I have a little more experience with the meter now.
I can see the difference here with this tone code, it produces a much more stable result. I shall look at the original code to see if I can apply it there.

tested now, definitely related to the difference between this

// basic 38khz Uno

const uint8_t irPin = 3 ;

void setup() {
  pinMode( irPin, OUTPUT ) ;
  tone( irPin, 38000UL ) ;
}

void loop() { }

and this

 // TCCR1A = bit (WGM10) | bit (WGM11) | bit (COM1B1); // fast PWM, clear OC1B on compare
//  TCCR1B = bit (WGM12) | bit (WGM13) | bit (CS10);   // fast PWM, no prescaler
 // OCR1A =  209;                 // zero relative
//  OCR1B = 104;

Time to treat yourself to an oscilloscope.

:wink:

On a Uno, OCR1A should be 420 and OCR1B should be 210 for 38KHz. The Micro may well be different.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.