Close
0%
0%

Twitch Chat Notification System

This little device is a simple LED that flashes when there is a new chat in your twitch channel

Similar projects worth following
If you are a small streamer and easily miss a new chat then this tool works great to give you a nudge to reply to your viewers. It simply flashes at you whenever you get a new chat message.

This should be a fairly straightforward project that can be done in very little time. The code is written so that you don't have to input your wifi information or your twitch channel info. When the device first starts up it starts in AP mode and you can connect to it as a wireless hotspot. You can then fill in your wifi information and your twitch channel information. It will store this info in flash so it will remember everything if it is powered off and on again. I also added a hard reset that makes it forget everything. If you short pin D8 to ground while it is powered on it will forget the wifi info and the channel info. This is great if you want to give it away with it in a factory default setting. 

Detailed instruction on setting it up after you upload the code is included in the setup manual in the files section. 

This is the bit of code that resets everything.

int resetpin = digitalRead(reset_pin);
  if(resetpin == LOW){
    Serial.println("RESETTING TO FACTORY SETTINGS IN 3...");
    digitalWrite(led,HIGH);
    delay(1000);
    Serial.println("2...");
    delay(1000);
    Serial.println("1...");
    delay(1000);
    Serial.println("wait 10 seconds and manually reset");
    delay(100); 
    WiFi.disconnect(true); //erase ssid info
    SPIFFS.format();
    delay(500);    
    //SPIFFS.format();//erase custom parameters login, oauth, channel name
  }

Also, the device will display information on the serial monitor. It will display all of twitch chat as well. 

You can easily add features to the code to make your own custom bot. It can post messages to chat so if you want it to post links to your social media or respond to commands the process is quite easy. 

The command 

client.sendMessage("YOUR MESSAGE");

will allow you to send your own messages to chat. 

Any commands you give should go in the void callback(IRCMessage ircMessage) loop

void callback(IRCMessage ircMessage) {
  //Serial.println("In CallBack");
  // PRIVMSG ignoring CTCP messages
  if (ircMessage.command == "PRIVMSG" && ircMessage.text[0] != '\001') {
    //Serial.println("Passed private message.");
    ircMessage.nick.toUpperCase();
    String message("<" + ircMessage.nick + "> " + ircMessage.text);

    //prints chat to serial
    Serial.println(message);
    
    //flashes the LED with a new message
     for(int i=0; i<6; i++){
      digitalWrite(led,HIGH);
      delay(50);
      digitalWrite(led,LOW);
      delay(25); 
    }
    
/*
put your custom commands here
listen for a command example and post social media stuff

if(ircMessage.text == "!twitter") {
            client.sendMessage(IRC_CHAN,"Follow me on twitter https://twitter.com/otherlonestar");
                    
    }
    */
    
  return;
  }
}
  

You do need to give some credentials to the device during setup. It needs to know what channel to connect to and what user to connect as. You can use your own twitch account or make a bot account. You will need to obtain an OAUTH key to do so. The info on OAUTH keys is included in the manual.  

You'll need some libraries to make it work. The IRCClient Library is the really important one. https://github.com/fredimachado/ArduinoIRC

ino - 7.54 kB - 08/08/2018 at 14:21

Download

Twitchbot Notification Thingy Manual (2).pdf

Operation Instructions and setup After assembly and programming.

Adobe Portable Document Format - 403.71 kB - 07/19/2018 at 12:11

Preview
Download

esp8266 single led lid 2 slide fit.stl

3D printed part to hold a wemos D1 Mini and an LED. Flip it in your slicing program

Standard Tesselated Geometry - 133.48 kB - 07/19/2018 at 11:31

Download

esp8266 single led Case 2 slide fit.stl

3D printed part to hold a wemos D1 Mini and an LED.

Standard Tesselated Geometry - 16.49 kB - 07/19/2018 at 11:31

Download

esp8266 single led button.stl

3D printed part to hold a wemos D1 Mini and an LED used to press the reset button.

Standard Tesselated Geometry - 2.23 kB - 07/19/2018 at 11:31

Download

  • 1 × Wemos D1 Mini I'm using the older version that has the big ESP8266 RF shield on the body. If you use the newer ones you will have to edit the 3D printed part to make it fit right.
  • 1 × 5mm LED
  • 1 × 220 ohm Resistor Current Limiting resistor for the LED.
  • 1 × A bit of wire wire to connect the resistor, LED, and wemos

View project log

  • 1
    Step 1

    I used the female headers on the wemos D1 mini in case I decide to use the wemos on another project down the road. The build is pretty straight forward.

    I soldered wires to the anode and cathode of the LED. 

    I soldered a 220 ohm resistor to the end of the wire connected to the anode. I plugged the resister into D8 and the cathode into ground. I then pushed the LED into the hole provided in the case, inserted the 3D printed button into the receptacle, placed the Wemos into position, then slid the lid closed over the whole thing. 

View all instructions

Enjoy this project?

Share

Discussions

DJ Arkaiid wrote 04/06/2023 at 19:35 point

Could something like this be applied to a I2C 16x2 LCD? I've been webcrawing for a while trying to figure something out. I already have a setup to be able to read the chat, but having this little LCD display the last posted chat is my goal.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates