Jade Perreault
Published © CC BY-NC-SA

Helium Solar Monitoring Board with Relays

Arduino with a Helium Monitoring Shield that can monitor motion, temperature, solar power (including volts up to 30VDC and 10A).

IntermediateFull instructions provided3 hours5,314
Helium Solar Monitoring Board with Relays

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Helium Starter Kit (LEGACY)
Helium Starter Kit (LEGACY)
×1
Sparkfun Relay
×1
Adafruit Solar Panel
×1
SparkFun Arduino Stackable header Kit
×1
LTC2945
×1
Raspberry Pi Zero Wireless
Raspberry Pi Zero Wireless
×1

Software apps and online services

fritzing
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Braid
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

3D Printed Bottom

3D Printed Top

Schematics

Arduino Fritzing File

Install fritzing program from fritzing.org ..Download and open

LTC2945 Spec Sheet

Specification sheet for Power sensor

Adruino Etchable PDF

Print out at 100% to chech for size & Placement

Arduino Gerber file for production

go to PCBway.com and do an instant quote for 5 units upload gerber file ..$1.00 per board plus shipping

Bill Of Materials

List of Parts and pieces to make your own shield ..I will also share a mouser.com Shopping list to get everything you need

Arduino Fritizing file

Arduino Gerber File

Uploadable to PCBway.com for making your own board

Code

Arduino Code

C/C++
Copy and paste it into your own sketch ..Install necessary Gihub files enjoy
#include "Arduino.h"
#include "Board.h"
#include "Helium.h"
#include "HeliumUtil.h"
//======================
#include <OneWire.h>
#include "I2Cdev.h"//(MPU6050)
#include "MPU6050_6Axis_MotionApps20.h"
#include <DS18B20.h>//(Temperature Sensor)
#include<stdio.h>
#define BUFSIZE 9
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include "Wire.h"
#endif
//=======================
#define LTCADDR B1101111//Table 1 both LOW (7bit address)
byte ADCvinMSB, ADCvinLSB, curSenseMSB, curSenseLSB, AinVMSB, AinVLSB;
unsigned int ADCvin, ADCcur, AinV;
float inputVoltage, ADCvoltage, current10, current1, current0p1, current0p01;
#define Relay1 5
#define Relay2 6
DS18B20 ds(7);
uint8_t address[] = {40, 250, 31, 218, 4, 0, 0, 52};
uint8_t selected;
MPU6050 accelgyro;

int reading1;
int16_t ax, ay, az;
int16_t gx, gy, gz;
#define OUTPUT_READABLE_ACCELGYRO
#define LED_PIN 13
bool blinkState = false;

//====================
#define CHANNEL_NAME "Helium MQTT"
Helium  helium(&atom_serial);
Channel channel(&helium);

void
setup()
{
  Serial.begin(9600);
  DBG_PRINTLN(F("Starting"));
  helium.begin(HELIUM_BAUD_RATE);
  helium_connect(&helium);
  channel_create(&channel, CHANNEL_NAME);
  Wire.begin();
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
  Wire.begin();
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
  Fastwire::setup(400, true);
#endif
  Serial.println("Initializing I2C devices...");
  accelgyro.initialize();
  // verify connection
  Serial.println("Testing device connections...");
  Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
  //==================
  Serial.print("Devices: ");
  Serial.println(ds.getNumberOfDevices());
  Serial.println();
  //=================
  // configure Arduino LED pin for output
  pinMode(LED_PIN, OUTPUT);
  pinMode (Relay1, OUTPUT);
  pinMode (Relay2, OUTPUT);
  digitalWrite(LED_PIN, HIGH);
  //==========================

}

void
loop()
{
  const char data[HELIUM_MAX_DATA_SIZE];
  char message[56];
  char msg[56];
  int sensorValue;
  int    status;
  int8_t result;
  int v = (inputVoltage);
  int c = (current0p01);
  int t = (ds.getTempC());
  int m1 = (ax);
  int m2 = (ay);
  int m3 = (az);

  Wire.beginTransmission(LTCADDR);//first get Input Voltage - 80V max
  Wire.write(0x1E);
  Wire.endTransmission(false);
  Wire.requestFrom(LTCADDR, 2, true);
  delay(1);
  ADCvinMSB = Wire.read();
  ADCvinLSB = Wire.read();
  ADCvin = ((unsigned int)(ADCvinMSB) << 4) + ((ADCvinLSB >> 4) & 0x0F);//formats into 12bit integer
  inputVoltage = ADCvin * 0.025; //25mV resolution
  Wire.beginTransmission(LTCADDR);//get ADC Input 2V max
  Wire.write(0x28);
  Wire.endTransmission(false);
  Wire.requestFrom(LTCADDR, 2, true);
  delay(1);
  AinVMSB = Wire.read();
  AinVLSB = Wire.read();
  AinV = ((unsigned int)(AinVMSB) << 4) + ((AinVLSB >> 4) & 0x0F);//12 bit format
  ADCvoltage = AinV * 0.5E-3; //500uV resolution
  Wire.beginTransmission(LTCADDR);//get sense current
  Wire.write(0x14);
  Wire.endTransmission(false);
  Wire.requestFrom(LTCADDR, 2, true);
  delay(1);
  curSenseMSB = Wire.read();
  curSenseLSB = Wire.read();
  ADCcur = ((unsigned int)(curSenseMSB) << 4) + ((curSenseLSB >> 4) & 0x0F);//12 bit format
  current0p1 = ADCcur * (25E-3) / 0.1; //1A max, unit is mA
  Serial.print("Volts_");
  Serial.println(inputVoltage);
  Serial.print("Amps_");
  Serial.println(current0p01, 2);
  delay(1000);
  //======================================
  accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
#ifdef OUTPUT_READABLE_ACCELGYRO
  // display tab-separated accel/gyro x/y/z values
  //  Serial.print("a/g:\t");
  Serial.print(ax); Serial.print("\t");
  Serial.print(ay); Serial.print("\t");
  Serial.println(az); Serial.print("\t");

#endif
  delay(5000);
  //==========================================
  while (ds.selectNext())
  {
    switch (ds.getFamilyCode())
      // Print address.
      uint8_t address[8];
    ds.getAddress(address);
    for (uint8_t i = 0; i < 8; i++)
      (ds.getResolution());
    Serial.print(ds.getTempC());
    Serial.print(" C / ");
    Serial.print(ds.getTempF());
    Serial.println(" F");
    sensorValue = ds.getTempC();

    //==================
    snprintf(data, 75, "V %d:A %d:T %d:X %d:Y %d:Z %d",v,c,t,m1,m2,m3);//NOTE: The values V,A,T,X,Y,Z are needed for the next step
    channel_send(&channel, CHANNEL_NAME, data, strlen(data));
    delay(5000);

    reading1 = (ds.getTempC());
  }
  if ( reading1 <= "25") {
  digitalWrite(Relay1, LOW);
    Serial.println("FAN_ON");
  }
  else {
    digitalWrite(Relay1, HIGH);
    Serial.println("FAN_Off");
    delay(1);// delay in between reads for stability
  }
  //===========================================================
}

Credits

Jade Perreault

Jade Perreault

32 projects • 59 followers
27 Years as a Journeyman Electrician , 4 Years as a PCB design engineer for Penteon Corporation Out of New York ..

Comments