Digistump Forums

The Digispark => Digispark Projects => Topic started by: agargautam on August 17, 2012, 07:11:59 pm

Title: IR Remote
Post by: agargautam on August 17, 2012, 07:11:59 pm
I was wondering if digispark along with IR shield can be used as an IR remote to control say a DVD player?
Title: IR Remote
Post by: sparr on August 17, 2012, 09:29:17 pm
the IR shield is for an IR receiver. an ir transmitter is just a special kind of LED, so you could incorporate that into any shield that has room for a LED.
Title: IR Remote
Post by: agargautam on August 18, 2012, 12:21:58 am
thanks sparr for the reply...guess I was not very clear above...my query has two part
1. can IR shild be used to put ir transmitter instead of receiver? your reply suggest that it can be done. right.
2. does attiny85 (used in digispark) will have enough memory to mimic typical dvd player remote (if not all, say 10 odd buttons). There is an arduino IR library (https://github.com/shirriff/Arduino-IRremote) but I am not sure about the memory requirement.
Title: IR Remote
Post by: sparr on August 18, 2012, 08:51:33 am
1. You wouldn\'t want to use the IR shield. The receiver is a lot more complicated, so that shield has a lot of extra parts on it. An IR transmitter is *JUST* an LED, with no additional hardware. If you don\'t want to put anything but an IR LED on a shield, the proto shield would be the easiest way.
2. yes, plenty. look into the tv-b-gone for an example of how many IR remote codes can be fit onto one attiny.

how do you plan to tell the digispark what you want it to tell to the DVD player? that is, will you have buttons or something else?
Title: IR Remote
Post by: agargautam on August 18, 2012, 10:09:34 am
I have quite a few ideas around this, just to tell you couple of them
1. I\'ll like to control my air conditioner through IR transmitter. Essentially control temperature, swing, and on/off function based on room temperature / time of day etc. or even remotely. My AC has basic climate control functions but they are very limited.
2. Similarly in case of DVD player, whenever I switch on DVD player through remote, digispark (with IR receiver and transmitter) should detect the power on command and switch on my TV and yamaha receiver too as well as put my receiver in dvd mode.
Title: IR Remote
Post by: Bluebie on August 29, 2012, 10:19:53 pm
I built an IR Transmitter using an attiny85 (same chip as the digispark) and the v-usb software usb stack already. I\'d be more than happy to publish my source code and schematics for those who\'re interested. It has a ruby interface which works well on Macs - I don\'t know about other operating systems. My circuit is a bit dodgy - I\'m overdriving the AVR\'s outputs and the infrared LEDs, and it doesn\'t seem to play well with some usb ports as a result, but that could be fixed with a few resistors and a transistor. Pics are up on my site at http://creativepony.com/gallery/browse/Craft/Infrared%20Blaster - I use it to control the ceiling fan and light in my bedroom.

My design also includes an RGB LED placed behind the two infrared LEDs as I had a couple of spare pins on my defacto-digispark. I use these as status indicators for various things - if my website goes down, or someone presses the doorbell, it can do little animations. I also have the fan remote program blink the yellow or blue LEDs when sending remote control requests to indicate it\'s working.
Title: IR Remote
Post by: agargautam on August 30, 2012, 10:39:31 am
Final pic of infrared blaster is really cool. I would love to try your code once I get mu hand of digispark.
Title: IR Remote
Post by: lahtinenk on September 01, 2012, 12:55:38 am
I have wondered how I could turn my PC on with a remote control. Perhaps I could wire a MOSFET (or transistor) in parallel with the on/off switch, but I have seen some settings about USB on/off function? Does anybody have any suggestions?
Title: IR Remote
Post by: MichaelMeissner on September 01, 2012, 03:32:56 am
It depends on the PC and the settings.  Some have wake on lan settings, where if you send an IP address to the machine, it will wake up.  But that is probably more complicated with a digispark and overkill.

Some have a setting in the firmware to wake on USB device.  It is probably meant for moving the mouse or keyboard, but it may be more general to wake on any USB event.  In which case you could have the digispark send a message down the USB serial line.  If it is only mouse or keyboard events, then you would have to have some firmware on the digispark that simulates pressing a shift or control key momentarily.  In the Arduino world, the Leonardo is more suited for this than the Uno/Mega are.  I suspect the digispark may be suited for this as well, but Erik and company would have to chime in.

If you don\'t mind hacking the computer itself, it should be a simple matter to use an opto-isolator to simulate the press of the power button (you would do it in parallel to the real button on the case).

You could use the relay shield to turn power on/off to the computer (feeding the power line through the relay).

If you don\'t want to hack the case, you could always use the digispark to drive a servo to press the button.  One of the previous kickstarter projects I backed was \"Roy\" which is a robotic arm/hand/finger and I bought 2 fingers, and I intend to use them to press buttons like camera shutters.

I tend to think using the digispark to simulate a keyboard to do the wake up is perhaps the best solution.
Title: IR Remote
Post by: sparr on September 01, 2012, 01:20:37 pm
You wouldn\'t need a mosfet or transistor to turn on a PC. The motherboard power-button signal is a logic level signal. It isn\'t actually switching the mains power or even the whole 12V rail directly.
Title: IR Remote
Post by: lahtinenk on September 02, 2012, 12:40:44 am
Thank you sparr,

I must search little more information, it has been surprisingly difficult. But basically I just need to connect (5V) logic to the power switch. I have not seen any schematics but my guess is that it is low level signal. Perhaps I need to experiment with timing.

I think the USB power on would be little more versatile and universal.    
Title: IR Remote
Post by: moloned on September 04, 2012, 04:29:26 am
good use for the IR shield :) http://www.ladyada.net/make/tvbgone/

uses the Attiny85 http://www.adafruit.com/category/20

code etc. http://www.ladyada.net/make/tvbgone/design.html
 
Title: IR Remote
Post by: Emerica on January 05, 2013, 10:13:13 pm
What would be really nice is if someone with a little knowledge on the pwn timers to patch the IR Remote library to support the at45.

I got one of the sparks to take the place of my Diecimila which is transmitting remote codes to a led marquee. I have a cronjob that sends the weather to it every 10 minutes.
I made the change over to digiusb easily, to send the text, but transmission of the NEC codes via ir is tricky as the IR Remote lib wont compile and is setup for pin 3 on the Diecimila
I\'m using a Ir shield and have the whole board populated.The bridges are soldered to bring the ir led to pin 0.

Title: IR Remote
Post by: driffster on January 13, 2013, 08:32:01 am
I agree with Emerica, it would be neat, I been using an Arduino to replace a button on a dead remote control (an aspect ratio... the stupid TV doesn\'t have a way to change it without the remote). I wanted to port it to the digispark, but without the library I will have to send the code manually (I\'m using the arduino to decode the protocode and send it with the IRremote library).
Title: IR Remote
Post by: saperlot on January 15, 2013, 07:39:26 am
I\'ve found this ported version for the tiny\'s but i did not yet checked if it works with the Digispark:
https://github.com/TKJElectronics/ATtinyRemote  
Title: Re: IR Remote
Post by: driffster on January 21, 2013, 07:37:39 pm
I\'ve found this ported version for the tiny\'s but i did not yet checked if it works with the Digispark:
https://github.com/TKJElectronics/ATtinyRemote (https://github.com/TKJElectronics/ATtinyRemote) 

Nice, I will test it very soon and I will report back on my success or failure!

It looks like it  might need an external external 16MHz crystal for clock for the original project it was used on.
My first test will be more just to see if it can compile!!




Title: Re: IR Remote
Post by: driffster on October 20, 2014, 11:24:14 am
Ok finally had time to look back at that project.

Using the IRremote library fork from microtherion ( https://github.com/microtherion/Arduino-IRremote ) I was able to send signal (using pin 1) using irsend.panasonic(code,code). Strangely, I was not able to send it using  IRProntoSend from Gus Grubba ( http://www.righto.com/2009/08/www.xcreet.com/IRProntoSend.tgz ), which worked fine on the Arduino. Since I found all the hex codes for my particular remote I do not need the pronto raw code anymore.

Now I'm trying to receive using the digispark, again I'm able to run the dump IRRecvDump  code on my arduino uno and decode the IR signals, but so far porting it to the digispark is problematic: I'm only able to detect a IR signal, not decode it.

Gonna make the digistark as a USB keyboard and output there to see what the problem is. [edit] That aint doable, interrupt conflict.

Title: Re: IR Remote
Post by: marcmerlin on March 31, 2017, 09:13:03 pm
Sadly, no one seems to approve moderated messages, so I'm guessing no one has seen or will see this for a while, not sure if the link works:
https://digistump.com/board/index.php/topic,2626.0.html

Anyway, my question from there:
Infrared (IR) receive with ATtiny167/digispark pro?
Note: This message is awaiting approval by a moderator.
the digistump arduino 1.5.8C IDE I have has infrared receive code, but it seems to only be for the original digispark (at tiny85) and not the digispark pro.
Sadly github z3t0 Arduino-IRremote (can't give the link or my post will get moderated and stay in limbo) also mentions at tiny85 support, but no at tiny167 support.
So, can this work, or not really?