Kelvin
Published

Firewood-free mini fireplace

A fire-free fireplace allows you to avoid some unnecessary accidental like sparks of the wood ignite the attached hay.

BeginnerFull instructions provided1 hour288
Firewood-free mini fireplace

Things used in this project

Hardware components

Seeeduino V4.2
Seeed Studio Seeeduino V4.2
×1
Base Shield V2
Seeed Studio Base Shield V2
×1
Grove - Ultrasonic Ranger
Seeed Studio Grove - Ultrasonic Ranger
×1
Grove - RGB LED Ring (20 - WS2813 Mini)
Seeed Studio Grove - RGB LED Ring (20 - WS2813 Mini)
I am using Ultimate RGB LED Ring from Seeed Studio
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Connecting all the components

Code

Untitled file

C/C++
#include <Ultrasonic.h>
#include "Adafruit_NeoPixel.h"
Ultrasonic ultrasonic(A0); //Set your sensor Pin

int ledstripPin = A3; //Set your RGB Ring Pin
int intnumber;
#define NUMPIXELS      48 // Set your # of the PIXELS (in my case I have 48 pixels in my ring)
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, ledstripPin, NEO_GRB + NEO_KHZ800);

 
int delayval = 1;
void setup() {
  Serial.begin(9600);
  pinMode(A3,OUTPUT);// dentifie your pin as output
  pinMode(A0,INPUT);// dentifie your pin as input
 
#if defined (__AVR_ATtiny85__)
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif

  
  pixels.begin();
}

void loop() {

long sensorvalue;
long MeasureIn;



  sensorvalue = ultrasonic.MeasureInCentimeters();//Set your measure in cm or inch or else

 int sensor = (int)sensorvalue;
  Serial.print("cm"); // If you want measure in inch change the 'cm' to inch 
  Serial.println(sensorvalue);
  Serial.println(sensor);
  if(sensor<15){  //Set a range for your sensor
     for(int i=0;i<NUMPIXELS;i++){
 
     pixels.setBrightness(255);// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(255,69,19)); // Moderately bright green color.
 
    pixels.show(); // This sends the updated pixel color to the hardware.
 
    delay(delayval);
    Serial.println("1");
  }
  }
  else if(sensor>15){ //Set a range for your sensor

    //digitalWrite(A5,HIGH);
 for(int i=0;i<NUMPIXELS;i++){
   pixels.setBrightness(50); // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(255,69,19)); // Moderately bright green color.
  
    pixels.show(); // This sends the updated pixel color to the hardware.
 
    delay(delayval);
    Serial.println("2");
 }
  }



}

Credits

Kelvin

Kelvin

1 project • 0 followers

Comments