Author Topic: Using phototransistor to disable RX/TX LEDs  (Read 290 times)

0 Members and 1 Guest are viewing this topic.

Offline dagnumTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Using phototransistor to disable RX/TX LEDs
« on: February 11, 2023, 08:43:48 pm »
Hi,

I'm designing a very low power data logger and thought I was being clever by powering the RX/TX LEDs through a phototransistor. The idea is that when the logger is deployed inside a dark enclosure the lights don't use power, but when someone opens it up to check if it is working the lights will flash to let us know it is still alive. It's my understanding that the RX/TX LEDs light up when the lines are driven low by the interface chip (CH340 here), and that anything I do with the LEDs should not affect the communication. I have spun up 50 of these boards and noticed a couple weird things I'm not understanding.

  • If I placed my finger over the phototransistor during upload the code upload fails. Can anyone explain why this is different than if I had no LEDs at all?
  • When I cover the phototransistor completely there is still a very faint light. Is it not possible for this to turn completely off?

In retrospect a more flexible design would be to have the microcontroller read a signal from the phototransistor and then code a threshold for powering the LEDs. I thought this would be a simple analog design though.

edit: Here is a link to the specific phototransistor if it is helpful. https://www.digikey.com/en/products/detail/everlight-electronics-co-ltd/PT17-21C-L41-TR8/2675873
« Last Edit: February 11, 2023, 09:02:00 pm by dagnum »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: Using phototransistor to disable RX/TX LEDs
« Reply #1 on: February 11, 2023, 09:38:47 pm »
This ptototransistor specifies 100 nA for Collector Dark Current. And you are probably not completely covering the sides and all. Modern LEDs are stupid efficient and might be visible even at that current. And I would not be too concerned by this extra consumption.

I run all my indication LEDs for indoor use at single uA typically and this is plenty for stuff on the development boards. They are blinding otherwise.

Look with the scope at the RX/TX lines and see what exactly fails. You may be touching some pins while covering it  and inducting some noise or something like this. I don't see why this would not work.

And for a cleaner test, just remove the transistor on one of the board and see if you still have an issue.
Alex
 

Offline dagnumTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Using phototransistor to disable RX/TX LEDs
« Reply #2 on: February 11, 2023, 11:33:12 pm »
Thanks, I'll look into the uploading issue more. Glad to hear there isn't a huge mistake here.

Future revision may just exclude the phototransistor entirely and just have higher value resistors. You're right about the efficiency of these LEDs and how little current you really need.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf