Sending text over infrared: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
 
(59 intermediate revisions by the same user not shown)
Line 1: Line 1:
  '''Project by [[User:XiaoXuan Soda|Soda]] & [[User:SHRED|Ema]]'''
  '''Project by [[User:XiaoXuan Soda|Soda]] & [[User:SHRED|Ema]]'''
[[File:Taaaaaaac.jpg|frameless|801x801px]]
[[File:Demo 1.mp4|none|thumb]]


=== The idea ===
=== '''<big>The idea</big>''' ===
to send text messages in real time over [https://en.wikipedia.org/wiki/Infrared infrared waves], and to see what happens when the signal gets disturbed.
To send text messages in real time over [https://en.wikipedia.org/wiki/Infrared infrared waves], and see what happens when the signal gets disturbed.


The intention is to set up this project in a '''public space''', so people can use it both passively and actively. Passively: by walking in between the IR sender and receiver - Actively: by typing a message and reading what gets delivered.
The intention is to set up this project in a '''public space''', so people can use it both passively and actively. Passively: by walking in between the IR sender and receiver - Actively: by typing a message and reading what gets delivered.


People that passively walks across the IR signal will disturb the transmission of the message, letting who's on the other side interpret what the original message was. With that, we'd like to shine an interest in the materiality of forms of communication, which usually happens without being aware of their infrastructure. The ethereal "immateriality" of the IR waves becomes tangible and something simple as like sending a simple text message becomes questioned.
People that passively walks across the IR signal will disturb the transmission of the message, letting who's on the other side interpret what the original message was. With that, we'd like to shine an interest in '''the materiality of forms of communication''', which usually happens without being aware of their infrastructure. The ethereal "immateriality" of the IR waves becomes '''tangible''', and something as simple as to send a text message becomes questioned.


=== The process ===
=== '''<big>The process</big>''' ===


===== Components =====
===== <code>Components</code> =====
2 Arduino UNO boards (provided by Soda)


Wires and 2 wiring boards (provided by Soda & from the [https://xml.xpub.nl/ XML])
* x2 Arduino UNO boards (provided by [[User:XiaoXuan Soda|Soda]])
* Wires and 2 wiring boards (provided by Soda & from the [https://xml.xpub.nl/ XML])
* x1 keyboard that has a '''PS/2''' protocol port '''''[not a standard USB]''''' (from the [https://xml.xpub.nl/ XML])
* x1 1602A display (from the [https://xml.xpub.nl/ XML])
* x1 IR receiver TSOP38238 (bought off from [https://elektronicavoorjou.nl/product/ir-sensor-tsop38238/ here])
* x1 BD138 transistor (from the [https://xml.xpub.nl/ XML])
* x1 IR transmitter (from the [https://interactionstation.wdka.hro.nl/ interaction station]) (or you can take it from an old remote)
* ''<u>Various resistors of different capacities</u>'' (from the [https://xml.xpub.nl/ XML])
* x1 LED light (from the [https://xml.xpub.nl/ XML])
* x2 5V powerbanks (from the [https://interactionstation.wdka.hro.nl/ interaction station]) (or you can use batteries)


A keyboard that uses the '''PS2''' protocol [not USB] (from the [https://xml.xpub.nl/ XML])
===== <code>Tools</code> =====


1602A display (from the [https://xml.xpub.nl/ XML])
* [https://www.arduino.cc/en/software/ Arduino IDE]
** [https://github.com/Arduino-IRremote/Arduino-IRremote IR Remote] library - to make the infrared transmitter & receiver works
** [https://docs.arduino.cc/libraries/ps2keyboard/#Compatibility PS2 Keyboard] library - to connect a keyboard input that uses a PS2 port
** [https://docs.arduino.cc/libraries/liquidcrystal/ LiquidCristal] library - to use the display


IR receiver TSOP38238 (bought off from [https://elektronicavoorjou.nl/product/ir-sensor-tsop38238/ here])
* Soldering wand (optional)


IR sender (from the interaction station)
==== '''<big>IR sender</big>''' ====
'''Keyboard Setup ➞''' Only Arduino Due has a USB Host library. <u>The rest of the Arduino boards '''don’t have the proper USB interface chips on them''' to play Host</u>. Hence it is way '''easier to <u>use</u>''' <u>a keyboard that has a '''PS/2''' port</u>, cause the standard use of Arduino with a keyboard is the PS2 connection.


Various resistors (from the [https://xml.xpub.nl/ XML])
''We tried with 2 different USB keyboards and it didn't work. No matter how good the wiring was.''
[[File:PS2 Connector PinOut Diagram Male and Female Ports.png|none|thumb|600x600px|<nowiki>Connect ➞ 1 to Digital PWM 3 | 5 to Digital PWM 2</nowiki>]]
[[File:PS2 male connector wired.jpg|none|thumb]]
then


LED light (from the [https://xml.xpub.nl/ XML])
Connect the '''IR sender''' to PWM '''9'''.


===== Tools =====
We added a red LED light to lit up whenever a key is pressed, and that one is attached to PWM 8.
[https://www.arduino.cc/ Arduino]
[[File:IR sender and keyboard connections .jpg|none|thumb|600x600px|<nowiki>IR sender and keyboard connections | </nowiki><u>NB:</u> there is still no LED connected in this image ]]'''<big>THE SETUPGZ</big>'''<gallery mode="nolines" widths="400" heights="400" perrow="2">
File:Sender.jpg
File:Sender 2.jpg
</gallery>


Soldering wand
'''<big>the code [9600 Baud]</big>'''
<pre>
#include <PS2Keyboard.h>
#include <IRremote.hpp>


==== IR sender ====
const int DataPin = 3;
abc
const int ClockPin = 2;
const int IR_SEND_PIN = 9;
const int SendLEDPin = 8;


==== IR receiver ====
PS2Keyboard keyboard;
abc
 
void setup() {
  Serial.begin(9600);
 
  keyboard.begin(DataPin, ClockPin);
  IrSender.begin(IR_SEND_PIN);
 
  pinMode(SendLEDPin, OUTPUT);
  digitalWrite(SendLEDPin, LOW);
 
  Serial.println("Keyboard to IR Sender Ready");
}
 
void loop() {
 
  if (keyboard.available()) {
 
    char c = keyboard.read();
 
    Serial.print("Sending character: ");
    Serial.println(c);
 
    digitalWrite(SendLEDPin, HIGH);
 
    // Send via IR
    IrSender.sendNEC(0x00, (uint8_t)c, 0);
 
    delay(60);
 
    digitalWrite(SendLEDPin, LOW);
 
    delay(20);
  }
}
</pre>
 
==== '''<big>IR receiver</big>''' ====
The IR receiver is set up like this (see image) and to test if it works, u can use any kind of remote and press some buttons (it's also a good way to test your remote 😁).
<br />
[[File:IR-remote-and-receiver-with-Arduino-wiring-diagram-schematic-circuit-tutorial-featured-image-1536x864.png|thumb|600x600px|'''Open the image to see it clearly'''|none]]<br />The display used (1602A display) is set up like this
[[File:Ulnx Lcd-Display-1602A-Datasheet.jpg|none|thumb|600x600px|NOTE: probably using a 12k om resistor on V0 instead would be better  ]]
''NOTE: We noticed that the resistor on V0 (we did NOT use a potmeter) serves the purpose of dimmering the light in the background of the letters. If you don't use any resistor, you would see everything almost at the same brightness level and it's very hard to recognise the letters (but not from the sides).''
 
[[File:IR RECEIVER.jpg|frameless|534x534px]]
 
'''<big>the code [9600 Baud]</big>'''
<pre>
#include <IRremote.hpp>
#include <LiquidCrystal.h>
 
const int IRReceiverPin = 6;
 
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
 
int cursorPosition = 0;
 
void setup() {
  Serial.begin(9600);
  IrReceiver.begin(IRReceiverPin);
 
  lcd.begin(16, 2);
  lcd.clear();
 
  Serial.println("IR Receiver Ready");
}
 
void loop() {
 
  if (IrReceiver.decode()) {
 
    if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) {
      IrReceiver.resume();
      return;
    }
 
    uint8_t receivedCommand = IrReceiver.decodedIRData.command;
 
    if (receivedCommand >= 32 && receivedCommand <= 126) {
 
      char receivedChar = (char)receivedCommand;
 
      Serial.print("Received ASCII: ");
      Serial.print(receivedCommand);
      Serial.print("  Character: ");
      Serial.println(receivedChar);
 
      lcd.setCursor(cursorPosition, 0);
 
      if (cursorPosition < 16) {
        lcd.setCursor(cursorPosition, 0);
      } else {
        lcd.setCursor(cursorPosition - 16, 1);
      }
 
      lcd.print(receivedChar);
 
      cursorPosition++;
 
      if (cursorPosition >= 32) {
        cursorPosition = 0;
      }
    }
 
    IrReceiver.resume();
  }
}
</pre>


[[Category:SI29]]
[[Category:SI29]]
[[Category:SI29/Shred]]
[[Category:SI29/Shred]]

Latest revision as of 22:16, 13 February 2026

Project by Soda & Ema

Taaaaaaac.jpg File:Demo 1.mp4

The idea

To send text messages in real time over infrared waves, and see what happens when the signal gets disturbed.

The intention is to set up this project in a public space, so people can use it both passively and actively. Passively: by walking in between the IR sender and receiver - Actively: by typing a message and reading what gets delivered.

People that passively walks across the IR signal will disturb the transmission of the message, letting who's on the other side interpret what the original message was. With that, we'd like to shine an interest in the materiality of forms of communication, which usually happens without being aware of their infrastructure. The ethereal "immateriality" of the IR waves becomes tangible, and something as simple as to send a text message becomes questioned.

The process

Components
  • x2 Arduino UNO boards (provided by Soda)
  • Wires and 2 wiring boards (provided by Soda & from the XML)
  • x1 keyboard that has a PS/2 protocol port [not a standard USB] (from the XML)
  • x1 1602A display (from the XML)
  • x1 IR receiver TSOP38238 (bought off from here)
  • x1 BD138 transistor (from the XML)
  • x1 IR transmitter (from the interaction station) (or you can take it from an old remote)
  • Various resistors of different capacities (from the XML)
  • x1 LED light (from the XML)
  • x2 5V powerbanks (from the interaction station) (or you can use batteries)
Tools
  • Soldering wand (optional)

IR sender

Keyboard Setup ➞ Only Arduino Due has a USB Host library. The rest of the Arduino boards don’t have the proper USB interface chips on them to play Host. Hence it is way easier to use a keyboard that has a PS/2 port, cause the standard use of Arduino with a keyboard is the PS2 connection.

We tried with 2 different USB keyboards and it didn't work. No matter how good the wiring was.

Connect ➞ 1 to Digital PWM 3 | 5 to Digital PWM 2
PS2 male connector wired.jpg

then

Connect the IR sender to PWM 9.

We added a red LED light to lit up whenever a key is pressed, and that one is attached to PWM 8.

IR sender and keyboard connections | NB: there is still no LED connected in this image

THE SETUPGZ

the code [9600 Baud]

#include <PS2Keyboard.h>
#include <IRremote.hpp>

const int DataPin = 3;
const int ClockPin = 2;
const int IR_SEND_PIN = 9;
const int SendLEDPin = 8;

PS2Keyboard keyboard;

void setup() {
  Serial.begin(9600);

  keyboard.begin(DataPin, ClockPin);
  IrSender.begin(IR_SEND_PIN);

  pinMode(SendLEDPin, OUTPUT);
  digitalWrite(SendLEDPin, LOW);

  Serial.println("Keyboard to IR Sender Ready");
}

void loop() {

  if (keyboard.available()) {

    char c = keyboard.read();

    Serial.print("Sending character: ");
    Serial.println(c);

    digitalWrite(SendLEDPin, HIGH);

    // Send via IR
    IrSender.sendNEC(0x00, (uint8_t)c, 0);

    delay(60);

    digitalWrite(SendLEDPin, LOW);

    delay(20);
  }
}

IR receiver

The IR receiver is set up like this (see image) and to test if it works, u can use any kind of remote and press some buttons (it's also a good way to test your remote 😁).

Open the image to see it clearly


The display used (1602A display) is set up like this

NOTE: probably using a 12k om resistor on V0 instead would be better

NOTE: We noticed that the resistor on V0 (we did NOT use a potmeter) serves the purpose of dimmering the light in the background of the letters. If you don't use any resistor, you would see everything almost at the same brightness level and it's very hard to recognise the letters (but not from the sides).

IR RECEIVER.jpg

the code [9600 Baud]

#include <IRremote.hpp>
#include <LiquidCrystal.h>

const int IRReceiverPin = 6;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int cursorPosition = 0;

void setup() {
  Serial.begin(9600);
  IrReceiver.begin(IRReceiverPin);

  lcd.begin(16, 2);
  lcd.clear();

  Serial.println("IR Receiver Ready");
}

void loop() {

  if (IrReceiver.decode()) {

    if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) {
      IrReceiver.resume();
      return;
    }

    uint8_t receivedCommand = IrReceiver.decodedIRData.command;

    if (receivedCommand >= 32 && receivedCommand <= 126) {

      char receivedChar = (char)receivedCommand;

      Serial.print("Received ASCII: ");
      Serial.print(receivedCommand);
      Serial.print("  Character: ");
      Serial.println(receivedChar);

      lcd.setCursor(cursorPosition, 0);

      if (cursorPosition < 16) {
        lcd.setCursor(cursorPosition, 0); 
      } else {
        lcd.setCursor(cursorPosition - 16, 1);
      }

      lcd.print(receivedChar);

      cursorPosition++;

      if (cursorPosition >= 32) {
        cursorPosition = 0;
      }
    }

    IrReceiver.resume();
  }
}