2012-02-13

ATtiny13 as IR receiver


ATtiny13 as IR receiver

IR controller is everywhere in your home, but you can not control anything. But if you can follow me to make a very cheap PCB with ATtiny13, you can control most equipment in your home. Out of your home? Maybe more interesting.

What's that stuff?

Generally, it's a PCB can receive IR signal from your IR controller, and control other things like light or TV.Just with a relay.

Why ATtiny13?

ATtiny13 is an ATMEL product, AVR family. This chip is very cheap. If your chip is cheap enough, you can use it anywhere you want.

The chip's power:

1. Small: only 8 pin, 6 GPIO
2. Cheap: $0.3
3. Powerful: 1KB Flash, 64 Byte RAM, 64 Byte EEPROM, up to 20MHz clock
4. Save energy: 240 uA @ 1MHz, <1uA @ power-down mode
5. Most important reason: I like it, :-)

How to recognize IR signal?

Most popular IR signal is defined by NEC. First 9ms signal, 4.5ms no signal, and then is 4 byte data, front 2 byte is address, last 2 byte is reverse to each other.

If chip's software, you need State Machine to change state by input signal right now, and put it in 1 bit. Because ATtiny13 only have 64 Byte RAM, so you can not save all voltage one by one. Transform it immediately, you will only need 4 Byte RAM.

Want debug it? ATtiny13 do not have a serial port, so you can write some status to EEPROM, and read it out later. Maybe it's hard, but it's cheap.

Some IR data

My MacRemote's address code is 0x77e1, yours maybe difference. Signal of buttons:

OK=0x3a5d
Vol+=0x505d
Vol-=0x305d
<<=0x905d
>>=0x605d
MENU=0xc05d
>||=0xfa5d

More feature with IR

IR is very useful for control, you can use it transfer serial port with 9600 bps. And you can use anyother device as adapter between IR and other channel, for example your cell phone as adapter communicate with GSM/3G/4G network.

If you are interested with IR, contact me.

6 条评论:

  1. Hello

    Did you actually got it working?
    I'm interested in making the same, but with RF instead

    回复删除
    回复
    1. Yeah, it's working well. I modify it to controll more device by simulate a SPI port to 74HC595.

      If you are interesting with it. I can give you my code. I've used all 1KB Flash, no byte left.

      I think RF is more expensive then this board. I just make it less than $1.5

      删除
  2. hi can i please have the code and schematic?
    thanks
    nagrlight@gmail.com

    回复删除
  3. can you share the code and schematics?
    mail me at rohit.dhara1@gmail.com

    回复删除
  4. Can you send me the code and hookup diagrams?

    Thanks

    回复删除