user27311: I have a RS232 device that I am able to communicate with using RealTerm on a windows PC.
The device is expecting a hex string like AA BB 03 01 03 EE


How would I send the equivalent string from an arduino? (I feel confident the arduino is wired correctly since I can see incoming uart data)
Things I have tried
void setup() {
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {
      Serial.println('AA BB 03 01 01 EE', "OCT");
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE', "DEC");
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', "DEC");
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', "DEC");
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', "DEC");
      delay(3000);
      Serial.print('0xAA 0xBB 0x03 0x01 0x01 0xEE', "DEC");
      delay(3000);
      Serial.print('AA BB 03 01 01 EE', "DEC");
      delay(3000);
      Serial.print('AA BB 03 01 01 EE', "DEC");
      delay(3000);
      Serial.print('AA BB 03 01 01 EE', "DEC");
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', HEX);
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE', HEX);
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE');
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE', HEX);
      delay(3000);
      Serial.write('AA BB 03 01 01 EE');
      delay(3000);
      Serial.write('0xAA 0xBB 0x03 0x01 0x01 0xEE');
      delay(3000);
}


I've also tried using double quotes as mentioned in the comments
     Serial.write("AA BB 03 01 01 EE");
     delay(3000);
     
     Serial.write("0xAA 0xBB 0x03 0x01 0x01 0xEE");
     delay(3000);

     Serial.write("101010101011101100000011000000010000000111101110");
     delay(2000);


Additionally I've tried writing the serial one line at a time
  Serial.write(0xaa); // AA
  Serial.write(0xbb); // BB
  Serial.write(0x03); // 03
  Serial.write(0x01); // 01
  Serial.write(0x01); // 01
  Serial.write(0xee); // EE
  Serial.write(0x0d); // \r
  Serial.write(0x0a); // \n
  delay(3000);

Additional Information

controlling projector using arduino
Adding \r\n to hex sent over arduino


user7508: As noticed by jsotola in a comment, your device doesn't seem to be
expecting HEX at all, but rather plain binary. Serial.print() is not
appropriate, as it is designed for sending ASCII text. For binary data,
you should prefer Serial.write(). More specifically, for sending
arbitrary binary data, the proper method is
size_t Print::write(const uint8_t *buffer, size_t size)

Applying this to your example gives:
const size_t packet_length = 6;
uint8_t packet[packet_length] = {0xaa, 0xbb, 0x03, 0x01, 0x03, 0xee};
Serial.write(packet, packet_length);


27311: <p>I have a RS232 device that I am able to communicate with using RealTerm on a windows PC.</p>
<p>The device is expecting a hex string like <code>AA BB 03 01 03 EE</code></p>
<p><a href="https://i.stack.imgur.com/NHILF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NHILF.jpg" alt="enter image description here" /></a></p>
<hr />
<p>How would I send the equivalent string from an arduino? (I feel confident the arduino is wired correctly since I can see incoming uart data)</p>
<p>Things I have tried</p>
<pre><code>void setup() {
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {
      Serial.println('AA BB 03 01 01 EE', &quot;OCT&quot;);
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE', &quot;DEC&quot;);
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', &quot;DEC&quot;);
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', &quot;DEC&quot;);
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', &quot;DEC&quot;);
      delay(3000);
      Serial.print('0xAA 0xBB 0x03 0x01 0x01 0xEE', &quot;DEC&quot;);
      delay(3000);
      Serial.print('AA BB 03 01 01 EE', &quot;DEC&quot;);
      delay(3000);
      Serial.print('AA BB 03 01 01 EE', &quot;DEC&quot;);
      delay(3000);
      Serial.print('AA BB 03 01 01 EE', &quot;DEC&quot;);
      delay(3000);
      Serial.println('AA BB 03 01 01 EE', HEX);
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE', HEX);
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE');
      delay(3000);
      Serial.println('0xAA 0xBB 0x03 0x01 0x01 0xEE', HEX);
      delay(3000);
      Serial.write('AA BB 03 01 01 EE');
      delay(3000);
      Serial.write('0xAA 0xBB 0x03 0x01 0x01 0xEE');
      delay(3000);
}

</code></pre>
<p>I've also tried using double quotes as mentioned in the comments</p>
<pre><code>     Serial.write(&quot;AA BB 03 01 01 EE&quot;);
     delay(3000);
     
     Serial.write(&quot;0xAA 0xBB 0x03 0x01 0x01 0xEE&quot;);
     delay(3000);

     Serial.write(&quot;101010101011101100000011000000010000000111101110&quot;);
     delay(2000);

</code></pre>
<p>Additionally I've tried writing the serial one line at a time</p>
<pre><code>  Serial.write(0xaa); // AA
  Serial.write(0xbb); // BB
  Serial.write(0x03); // 03
  Serial.write(0x01); // 01
  Serial.write(0x01); // 01
  Serial.write(0xee); // EE
  Serial.write(0x0d); // \r
  Serial.write(0x0a); // \n
  delay(3000);
</code></pre>
<p>Additional Information</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=bQ7qvjxSUXU" rel="nofollow noreferrer">controlling projector using arduino</a></li>
<li><a href="https://www.reddit.com/r/Esphome/comments/i8srtv/projector_control/?sort=confidence" rel="nofollow noreferrer">Adding \r\n to hex sent over arduino</a></li>
</ul>
 7508: <p>As noticed by jsotola in a comment, your device doesn't seem to be
expecting HEX at all, but rather plain binary. <code>Serial.print()</code> is not
appropriate, as it is designed for sending ASCII text. For binary data,
you should prefer <code>Serial.write()</code>. More specifically, for sending
arbitrary binary data, the proper method is</p>
<pre class="lang-cpp prettyprint-override"><code>size_t Print::write(const uint8_t *buffer, size_t size)
</code></pre>
<p>Applying this to your example gives:</p>
<pre class="lang-cpp prettyprint-override"><code>const size_t packet_length = 6;
uint8_t packet[packet_length] = {0xaa, 0xbb, 0x03, 0x01, 0x03, 0xee};
Serial.write(packet, packet_length);
</code></pre>
