Hackster is hosting Impact Spotlights: Industrial Automation. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Industrial Automation. Stream on Thursday!
Alex Merchen
Published © GPL3+

Solar Placement Tracker

Using the Lora E5 Mini, create a device to determine where the best sun is actually located.

IntermediateWork in progress4 hours343
Solar Placement Tracker

Things used in this project

Hardware components

SparkFun Snappable Protoboard
SparkFun Snappable Protoboard
×1
Photo resistor
Photo resistor
×1
Resistor 10k ohm
Resistor 10k ohm
×1
QT Py
Adafruit QT Py
×1
Seeed Studio LoRa E5 Mini
×1

Software apps and online services

Arduino IDE
Arduino IDE
The Things Stack
The Things Industries The Things Stack

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)

Story

Read more

Schematics

Breadboard Version

Code

Arduino Test Send Code V1

Java
#include <Adafruit_NeoPixel.h>

int Analog0 = A0;    // select the input pin for the potentiometer
int Analog1 = A1;    // select the input pin for the potentiometer
int Analog2 = A2;    // select the input pin for the potentiometer
int Analog3 = A3;    // select the input pin for the potentiometer
int sValue0 = 0;
int sValue1 = 0;
int sValue2 = 0;
int sValue3 = 0;

void setup() {
    Serial.begin(9600);
    Serial1.begin(9600);
    delay(5000);
    Serial1.write("AT+JOIN");
    delay(10000);
}

void loop() {
    sValue0 = analogRead(Analog0);
    sValue1 = analogRead(Analog1);
    sValue2 = analogRead(Analog2);
    sValue3 = analogRead(Analog3);

    int kavg1 = (sValue0 + sValue2)/2;
    int kavg2 = (sValue1 + sValue3)/2;

    int kdelta = abs(kavg1 - kavg2);

    if (kdelta < 100) {
      char strBuf[50];
      sprintf(strBuf, "AT+MSG=%d", (kavg1+kavg2)/2);
      Serial.println(strBuf);
      Serial1.write(strBuf);
    }

    if (Serial1.available()) {     // If anything comes in Serial1 (pins 0 & 1)
      Serial.write(Serial1.read());   // read it and send it out Serial (USB)
    }
  
    delay(60000);
}

Credits

Alex Merchen
24 projects • 40 followers
I'm an EE with a Masters in ECE. I like building things.
Contact

Comments

Please log in or sign up to comment.