Project in progress

Makers (Cubecon) #5 Completion of Cubecon

This Cubecon is for people who can't use a remote control. Cubecon can toggle TV power, adjust volume and change channels.

  • 1,409 views
  • 0 comments
  • 1 respect

Components and supplies

Apps and online services

About this project

Cubecon

Cubecon was completed.

Wait here! Information on Cubecon can be found in "Makers(Cubecon) #4 First Prototype".

We added the TV power and volume control features that were not included in the previous prototype.

Due to the lack of Cubecon's remaining side, TV power and volume control functions could not be used as a gyro sensor. So we added the TV power and volume control function as a button instead of a gyro sensor. Nevertheless, it's easier to press because the button is bigger than the existing remote. However, the problem with the battery position is still being considered by the team members.

Inside the Cubecon

The button was soldered to the resistor and connected to the breadboard.

We put the breadboard on top of the battery.

Cubecon Design

It is the first Cubecon designed as a 3D printer.

However, this design has several drawbacks.

So it is the second designed Cubecon.

This design has a channel name on each side, and there is also a TV power and volume control buttons. Currently we are designing another Cubecon shape.

Signal converter

It is the first design of the signal converter.

There is a cover to cover the side, so the inside is not visible when used.

Inside the Signal converter

The size of the signal converter is designed to be as small as possible so that the sensor and the battery can fit perfectly.

Signal converter Design

This design is a design that can be placed put on objects, like a photo. And we think of also another design. That design is a TV set-top box shape. This design can be used by putting it next to the TV, so anyone can use it. Also, we are thinking of more diverse designs.

Schematics

Cubecon
Completion of cubecon gyro bluetooth 7pgsu08grr
Signal converter
Completion of cubecon infrared transmit 9267u77ncw

Code

CubeconArduino
#include<Wire.h>
#include<SoftwareSerial.h>

SoftwareSerial btSerial(7, 8);

const int MPU_addr = 0x68; 
int16_t GyX, GyY, GyZ; 
int red = 6;
int green = 5;
int blue = 4;
int tvonoff = 9;
int volup = 10;
int voldown = 11;
String A;
String B;
int tvonoffa;
int volupa;
int voldowna; 

void setup() {
  Wire.begin(); 
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x6B); 
  Wire.write(0); 
  Wire.endTransmission(true);
  Serial.begin(9600);
  btSerial.begin(9600);
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
  pinMode(tvonoff, INPUT);
  pinMode(volup, INPUT);
  pinMode(voldown, INPUT);
}

void loop() {
  gyro();
  check();
  button();
  led();
}

void gyro() {
  Wire.beginTransmission(MPU_addr); 
  Wire.write(0x3B);
  Wire.endTransmission(false); 
  Wire.requestFrom(MPU_addr, 14, true); 
  GyX = Wire.read() << 8|Wire.read(); 
  GyY = Wire.read() << 8|Wire.read(); 
  GyZ = Wire.read() << 8|Wire.read();
  GyX = GyX / 100; 
  GyY = GyY / 100;
  GyZ = GyZ / 100;
  Serial.print(F("gyro x,y,z : "));
  Serial.print("| GyX = ");
  Serial.print(GyX);
  Serial.print("| GyY = ");
  Serial.print(GyY);
  Serial.print("| GyZ = ");
  Serial.print(GyZ);
  Serial.println();
  delay(300);
}

void check() {
  // EBS
    if (GyX >= -35 && GyX <= -5) {
    if (GyY >= -15 && GyY <= 15) {
    if (GyZ >= 135 && GyZ <= 165) {
      A = "EBS";
  }
  }
  }
  // KBS 
    else if (GyY >= -185 && GyY <= -155) {
    if (GyX >= -10 && GyX <= 20) {
    if (GyZ >= -30 && GyZ <= 0) {
      A = "KBS";
  }
  }
  }
  // MBC
    else if (GyX >= 155 && GyX <= 185) {
    if (GyY >= -20 && GyY <= 10) {
    if (GyZ >= -5 && GyZ <= 25) {
      A = "MBC";
  }
  }
  }
  // SBS
    else if (GyX >= -165 && GyX <= -135) {
    if (GyY >= -15 && GyY <= 15) {
    if (GyZ >= -60 && GyZ <= -30) {
      A = "SBS";
  }
  }
  }
   // KBS2 
    else if (GyX >= 0 && GyX <= 30) {
    if (GyY >= 145 && GyY <= 175) {
    if (GyZ >= -30 && GyZ <= 0) {
      A = "KKBS";
  }
  }
  }
  else {
    A = "X";
  }
}

void button() {
  tvonoffa = digitalRead(tvonoff);
  volupa = digitalRead(volup);
  voldowna = digitalRead(voldown);

  if (tvonoffa == LOW) {
    btSerial.write('O');
    Serial.println(tvonoff);
  }
  if (volupa == LOW) {
    btSerial.write('P');
    Serial.println(volupa);
  }
  if (voldowna == LOW) {
    btSerial.write('N');
    Serial.println(voldowna);
  }
}

void led() {
  if (A == B) {
    
  }
  else if (A != B) {
    // EBS
    if (A == "EBS") {
      btSerial.write('A');
      digitalWrite(red, HIGH);
      digitalWrite(green, HIGH);
      digitalWrite(blue, HIGH);
      B = "EBS";
  }
  // KBS 
    else if (A == "KBS") {
      btSerial.write('B');
      digitalWrite(red, HIGH);
      digitalWrite(green, LOW);
      digitalWrite(blue, LOW);
      B = "KBS";
  }
  // MBC
    else if (A == "MBC") {
      btSerial.write('C');
      digitalWrite(red, LOW);
      digitalWrite(green, HIGH);
      digitalWrite(blue, LOW);
      B = "MBC";
  }
  // SBS
    else if (A == "SBS") {
      btSerial.write('D');
      digitalWrite(red, LOW);
      digitalWrite(green, LOW);
      digitalWrite(blue, HIGH);
      B = "SBS";
  }
   // KBS2
    else if (A == "KKBS") {
      btSerial.write('E');
      digitalWrite(red, HIGH);
      digitalWrite(green, LOW);
      digitalWrite(blue, HIGH);
      B = "KKBS";
  }
 }
}
Signal converterArduino
#include <SoftwareSerial.h>
#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

SoftwareSerial btSerial(7, 8);
IRsend irsend;

byte adata;
byte ddata;

void setup() {
  Serial.begin(9600);
  btSerial.begin(9600);
}
void loop() {
  bluetooth();
  IR();
  buttonIR();
}

void bluetooth() {
  byte data;
  data = btSerial.read();
  adata = data;
  Serial.println(data);
}

void IR() {
  if (adata == ddata) {
    
  }

  else if (adata != ddata) {
  // EBS
  if(adata == 'A') {
    irsend.sendSAMSUNG(0xE0E020DF, 32); 
    delay(100);
    irsend.sendSAMSUNG(0xE0E0609F, 32);
    ddata = 'A';
  }
  // KBS
  else if(adata == 'B') {
    irsend.sendSAMSUNG(0xE0E030CF, 32);   
    ddata = 'B';
  }
  // MBC
  else if(adata == 'C') {
    irsend.sendSAMSUNG(0xE0E020DF, 32); 
    delay(100);
    irsend.sendSAMSUNG(0xE0E020DF, 32); 
    ddata = 'C';
  }
  // SBS
  else if(adata == 'D') {
    irsend.sendSAMSUNG(0xE0E0906F, 32); 
    ddata = 'D';
  }
  // KBS2
  else if(adata == 'E') {
    irsend.sendSAMSUNG(0xE0E0708F, 32); 
    ddata = 'E';
  }
 }
}

void buttonIR() {
  if (adata == 'O') {
    irsend.sendSAMSUNG(0xE0E040BF, 32);
    adata == 'X';
  }
  else if (adata == 'P') {
    irsend.sendSAMSUNG(0xE0E0E01F, 32);
    adata == 'X';
  }
  else if (adata == 'N') {
    irsend.sendSAMSUNG(0xE0E0D02F, 32);
    adata == 'X';
  }
}

Comments

Similar projects you might like

Magic Lamp

by Nekhil ravi

  • 1,010 views
  • 3 comments
  • 12 respects

PuzzleBox

Project tutorial by Arduino

  • 205 views
  • 0 comments
  • 1 respect

Arduino MKR GSM 1400 and DTMF

by Arduino_Genuino

  • 3,910 views
  • 0 comments
  • 9 respects

Love You Pillow

Project tutorial by Arduino

  • 2,447 views
  • 0 comments
  • 5 respects

Infrared Replicator

Project tutorial by Gustavo Gonnet

  • 3,836 views
  • 6 comments
  • 26 respects

Arduino Yun Controller

Project showcase by TATCO Inc

  • 134 views
  • 0 comments
  • 3 respects
Add projectSign up / Login