This is the second chapter of a big series of domotics experiments. So we will be used the cloned signal that we obtain in the last chapter. Always with our goal: "keep it simple".
Please check the first part:
So lets get started.
Step 1: The Stuff
We can use an Arduino Uno or Nano. But bare in mind that I have been testing this mostly in Uno. Is should work in every Arduino thought. And finally a simple infrared led. Simple, isn't it?
Step 2: Connections.
I had some issues with this infrared led, because every tutorial that I watched says that you have to add a resistance to protect the led. So did as instructed but found that the led where emitting signals but not bright. Since infrared light is not visible you can check if the led is working using the camera of your cell phone. As I was saying my configuration was not working, the light was not bright enough. After a few trials I decided to remove the resistance. And that was it. By the way I read some where that Arduino slot 13 has an integrated resistance so I started using that one, but I had to use another slot since I needed that slot and fount out that it works in every digital pin. So I thing the resistance might be needed if you need to turn on led an keep it on. In our case the infrared led will be sending signals and means one, is not turned on constantly and two it will be blinking very short periods of time. Not sure, am just a humble programmer.
We are connected, what is next,
Step 3: The Sketch
As you can see the program is a little bit more complex that the one to clone signals, but still is simple. No libraries in order to make it fast. The system loops waiting an input from the serial monitor. In my case I just wait for "1", not very creative sorry, its simply because I am not. You can play around with the code to suit your needs.
Once the command sequence is started the program reads the int array, containing the cloned signal that we obtain in last chapter, and sends it to the method pulseIR() in charge of triggering the led. Bare in mind that I you will have to add a 0 at the end of the array. Don't ask me why i just don't remember why I did it that way. But again your free to play around with the code and make it better. AND IT CAN BE WAY BETTER.
This to take in count,
In this sketch the baud rate is 9600 (wont go far with out setting this on the serial monitor)
Add the zero at the end, or modify the code.
Step 4: What Is Next?
Next chapters I will be showing how to do the same with radio frequencies to handle radio remotes. As you might know is now much different as the infrared signals. We will end up with an array with numbers. We will be processing them a little bit different.
Also I will be be showing you how to normalize the signals, this is to transforms the numbers in zeros and ones or true or false signals, and how to compress the whole signal in order to store it in a db or where ever, for easy handle. As you will found out, some signal are very large, like for example 400 in size or more. Also as you might imagine a compressed signal will facilitate the transference of it through different kind of channels ;)
Not sure what will be first thought. I am kind of lazy this days.
By you all.