Controlling SC2262 433MHz from Arduino via Dout on chip.

I am in the process of building a thermostat. As a part of that, I decided to use RC switches as a simple (at least I thought) and safe way of turning on and of a heating element.

I am using a commercial 433 MHz RC set for 240V made by EverFlourish, similar to this one. The Transmitter is a EMW200TA with a SC2262 chip in it. The receiver is an EMW201RA. I am using an Arduino Uno.

According to a post (link found at the bottom. For some reason I cannot make any more hyperlinks), it is possible to solder a wire directly to Dout (second from top on the right side) on the SC2262. In his post he said it was possible for, among other chips, the PT2262, and that one seems to be compatible with the SC2262. I did just that, downloaded the library, the code is compiling, and as I chose to hook it up to pin 13, I have visual confirmation that the arduino is really sending A signal of some sort. The LED on the RC transmitter is not lighting, and the receiver has no reaction neither. While it is hooked up to the arduino I can still use the buttons normally and the thing definitely does work.

Have I made a big mistake and misunderstood something important, or is this setup supposed to work, given that the solder is good?

I am on a low skill level in Arduino and electronics, so excuse any obvious faults or inaccuracies.

I thank all help I can get!

Simple code from the project site referred to, and the one I have tested with.

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch ();

void setup() {
  // put your setup code here, to run once:
mySwitch.enableTransmit (13);
}

void loop() {
  // put your main code here, to run repeatedly:
mySwitch.switchOff(1,2);
delay(1000);
mySwitch.switchOn(1,2);
}

Talk about site Control Appliances From An Arduino: The Start Of Home Automation

Library linked to from site above, and the ones downloaded GitHub - sui77/rc-switch: Arduino lib to operate 433/315Mhz devices like power outlet sockets.

The article you're working from has left out most of the information, and the method you're using cannot possibly work.
There is a lot more to it than that article says. It's just one more example of the garbage that's floating around on the internet.

First point, you're connecting an Arduino output to the output pin of the SC2262 chip, to drive the input pin of the RF transmitter. You risk destroying the SC2262, your Arduino, or both by doing that. You can't ever connect two outputs together.

Ignoring that for the moment, an SC2262 is an encoder, which sends a unique code for each button pressed. Your receiver will not work unless you send the correct codes. The codes are set on the SC2262 and the SC2272 by connecting some address/data pins high, some low and some open, (tri-state).
Before doing anything else, you need to use the RCSwitch library to record the codes received at the receiver, (or possibly by recording the codes from the transmitting SC2262's "Dout" pin), when each button is pressed. Then you set up the transmitting Arduino to send those same codes using the "RCSwitch" library's transmitting methods.

For instance, here's the simple example from the RCSwitch library to receive and display codes:-
(In this example, you'd need to connect Arduino pin 2 to the "Din" pin of the SC2272 chip in the receiver.)

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) {
    
    int value = mySwitch.getReceivedValue();
    
    if (value == 0) {
      Serial.print("Unknown encoding");
    } else {
      Serial.print("Received ");
      Serial.print( mySwitch.getReceivedValue() );
      Serial.print(" / ");
      Serial.print( mySwitch.getReceivedBitlength() );
      Serial.print("bit ");
      Serial.print("Protocol: ");
      Serial.println( mySwitch.getReceivedProtocol() );
    }

    mySwitch.resetAvailable();
  }
}

This is the library's basic code to send codes:-

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {

  Serial.begin(9600);
  
  // Transmitter is connected to Arduino Pin #10  
  mySwitch.enableTransmit(10);

  // Optional set pulse length.
  // mySwitch.setPulseLength(320);
  
  // Optional set protocol (default is 1, will work for most outlets)
  // mySwitch.setProtocol(2);
  
  // Optional set number of transmission repetitions.
  // mySwitch.setRepeatTransmit(15);
  
}

void loop() {

  /* See Example: TypeA_WithDIPSwitches */
  mySwitch.switchOn("11111", "00010");
  delay(1000);
  mySwitch.switchOn("11111", "00010");
  delay(1000);

  /* Same switch as above, but using decimal code */
  mySwitch.send(5393, 24);
  delay(1000);  
  mySwitch.send(5396, 24);
  delay(1000);  

  /* Same switch as above, but using binary code */
  mySwitch.send("000000000001010100010001");
  delay(1000);  
  mySwitch.send("000000000001010100010100");
  delay(1000);

  /* Same switch as above, but tri-state code */ 
  mySwitch.sendTriState("00000FFF0F0F");
  delay(1000);  
  mySwitch.sendTriState("00000FFF0FF0");
  delay(1000);

  delay(20000);
}

As you can see, you need to do a fair bit more work to get your setup working. I've never used the "RCSwitch" library, so can't help you to work out exactly what you need to do.
If you study the documentation and examples for the "RCSwitch" library, you'll soon get the idea. There are a number of examples.

Then, in your transmitter, to avoid damage you should disconnect the SC2262 "Dout" pin from the RF transmitter first, then connect your Arduino output pin instead, to replace it. Don't have both outputs connected together the way you have it now.

I've attached the datasheets for the SC2262 and SC2272 to give you a clearer idea of what's going on.
(If you want even better info, do a search for the PT2262 and PT2272 datasheets. The ones for the SC2262 and SC2272 aren't the best.)

Most importantly, ignore that crap on the Hack Some Remote Controlled Sockets page - it cannot possibly work.

SC2262.pdf (223 KB)

SC2272.pdf (324 KB)

Thank you very much for your answer! I guess I thought every RC device in of this type (intentionally vague wording) was controlled by the same signals. Therefore, I would be able to control anything by giving the SC2622 chip one of six messages (all given in the library) that would trigger one of the six commands. (3 channel binary). Of course, this was all very wrong it seems...

I did break up the receiver and found it was driven by an SC2272 chip, as expected really. I took your advice and hooked the Arduino pin 2, to Din on the 2272. It is soldered directly onto the pin. I was now able to turn on/of the socket with the RC transmitter, but ONLY while not being connected to pin 2 on the Arduino. If the receiver was turned on (LED lit) and I connected the Din-pin to pin 2, the light would go out. Do anyone have any idea why this is happening? I thought maybe pin 2 could work as some kind of pull down/up and thereby disrupting the signals in the chip.

EDIT: I succesfully uploaded the code from your first example. The libraries are installed, so the problem should not be there. But the serial monitor is not receiving anything at all. Of course, this is not really surpringsing, given that the RC receiver seems to not work while connected to the Arduino, just for info.

Long story short:

Is this the correct physical setup? (Din->pin #2)

Henrik

PS: Hope you don't mind the crappy image quality.

If the receiver was turned on (LED lit) and I connected the Din-pin to pin 2, the light would go out. Do anyone have any idea why this is happening?

Again, you are trying to connect two outputs together (the receiver output and the Arduino output). Don't do that!

If you want to make a remote controller, use the RCSwitch library on a Arduino connected to a simple 433 MHz transmitter. Google "arduino 433mhz rcswitch controller" for plenty of examples.

I took your advice and hooked the Arduino pin 2, to Din on the 2272. It is soldered directly onto the pin. I was now able to turn on/of the socket with the RC transmitter, but ONLY while not being connected to pin 2 on the Arduino. If the receiver was turned on (LED lit) and I connected the Din-pin to pin 2, the light would go out. Do anyone have any idea why this is happening?

I only suggested connecting to the receiver with your Arduino pin set as an input, for recording the codes, not as an output.
As jremington said, (and I said in my first reply), you cannot connect two outputs together. I thought I'd made that very clear, yet you ignored my advice. You might have already damaged either the receiver output or Arduino pin's output stage.