General > General Technical Chat

making a simple IR transmitter

<< < (3/7) > >>

DrG:

--- Quote from: msuffidy on October 28, 2020, 09:21:16 pm ---((I used a Linkit 7697 and this simple circuit:))
 It is a bit more complex than I was thinking about.

--- End quote ---

Well maybe not as complicated as you might think. I could not see your remote very well in the video, but the ones that I have seen look something like this one: https://www.amazon.com/SUPERNIGHT-Controller-Compatible-Assistant-Working/dp/B08HVVRPBH/ref=sr_1_20?dchild=1&keywords=IF+Rgb+Controller&qid=1603921702&sr=8-20

Basically, there are three LEDs, R, G, B and using PWM you vary the duty cycle of each - that can get you to a mess of colors. So, you need to find the codes for selecting R/G/B and then the ones that bump the duty cycle up or down (likely brightness +/-).

So, if one color is B R=70%, Green=20% and B=50% and you change the PWM duty cycle on blue - by sending the command to increase brightness (duty cycle). It is probably the case that each brightness command increases/decreases duty cycle by a set amount - say 10%, so you would need to track that and provide multiple commands.

Going to preset colors is the same thing, but easier. You could go to duty cycle=0 for all three and then step them up to their presets.

The whole issue of color mixing with LEDs is fascinating. Some years ago (probably 10) I heard about PWM and a little PIC chip (12F1572) that had three 16 bit, PWM registers and I spent a ton of time learning with that chip. I made a "party light" ooooooahhhhh using just that chip and a couple of batteries and a step up. It goes through Roy G. Biv and some other "scripts". Works great, BUT mixing colors smoothly - going from orange to indigo for example is not trivial and there can be more math than my aged neurons can entertain...still it works and I think you should play around with your set up - you have the vision already, now you just need the code and parts to cooperate.

Of course I could be all wrong about this :)





msuffidy:
I harvested a IR led that is seen by the sensor that also saw the remote for the lights. I can see it using only the reverse cam of my iphone. I hooked it directly to an AAA battery, which is maybe not a great idea to see if it worked but also the sensor got random trash as it connected/disconnected it. What I am expecting to see is this light thing, which I got for $6 Canadian is probably just going to have codes for like 12 colors. It seems I can switch pretty fast between them so I can make fast switching transitions, kind of pwm, but they may become stroboscopic. I am reviewing the 8051 dongle to see what the pins are exactly. I am not sure any of these pins can be used as a GPIO if this is the correct diagram. I suppose I could recalculate powering it from the 5V rail. I don't know what the source amperages are, I guess I could measure them first. I should be going for 1.2 V on the IR led and 20mA? If things work out I would run a small ribbon cable from the pinout to a small network of soldered components, and probably incase  them all in a glue gun blob.

I also have a Renesas M16C thing that appears to have GPIO headers. Maybe this one is OK, I think the diagram is not the right one. Now I am unsure if I can actively send it USB comm after using the USB to program it. I was going to send it a transmit frame at a time through USB.

Peabody:
Here's info about the NEC IR protocol:

https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol

All IR remotes use a carrier so they can't be triggered by ambient light, even direct sunlight.  The NEC protocol is the most widely used, but manufacturers can use their own system.

If you want to mess with an Arduino, they have an IRremote library that does most of the code for you.  It will even capture what the Chinese remote is sending if you have an IR photodiode sensor.  Or you may find that your IR LED can be used as a weak sensor.  But you can also probably capture the pattern on your scope if you connect the probe to the the LED driving pin of the Chinese remote.

Also, don't forget about one of the few free lunches in electronics.  If you have enough voltage on the rail, you can drive two IR LEDs in series after adjusting the resistor value.  Instead of dropping half the power in the resistor as heat, you use that power to generate twice as much IR.   Same total current.
 


msuffidy:
I agree the Arduino solution would be the easiest, just I want to do this buying $0 of new equipment. I suspect it can be done.  It is pretty straightforward to just sample the signals and send individual ones. Decomposing and generating them is another problem.

Actually I have been thinking about the problem and what would be just the easiest thing to do without really knowing what is involved is say like output has an address or some other API call and the usb bridge thing may have a chip address. Just keep polling the input character for say 0 or 01 and set the output led. Then the computer can send a constant stream of 1 or 0s through the usb and use the devkit dongle as a led switch. It may be more like static like it is usually 00 but if it is 01 or 02 for example you could set it 1 or 0.  Nope this may be a job for getchar() of fgetc().

Does this mean the GPIOs are 15mA?

I have 2 of these transistors from a CFL light here. Are they too far from the 5V range? I am thinking they will work.

msuffidy:
I had 2 usb devkits. The Renesas one right away looks like the programmer is USB and otherwise there is no communication with the computer. The other one, the Uscale X800 looks like you can program the chips, and also there is a serial uart line open to the host. The big problem is if you are not using the windows devel software I am not sure the program runs on startup or not. There are 3 different controllers sharing the same pin header, and I don't specifically know how this all works unless the devel software is controlling them all by JTAG before they start.

The uscale xc800 has a JTAG unit and a serial unit. It may be possible to just write address into the microcontrollers to set GPIO without them even properly running using JTAG. Or if may be possible to get them running using JTAG from linux.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod