Project tutorial
Remote Controlled Cannon using Arduino | Gone Wrong

Remote Controlled Cannon using Arduino | Gone Wrong © Apache-2.0

In this video will see how to make remote controlled cannon using arduino and radio module (NRF24L01).

  • 16 views
  • 0 comments
  • 0 respects

Components and supplies

Apps and online services

About this project

Remote Controlled Cannon using Arduino | Gone Wrong

In this video will see how to make remote controlled cannon using arduino and radio module (NRF24L01).

We're using NRF24L01 module with Arduino to control the cannon.

Schematics, Code & More Here ► https://teenenggr.com/2019/08/15/remote-controlled-cannon-arduino/

Website ► https://teenenggr.com

Code

TranreceiverArduino
#include  <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int buttonPIN = 3;
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int pVal = 1;

void setup() {
  // put your setup code here, to run once:
pinMode(buttonPIN, INPUT);
Serial.begin(9600);
radio.begin();
 radio.openWritingPipe(pipe);
}

void loop() {
  // put your main code here, to run repeatedly:
int val = digitalRead(buttonPIN);

if (val != pVal) {
 msg[0] = val ? 4 : 5;
 radio.write(msg, 1);
 Serial.println("data sent---");
Serial.println(msg[0]); 
 pVal = val;
 }
}
ReceiverArduino
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 3;
void setup(void){
 Serial.begin(9600);
 radio.begin();
 radio.openReadingPipe(1,pipe);
 radio.startListening();
 pinMode(LED1, OUTPUT);
 digitalWrite(LED1, HIGH);
}
void loop(void){
 if (radio.available()){
   bool done = false;    
   while (!done){
      radio.read(msg, 1);      
//     Serial.println(msg[0]);
     if (msg[0] == 5){
      delay(10);
      digitalWrite(LED1, HIGH);
      Serial.println(msg[0]);
      }
     else if (msg[0] == 4 ){
      digitalWrite(LED1, LOW);
      Serial.println(msg[0]);
      }
     delay(10);
     }
 }
 else{
  Serial.println("No radio available");
  }
}

Custom parts and enclosures

Tranreceiver
radio_communication_transreceiver_aQi8DrAxKJ.ino
Receiver
radio_communication_receiver_WjBuLVWupf.ino

Schematics

Schematics
Nrf24l01 and arduino tutorial circuit schematic 1gnshazgch lmpgpf4ula

Comments

Similar projects you might like

Remote Controlled Bulb With Arduino

Project tutorial by muhammed shameel k.v

  • 3,222 views
  • 0 comments
  • 13 respects

IR Remote Controlled Home Automation

Project tutorial by suhail jr

  • 11,879 views
  • 7 comments
  • 20 respects

Remote Controlled Pet Feeder

Project tutorial by Amal Mathew

  • 8,290 views
  • 1 comment
  • 40 respects

Arduino Nano and Visuino: Infrared Remote Controlled Relay

Project tutorial by Boian Mitov

  • 4,091 views
  • 0 comments
  • 16 respects

IR Remote Controlled Power Switch for Rapsberry Pi 3

Project tutorial by Vilém Kužel

  • 2,638 views
  • 1 comment
  • 9 respects

Remote Controlled Strandbeest

Project tutorial by Jeremy S. Cook

  • 3,058 views
  • 0 comments
  • 15 respects
Add projectSign up / Login