Help required with RGB signals

Thread Starter

jay4708

Joined Jul 28, 2014
12
Hello,

I'm after a little help with a project I'm working on please.

I have a nurse call system for an hospital ward that has rgbw LEDs for the lights outside the rooms.

I've been asked if I can find a way to take a signal from the over door lights for each different colour that it displays.

There are three different conditions that I am interested in, they are:-

Patient call - Steady Amber
Assistant call - Flashing Yellow
Emergency call - Flashing Red

I've attached some scope traces for the red and green pins, there is nothing on the blue and white pins for the above conditions.

What I would like to be able to do is take these signals and input them into a PIC or an Arduino and produce and output for all three call levels, is this possible?

Thank you in advance for any help you can give me.

Thanks
Jay

InShot_20200415_082002144.jpgInShot_20200415_082104740.jpgInShot_20200415_082312173.jpgInShot_20200415_082450962.jpgInShot_20200415_082645099.jpgInShot_20200415_082819986.jpg
 

LesJones

Joined Jan 8, 2017
2,687
If you are using a PIC (Or any other micro.) doing it in software would be the simplest way. What is the state of the red and green signal lines when no LEDs are illuminated. Are there three individual LEDs (Amber , yellow, red) or is it a single LED package with different coloured and the apparent colour decided by the mix of the individual LED colours ? I suspect that this is the case by your use of the term "rgbw LEDs " Are there 5 connections to the LED (Common and 4 colours.) ? Is there any electronics in the unit with the LEDs ?
It looks like the apparent colour is controlled by PWM modulation of the red and green LEDs. One PWM cycle seems to be a bot 57 uS. to detect the colour I would connect the red and green signals to two input pins on the same port and configure then to interrupt on the rising edge. I would then sample the two signals after about 6 uS and about 50 uS. from the these two samples you can work out the colour. To determine if it is steady or flashing just do some timing tests. This sounds like a homework question. Is it ?

Les.
 

Thread Starter

jay4708

Joined Jul 28, 2014
12
Hi Les,

Thank you for the reply.

The red and green signal lines are both low, down to 0v when there is nothing illuminated.

They are 'single LED package with different coloured and the apparent colour decided by the mix of the individual LED colours', there is 5 of them grouped together.

As I have just looked closer to the LED's there are only 4 pins, so they must be just RGB LED's, I was following the silkscreen on the PCB which has RGB pins and then a WHI pin, my bad.

Yes there is further electronics around the the LED's, surface mount resistors and a few transistors (5AW56).

Thank you for the suggestion you sent.

No it's not an homework question, I am an nurse call engineer and I've been asked by an hospital if I can take a signal from an existing over door light and then produce alarm tones from it, the alarm tones I'm ok with it's just the this part I'm struggling with.

Thanks
Jay
 

LesJones

Joined Jan 8, 2017
2,687
Hi Jay,
I would suggest tracing out the schematic of the PCB. How many wires come into the PCB ? I am wondering the PCB is just to drive the LED from logic level input signals. Or do they go directly to the buttons that trigger the the LED colour and flashing ?
I think an 8 pin PIC such as the PIC12F1840 would do the job. (Or a Atmel Attiny13a if you are more familiar with that family of microcontrollers. )

Les.
 
I'm only going to throw something out here. One has to do with power supply. Independent or use what it has to offer?

You have to protect the inputs if a CPU is unpowered while the call system is powered. if you need fast signals you can use an LT6700 series comparitor. Those chips are part of the over the top series where inputs can exceed the supply. NANDing or ANDing the signals may or may not be able to make life easier.
 

LesJones

Joined Jan 8, 2017
2,687
Dana's post #6 made me think of another possible solution. If the green drive signal is passed through a low pass filter (To average the value of the PWM.) then it could be fed to a window detector to detect three possible states. Zero when off, between about 15% and 40% for amber and above about 60% for yellow. These signals together with the red drive signal (which is only ever fully on or fully off) could be fed into a few logic gates to give the desired outputs. (A variation on this idea would be to use the ADC in a microcontroller to do the window detection.)

Les.
 

danadak

Joined Mar 10, 2018
4,057
One approach, single chip would be a duty cycle/pulse width measurement as you suggest.

Design has a muxed front end to select R or G or B for measurement. Note there is enough HW
present in chip to just replicate, toss the mux, and make this a 99% HW only solution.

As you can see in right hand window few of the chip resources were used, eg. available for
other stuff in your design. None of the analog was used for example.

1586980844594.png

Regards, Dana.
 
Last edited:

Thread Starter

jay4708

Joined Jul 28, 2014
12
Thank you Dana, this evening when I'm back at my desk I'll do my best to get my head round what you have just sent, on a bit of a learning curve here, thank you it is much appreciated.
 
@danadak

Really bad explanation. Where is the "D" in enable counter via D. You need to have designations and do a little bettter job explaining how it works.

Your posts bring up the "If all you have is a hammer, you look at every problem as a nail". it's not a bad thing, Usually it is.
keep us educated.

Aside:
Been thinking, back burner kind of stuff, about an IR receiver for a carrier freq between 70 and 80 kHz. Don't have the number handy. Net searching says you need an IR receiver which is a feat in itself with AGC. The AGC is based on a peak detect. Here is a modern photodiode amp. Suggestions to use a large area photodiode.

it's my understanding that les than a 50% duty cycle is used to conserve batteries in the transmitter. I can find/calculae the duty cycle. The "1"'s and "0's are basically two widths of the carrier. The output of a normal TSSOP is open collector with a 5V supply.

This particular obsolete remote has no preamble to set the AGC.

It's been suggested that the lock detector can be used to detect a zero or 1 using a PLL. https://www.flippers.com/pdfs/MC3373-full.pdf

The selectivity comes from being able to filter the carrier with a bandpass filter.

research:

Cypress: Might be a good idea: https://www.cypress.com/file/60101/download
PLL demystifying.

LT1319 Obsolete muti-standard IR receiver
https://www.analog.com/media/en/technical-documentation/data-sheets/1319fb.pdf

Peak detector might be useful
https://www.analog.com/en/technical-articles/ltc6244-high-speed-peak-detector.html

ONSEMI Application Note: https://www.onsemi.com/pub/Collateral/AN1016-D.PDF
Infared sensing and data transmission fundamentals

TSOP98200 for code learning remotes: http://www.vishay.com/docs/49604/pt0048.pdf
Wide band IR. You loose selectivity and hence range. You have both an IR filter and a filter for the carrier frequency to reject CFL and sunlight. The AGC has to control the AC gain.


I could put this in a separate thread if you want to think about it.
 

crutschow

Joined Mar 14, 2008
25,269
I don't think it's been mentioned, but you probably want to isolate the RGB signals from the detection circuitry and micro by using opto isolators.
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
One other approach you could use is the color sensor (post # 6) and an ESP8266 and wireless
the color to another ESP8266 to process, eg. alarm, display, etc.. Just a thought. You could even
manage the remote ESDP8266 in low power mode to conserve battery life.

There are tons of projects on web/youtube using ESP8266, Arduino platform can be used as IDE/
programmer.

Only downsides is its A/D accuracy apparently poor, has only one A/D input (you would need external
mux to handle) or use one of the I2C sensors Avago makes.

Food for thought.


Regards, Dana.
 
Last edited:

Reloadron

Joined Jan 15, 2015
5,614
Have you looked at how a RGB LED makes different colors? Red, Green and Blue are all represented using 0 to 255 (0 to 100%) PWM. So for example Red is 255, 0, 0 Green is 0, 255, 0 and Blue is 0,0, 255. Yellow for example is Green and Blue so 255, 255, 0. That's the RGB color scheme. A Google of Color Picker should bring up some results.

Also, before you try to transmit anything including WiFi or Bluetooth in a hospital I would check with their IT department. Hospitals and other places can be funny about things like that.

<EDIT> Fixed Yellow </EDIT>

Ron
 
Last edited:

danadak

Joined Mar 10, 2018
4,057

ElectricSpidey

Joined Dec 2, 2017
1,194
Yea, when I first started to work with color TVs I was very confused, because we all learned the primaries were Red, Blue and Yellow in school.

I'm not so sure that chart is up to date...100% Red and 100% Blue is actually Magenta not Purple.
 
Last edited:

djsfantasi

Joined Apr 11, 2010
6,719
The “If all you have is a hammer...” reference made me think of something.

Arduino C has a function that measures the width of a pulse with one statement. if you connect three pins to the LED leads, you can continuously monitor the LED state. Within a certain error range, you can build a map of the three pulse lengths to a specific situation.

Take a look at the pulsein() command.

An easy sketch could be written to “learn” what conditions each set of LED signals corresponds to.

The application is straightforward enough so that even an Arduino Nano would suffice.
 
Top