Infrared bridge with Arduino & Thing Shield?


(Brian) #1

I don’t want to reinvent the wheel, but my search on the forum didn’t come up with anything definitive. Has anyone attempted building an IR bridge with an Arudino & Thing Shield?
I know IR libraries exist out there for the Aurduino. I was thinking about a universal device/app that would allow you to learn and mimic remote codes. Maybe this would be a a big help for people with devices like AC units and other misc devices that use IR.

https://learn.sparkfun.com/tutorials/ir-communication


(Convinced ST will never be unbroken…) #2

I would rather just see some SmartThings support for iTachs. All they need is to be sent a simple string over TCP.


(Geko) #3

Well… until that happens, you could bridge ST hub with iTach using Linux (or Mac) server. Just run a simple shell/Perl/Python CGI script that pulls iTach command from HTTP GET and sends it to iTach (using netcat for example). I know it’s an overkill, but if you’re running a 24/7 server anyway, it’s not a big deal.


(Convinced ST will never be unbroken…) #4

I already do that and much more using HAM Bridge.


(Brian) #5

I love ham bridge, but I hate leaving my 300watt computer burning all day just to run a script :stuck_out_tongue:


(Convinced ST will never be unbroken…) #6

As a follow up to this… I was unable to use NC to do it as I found no way to terminate the string with a CR (at least not from the terminal). I currently run a script in python to do this:

#!/usr/bin/python
import socket
HOST2 = '10.0.0.41'
PORT2 = 4998
s = socket.socket( socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST2, PORT2))

s.sendall("sendir,1:1,1,40000,5,1,95,24,48,24,48,24,48,24,48,24,24,24,48,24,24,24,24,23,24,24,24,23,24,24,47,1065\r")

(Convinced ST will never be unbroken…) #7

Pick up a used Mini on eBay. It don’t need much horsepower. I am running an online sale fulfillment app for my business, mail, a transcoding server for my TiVos, an FTP server for streaming media to Android, iTunes, Indigo, and HAMBridge, all on an 8 year old, single core Mini that averages about 30 watts… and actually just checking, that single core is idling most of the time at 13%, so most of the time it is using far less than that.


(Geko) #8

… or pick up a Raspberry Pi ($35 + labor :slight_smile: he-he) < 5 Watt


Daiken Air Con with Arduino?
(leftride) #9

There used to be an old blog post: “Building an IR Bridge with the SmartThings ThingShield” but it doesn’t look like it was ported over when they moved to the new ‘community’

I saved the page and can repost in the info if you’re interested.


(Brian) #10

please. that would be great!


(leftride) #11

Here’s a zip file with the .webarchive, a pdf and a few of the images. Just search for “IR Bridge” in the webarchive or pdf.


(Juan Risso) #12

Hi everyone!
I re-posted the project here https://www.hackster.io/juano2310/building-an-ir-bridge-with-the-smartthings-thingshield.
Hope this helps!


(John Lord) #13

so what is the purpose of the ir-emitting diode in this project? It seems to be designed to trigger smartapps from IR commands, so i don’t understand what the emitter is for.


(Radarcg) #14

I’m trying to follow this project, but have some questions:

What is meant by the line:

“Then attach the data pin to Arduino pin 11.” - What “data pin”?

Also, where do I install the optional resistor??

Then, "Add each of the attributes and commands shown. " – Shown where?


(Juan Risso) #15

Data pin is pin 1 in the IR receiver http://web.archive.org/web/20140821213356/https://www.sparkfun.com/datasheets/Sensors/Infrared/tsop382.pdf

The resistor goes between the pin and the anode leg of the emitter.


(Radarcg) #16

Has anyone updated this to provide functionally so that smartthings can send IR codes via Arduino using a SmartApp rather than a remote?


(Radarcg) #17

in https://create.arduino.cc/projecthub/juano2310/building-an-ir-bridge-with-the-smartthings-thingshield-e399ee

it states to connect the IR transmitter to pin 9, and to edit IRRemoteInt.h to use pin 9 rather than pin 3.

Yet, in the arduino sketch code, it shows

#define PIN_LED 13

I don’t seem to be transmitting out any IR, despite the sketch debug output showing. I’ve also tried changing this value to 9, with no luck. Has anyone gotten this code to work?


(Radarcg) #18

Nevermind, strangely by commenting out lines 44 and 45 of the sketch:

//pinMode(PIN_LED, OUTPUT); // define PIN_LED as an output
//digitalWrite(PIN_LED, LOW); // set value to LOW (off) to match stateLED=0

it now works!

HOWEVER, I now need to figure out how to handle IR “press and hold” versus just press, since my receiver expects the volume controls to be held to change the volume…


(John Lord) #19

send the command in a loop for, say, one second.