javier muñoz sáez
Published © MIT

LED RF Entryphone Coconut Build

Meant to be used at a music studio where the sudden sound of the entryphone could be fatal to your recordings but you still ordered pizza.

IntermediateWork in progress5 hours1,154
LED RF Entryphone Coconut Build

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
one for each coconut , in my case one emmiter and two receivers
×3
Radio 433mhz modules
one emmiter and two receivers, so we need to buy at least two couples
×2
5 mm LED: Red
5 mm LED: Red
a lot of red diodes, as you wish, maybe you want to do it with another colour, rgb stripes....etc
×15
9V 1A Switching Wall Power Supply
9V 1A Switching Wall Power Supply
or 9v batteries
×3
coconut
×1
Modulo Blank Slate
Modulo Blank Slate
any generic circuit plate
×1
usb to ttl arduino serial converter
to charge the program into arduino pro mini, if you ude other arduino microcontroler like arduino nano this converter its no needed
×1
General Purpose Transistor PNP
General Purpose Transistor PNP
to control de diodes
×6
Resistor 221 ohm
Resistor 221 ohm
for the transistor base handling by the arduino outputs
×6

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

dremel
or whatever you want to cut in half the bloody coconut
Soldering iron (generic)
Soldering iron (generic)
to join wires
Hot glue gun (generic)
Hot glue gun (generic)
to keep all together

Story

Read more

Code

Transmmiter module (TX)

C/C++
senses the entryphone ringing signal and send Radio message
#include <VirtualWire.h>
#define DEBUG
#define ringanalogpin A0
#define TX 12
#define HUMBRAL 200 //0-5v 0-1023... 200-->1volt humbral sensing
char datagrama[7]={"FFFFFF"};
char llaman[7]={"LLAMAN"};
char idle [7]={"-NADA-"};

void setup() {
  #ifdef DEBUG//if debug is defined compile and go with the serial thing for monitoring from the arduino IDE
 Serial.begin(9600);
 #endif
   pinMode(TX, OUTPUT);
  vw_set_tx_pin(TX);          // Configura el pin  como TX
  vw_set_ptt_inverted(true);  // Requerido para DR3100
  vw_setup(2000);             // Bits por segundo

  //leds y analog input
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  pinMode(A0,INPUT);
  
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);

//pequeño TEST de transmision tras el reset
 vw_send((uint8_t *)llaman, strlen(llaman));//shot the message to the RX modules
 vw_wait_tx(); // Wait until the whole message is gone

}

void loop() {


if(analogRead(ringanalogpin)>=HUMBRAL)//if analogpin detects door ringing do stuff
{
strcpy(datagrama,llaman);//load the datagrama array "shhck ch!"(shotgun noise)
 digitalWrite(13, HIGH); // Turn on a light to show transmitting
 vw_send((uint8_t *)datagrama, strlen(datagrama));//shot the message to the RX modules
 vw_wait_tx(); // Wait until the whole message is gone
 delay(50); 
 digitalWrite(13, LOW); // Turn off a light after transmission
 doorisringingmotherfucker();//blink effects

}

else//if nothing is happening
{
strcpy(datagrama,idle);//send idle state to the RX modules
   digitalWrite(4,HIGH);//every light is turned off
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
}




#ifdef DEBUG //if debug is defined compile and go with the serial thing for monitoring from the arduino IDE
Serial.print("Value picked by the analog input");
Serial.print(analogRead(ringanalogpin));
Serial.print("   Datagrama");
Serial.println(datagrama);
 #endif

}

void doorisringingmotherfucker()//friendly blinking lights function, nice dancing effect and then all blinking
{

   delay(30);  
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
   delay(30); 
   digitalWrite(7,HIGH);
      delay(30); 
   digitalWrite(8,LOW); 
   delay(30); 
   digitalWrite(8,HIGH);
      delay(30); 
   digitalWrite(9,LOW); 
   delay(30); 
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
   delay(30); 
   digitalWrite(7,HIGH);
      delay(30); 
   digitalWrite(8,LOW); 
   delay(30); 
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
      delay(30);
      digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
      delay(30); 
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
      delay(30); 
         digitalWrite(4,LOW); 
   delay(200);
   digitalWrite(4,LOW);//it could had been done smarter, yes but i dont care
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
      delay(200);
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);  
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(30);  
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
   delay(30); 
   digitalWrite(7,HIGH);
      delay(30); 
   digitalWrite(8,LOW); 
   delay(30); 
   digitalWrite(8,HIGH);
      delay(30); 
   digitalWrite(9,LOW); 
   delay(30); 
   digitalWrite(9,HIGH);

}
  

Receiver(RX), much simpler

C/C++
#include <VirtualWire.h>
#define DEBUG
#define RX 12
char datagrama[7]={"FFFFFF"};


void setup() {
#ifdef DEBUG//if debug is defined compile and go with the serial thing for monitoring from the arduino IDE
 Serial.begin(9600);
 #endif
   pinMode(RX, OUTPUT);
  vw_set_tx_pin(RX);          // Configura el pin  como TX
  vw_set_ptt_inverted(true);  // Requerido para DR3100
  vw_setup(2000);             // Bits por segundo

  //leds y analog input
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  pinMode(A0,INPUT);
  
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);

}
void loop() {
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    
    // Non-blocking
    if (vw_get_message(buf, &buflen))//message received 
    {
    int i;

           // Message with a good checksum received, dump it. 
        for (i = 0; i < buflen; i++)
    {            
          // Fill datagrama Char array with corresponding 
          // chars from buffer.   
          datagrama[i] = char(buf[i]);
    }
        
        datagrama[buflen] = '\0';
    }

    if(datagrama=="LLAMAN")
    {
      doorisringingmotherfucker();
    }
    
   if(datagrama=="-NADA-")
   {  
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   }
   
    if(datagrama=="FFFFFF")
   {
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   }
#ifdef DEBUG
Serial.print("Datagrama recibido:");
Serial.println(datagrama);
#endif
 delay(1000);   
}

void doorisringingmotherfucker()//friendly blinking lights function, nice dancing effect and then all blinking
{

   delay(30);  
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
   delay(30); 
   digitalWrite(7,HIGH);
      delay(30); 
   digitalWrite(8,LOW); 
   delay(30); 
   digitalWrite(8,HIGH);
      delay(30); 
   digitalWrite(9,LOW); 
   delay(30); 
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
   delay(30); 
   digitalWrite(7,HIGH);
      delay(30); 
   digitalWrite(8,LOW); 
   delay(30); 
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
      delay(30);
      digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
      delay(30); 
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
      delay(30); 
         digitalWrite(4,LOW); 
   delay(200);
   digitalWrite(4,LOW);//it could had been done smarter, yes but i dont care
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
      delay(200);
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);  
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
      digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(200);   
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   digitalWrite(8,LOW);
   digitalWrite(9,LOW);
   delay(200);
   digitalWrite(4,HIGH);
   digitalWrite(5,HIGH);
   digitalWrite(6,HIGH);
   digitalWrite(7,HIGH);
   digitalWrite(8,HIGH);
   digitalWrite(9,HIGH);
   delay(30);  
   digitalWrite(4,LOW); 
   delay(30); 
   digitalWrite(4,HIGH);
   delay(30); 
   digitalWrite(5,LOW); 
   delay(30); 
   digitalWrite(5,HIGH);
      delay(30); 
   digitalWrite(6,LOW); 
   delay(30); 
   digitalWrite(6,HIGH);
      delay(30); 
   digitalWrite(7,LOW); 
   delay(30); 
   digitalWrite(7,HIGH);
      delay(30); 
   digitalWrite(8,LOW); 
   delay(30); 
   digitalWrite(8,HIGH);
      delay(30); 
   digitalWrite(9,LOW); 
   delay(30); 
   digitalWrite(9,HIGH);

}
  

Credits

javier muñoz sáez

javier muñoz sáez

10 projects • 54 followers
Electronic engineer and sparky person. I make tutorials so my future self doesnt need to remember where he put the code

Comments