Jasper Pons
Published © GPL3+

Air To Ground Display: Drone Mounted Ground Visible Display

A super bright LED display that can give instructions to people on the ground from the air.

AdvancedFull instructions provided20 hours1,087

Things used in this project

Hardware components

Taranis RC controller with telemetry
×1
Pixhawk Mini
3DR Pixhawk Mini
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
a servo similar to this one to swing the display into a position
×1
custom designed mounting
our own custom designed mounted to secure the display under the drone
×1
Teensy USB 3.2 Development Board
Teensy USB 3.2 Development Board
this is used to control the LED matrix display
×1
Boron
Particle Boron
This is used to receive commands from the cloud and to control the servo
×1
DOT Matrix 8x32 Display - HT1632C - RED
×1
KIT-HGDRONEK66
NXP KIT-HGDRONEK66
×1
RDDRONE-FMUK66
NXP RDDRONE-FMUK66
×1

Software apps and online services

Visual Studio Code Extension for Arduino
Microsoft Visual Studio Code Extension for Arduino
Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Hovergames LED Remote display Schematic

Give it 5V power supply (pick it up off the 5V bus on the drone). Wire up the pins as instructed in the code. The exact components used are not available in Fritzing so if in doubt, wire it like the code says. Your biggest problem will be wiring all of the power and ground wires together - i soldered them up and hot-melt glued them to insulate them. A dedicated circuit board would be nice!

Code

Partical Boron code - for receiving the text to display over the GPRS cloud

C/C++
Flash this code to your Particle Boron and then connect to your console and send text to the Boron. The TX1 pin of the Boron must be connected to the RX1 pin of the teensy to display the text. Connect a servo to pin D0 of the Boron and send servo sweep commands from the Partilce consol.

Note: you can also use a particle Photon or Argon connected to wifi for local testing on your local wifi or hotspot.
//This code receives settings from the Particle cloud 
//It relays text received onto Serial 1 
//it also controls the position and optionally the sweep of a servo.
// this code oruns on a particle Boron, Electron or Photon device

//connect a servo to pin D0 
//connect whatever is listening for the text to pin TX1 at baud 115200

// follow all the instructions on the Particle website to setup your particle device
//Note: the below will only run if the particle device is connected to the internet, this is a feature of Particle devices where System mode set to the default  automatic

// Written by : Jasper Pons in 2020 for the NXP hovergames competition.


#include "Particle.h" 


//----------------- servo sweep variables------------
Servo myservo;  // create servo object to control a servo

   int bSweep = true;
   int pos;
   bool bgoingup;
   long ilastsweep;
   int servomax = 90;
   int servomin = 30;
   	
void setup() {
	Serial.begin(115200);
	Serial1.begin(115200);
	  
	  myservo.attach(D0);  // attaches the servo on the D6 pin to the servo object

// particle functions - these allow you to adjust variables using the particle console

	Particle.function("sendText", sendText);
	Particle.function("ServoPos", ServoPos);
	Particle.function("SetSweepInterval", SetSweepInterval);
	
		Particle.function("setservomax", setservomax);
		Particle.function("setservomin", setservomin);
//show some variables in the particle console
    Particle.variable("servomax", servomax);
    Particle.variable("servomin", servomin);
   // start off with a decent servo position, almost horizontal
	ServoPos("122");
	
	
	Serial.println("Setup done"); //useful for debugging
}

void loop() {
 
// just loop and wait for text to come in from the cloud

	//see if we need to perform a sweep of the servo
    fn_Sweep();
	
}


//send any text received to the serial port
//this is called by the particle cloud function
int sendText(String sToSend) {
    if( millis() >=20000){ // dont send empty string on startup
	Serial.println("You sent:");
	Serial.println(sToSend);
	Serial1.println(sToSend);
    }
    return 1;
}

int ServoPos(String sServoPos){
    int iServoPos = sServoPos.toInt();
      myservo.write(iServoPos); 
      pos = iServoPos;
      bSweep = false;
      return iServoPos;
}


//---------------------- everything below here manages servo sweep and fixed position ---------------------
int iSweepinterval = 30;

//set the delay between sweep increments - called from the cloud
int SetSweepInterval(String sinterval){
     iSweepinterval = sinterval.toInt();
      bSweep = true;
      return iSweepinterval;
}


//do the actual sweep - check every loop but only do stuff if actually sweeping
void fn_Sweep(){
    
    if (millis() - ilastsweep < iSweepinterval) return;
    ilastsweep = millis(); 
    if (!bSweep)return;
    
    
    //check limits
    if(pos < servomin){
        pos =servomin;
        bgoingup = true;
    }
    
    if(pos > servomax){
        pos =servomax;
        bgoingup = false;
    }
    
    //sweep in degrees of 1   
    if (bgoingup){
        pos +=1;
    } else {
        pos -=1;
    }
                                     // in steps of 1 degree
     myservo.write(pos);              // tell servo to go to position in variable 'pos'
         
	
}

//set servo sweep range - called from the cloud
int  setservomin (String sval){
    servomin = sval.toInt();
      bSweep = true;
    return servomin;
}



//set servo sweep range - called from the cloud
int  setservomax (String sval){
    servomax = sval.toInt();
      bSweep = true;
    return servomax;
}

Teensy 3.2 or 3.5 Code for controlling the LED matrix display

C/C++
Flash this code to your Teensy 3.2 or 3.5 and connect the LED display to Pins 14-16 and pin 11. Connect the RX1 pin to the Particle Boron the receive the remote string to display. You can also use Serial commands to test - whatever you type in the serial port will display on the LED SCreen. Note: you need this exact library: https://github.com/gauravmm/HT1632-for-Arduino .
//This code receives a string from serial 1 and displays it on an LED matrix 
// this code oruns on a Teensy 3.2 ot 3.5, it may also run on other devices however the LED Matrix library is specifically designed for teensy.

//connect an HT1632 32x8 LED matrix display to the pins shown below.
//connect whatever is transmitting the text to display to pin RX1 at baud 115200

//if you want to test the display, just type into the serial consol , this code monitors the usb serial console as well as Serial 1

//Note: the HT1632 displays can be tricky to get going and you MUST use the library from :https://github.com/gauravmm/HT1632-for-Arduino . 
// this project would not have been possible without the libraty written by //Gaurav Manek "gauravmm"


// Written by : Jasper Pons in 2020 for the NXP hovergames competition.

#include <Arduino.h>
#include <HT1632.h>
#include <font_8x4.h>
  

//-------------------  Connect these pins to the LED display: ------------------------------- 
#define SOFT_SCK_PIN  14 // WR clk 
#define SOFT_MOSI_PIN  15 //DATA  input to device
#define SOFT_MISO_PIN 16 //NO NEEDED-- data  output from device, not needed for led display
#define LEDDISP_CS 11 //cs  for led display

//------- variables needed for new led matrix  -----------//
char leddisplay[] = "D- SCAN     ";
#define ledstartpos 32 
String sToDisplay = "H.GAMES";


 void setup()
{  	
	 Serial.begin(115200);
	 Serial1.begin(115200);
//setup the display -- make sure the library is installed or this will fail!!!
	HT1632.begin(LEDDISP_CS, SOFT_SCK_PIN, SOFT_MOSI_PIN);
	HT1632.renderTarget(1);
	HT1632.clear();
	HT1632.drawText(leddisplay, OUT_SIZE - ledstartpos, 0, FONT_8X4, FONT_8X4_END, FONT_8X4_HEIGHT);
	HT1632.render();
	Serial.println("hello");
	setLEDString("Hello");
}
 
 unsigned int ilastdisplay;
void loop()
{ 
  
  //dont need to refresh the display too often.
	if (millis() - ilastdisplay > 140) {
		setLEDString(sToDisplay);
		ilastdisplay = millis();
	}
	
	//monitor serial port for debugging and testing
	if (Serial.available())
	{
		sToDisplay = Serial.readString();
		Serial.println("you sent:");
		Serial.println(sToDisplay);
	}
	
	//monitor particle boron for messages from the cloud
	if (Serial1.available())
	{
		if (millis() >= 10000)	sToDisplay = Serial1.readString();
		Serial.println("RX1 sent:");
		Serial.println(sToDisplay);

	}

} 




// sets the string to display on the LED matrix
void setLEDString(String sToDisplay) { 
	sToDisplay.toCharArray(leddisplay, 12); 
	// display on the led matrix
	HT1632.renderTarget(1);
	HT1632.clear();
	HT1632.drawText(leddisplay, OUT_SIZE - ledstartpos, 0, FONT_8X4, FONT_8X4_END, FONT_8X4_HEIGHT);
	HT1632.render(); 
}

Credits

Jasper Pons

Jasper Pons

10 projects • 4 followers
founder of www.dronescan.co and www.scanman.co.za

Comments