Hi,
I would like to make IR / RF 433 MHz Sensor with EEPROM / SD card memory.
Features of this sensor:
- Sending out and getting codes:
- IR codes using IRLib or IRremote libraries.
I have UPC Philips PVR decoder. IR codes from remote of this decoder are not recognized by IRLib and IRremote libraries and are saved as RAW codes. These RAW codes take up much space. Problem is that IRLib and IRremote can't save long RAW codes. This problem is described in Martin's blog. Martin has edited IRremote library to get long IR signal. I managed to do the same with IRremote library and I could getting long raw codes from my remote. Code which I received I send out using IR LED and IRLib. Here is the sketch. I tried to get long RAW codes with IRLib but without success, because I can get only the first half of RAW code. The second half of the code which is copy of the first half of the code is not received. Even I tried to introduce some change in IRLib.cpp, but it does not change anything. Diff of IRLib.cpp is here. Maybe I have to make other changes in code? - RF 433 MHz codes to turn on/off sockets like this using that library. I wrote this sketch with Hek’s help. Using this sketch I can get and send out codes from/to remote to turn on/off sockets. Example of this code is: “356428203”, where 3 last digits are period of sending code.
- IR codes using IRLib or IRremote libraries.
I would like to keep RAW IR codes on the side MySensors node. I wonder if use EEPROM memory 24LC512 or micro SD card with this adapter.
24LC512 EEPROM memory VS SD card:
-
Pros for 24LC512 EEPROM:
-
I2C interface
SD card uses SPI interface like NRF24L01. It may causing conflict with NRF24L01. -
Library for I2C EEPROM takes less memory than SD library
-
EEPROM is cheaper than SD card and adapter.
-
Pros for SD card:
-
Faster than EEPROM
-
Easier to use, because don’t need to implement more complex algorithm for EEPROM memory management.
-
It is possibility to easy access data from SD on PC. For example to make a backup.
-
Much more space than EEPROM (e.g. 2 GB vs 64 KB. One RAW code is about 250 bytes)
I think about communication between gateway – IR/RF node.
There will be 3 scenarios:
- IR/RF node -> gateway
Received new code from IR/RF sensor
Message structure:
radioID; childID; messageType; subType; payload
IR/RF node ID; childID; Set Variable; V_IR_RECEIVE; 0 - RAW/1 - NEC/2 - Sony/3 -RC5/4 -RC6/5 - JVC/6- NECx,7 - Panasonic_old, 8 – RF433 code, Code_length, code
If type of code is RAW, sending code is hash. - Gateway -> IR/RF node
Send out IR/RF signal.
Message structure:
radioID; childID; messageType; subType; payload
IR/RF node ID, childID; Set Variable; V_IR_SEND; 0 - RAW/1 - NEC/2 - Sony/3 -RC5/4 -RC6/5 - JVC/6- NECx,7 - Panasonic_old, 8 – RF433 code, code - Gateway -> IR/RF node
Save last received RAW code to node’s memory
radioID; childID; messageType; subType; payload
IR/RF node ID, childID; Set Variable; V_IR_SAVE; 0 - Gateway -> IR/RF node
Erase specific RAW code from node’s memory
radioID; childID; messageType; subType; payload
IR/RF node ID, childID; Set Variable; V_IR_ERASE; code
Data stored on a node’s memory:
- Hash of RAW code
- Code
Data stored in Ago Control’s json database:
- nodeID
- childID
- Internal ID of virtual device, e. g.: TV Samsung, AV receiver, air conditioner…
- Code type: 0 - RAW/1 - NEC/2 - Sony/3 -RC5/4 -RC6/5 - JVC/6- NECx,7 - Panasonic_old, 8 – RF433 code
- Code(if RAW – hash of code)
In Ago Control I plan to add IR/RF plugin. Using this plugin I could:
- Adding and removing devices (e. g. TV) with push buttons
- Learn codes from getting messages
- Saving and removing RAW codes from node’s memory (Not directly but when push button with RAW code is added or removed from ago control database)
Currently I’m more inclined to use SD memory, but I doubt if SD library fits to Arduino flash memory. In addition, I wonder if there will be SPI interface conflict between SD card and NRF24L01.
What do you think about my idea?