Mitomon
Published © GPL3+

Automatic Flying Bug Killer

A solar powered, cloud-connected device to dispatch annoying summertime pests efficiently.

IntermediateFull instructions provided2 hours12,663
Automatic Flying Bug Killer

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
DHT22 Temperature Sensor
DHT22 Temperature Sensor
×1
Helium Starter Kit (LEGACY)
Helium Starter Kit (LEGACY)
×1
DFRobot Sunflower Solar Manager 9V/12V/18V
×1

Software apps and online services

Arduino Web Editor
Arduino Web Editor

Story

Read more

Code

Arduino Code

C/C++
/*
 * Copyright 2017, Helium Systems, Inc.
 * All Rights Reserved. See LICENCE.txt for license information
 */

#include "Arduino.h"
#include "Board.h"
#include "Helium.h"
#include "HeliumUtil.h"
#include "DHT.h"

#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
// NOTE: Please ensure you've created a channel with the above
// CHANNEL_NAME as it's name.
#define CHANNEL_NAME "helium-bug-destroyer"

Helium  helium(&atom_serial);
Channel channel(&helium);

DHT dht(DHTPIN, DHTTYPE);

void
setup()
{
    Serial.begin(9600);
    DBG_PRINTLN(F("Starting"));

    // Begin communication with the Helium Atom
    // The baud rate differs per supported board
    // and is configured in Board.h
    helium.begin(HELIUM_BAUD_RATE);

    // Connect the Atom to the Helium Network
    helium_connect(&helium);

    // Begin communicating with the channel. This should only need to
    // be done once. The HeliumUtil functions add simple retry logic
    // to re-create a channel if it disconnects.
    channel_create(&channel, CHANNEL_NAME);
    
  DHT dht(DHTPIN, DHTTYPE);
}

void
loop()
{
    float t = dht.readTemperature();

    // Send temperature to channel
    channel_send(&channel, CHANNEL_NAME, t, 4);//floats are 4 bytes

    // Wait about 5 seconds
    delay(5000);
}

Credits

Mitomon

Mitomon

10 projects • 28 followers
Programming Polyglot Pianist :P

Comments