Supla Feeder czyli dawacz smaczków :)

kaju666
Posts: 79
Joined: Wed Feb 16, 2022 12:48 pm
Has thanked: 5 times
Been thanked: 3 times

Post

Hej

W domu zawitał jakiś czas temu szczeniak. Jedyną opcja aby nie stracić mieszkania :) jest danie mu gryzaka lub innego smaczka. Wiadomo przy wyjsciu dostaje pełnego konga czy matę do lizania. Ale brakowało mi tego aby dac mu również coś w połowie dnia :)

Na początku wymyśliłem że będą to chrupki z takiego podajnika:
https://www.thingiverse.com/thing:3051036
Ale sie to nie spisało bo chrupki znikały w mikrosekundach i potwór wracał do zjadania swojego posłania.
(moge dać kod jak ktoś chętny bo obsługiwał on 3 przyciski w zależości od ilości karmy, mozna wykorzystac go też np. do karmienia rybek :P)

Także teraz zbudowałem coś takiego:
signal-2023-01-11-175214_002.jpeg
Umieszczone na skraju szawki kuchennej perfekcyjnie zrzuca czy to ucho wieprzowe czy skóre baranią :)

Projekt w wersji alpha ale wszystko działa :)

W działaniu:
Image

Elementy to: NodeMCU + Silnik 28byj-48-5v-uln2003 + druk 3D

W ustawieniach 8 sekund daje pełny ruch spychacza :)
2023-01-11_18h03_14.png
Kod (nie jestem programista :P) :
Do uzupełnienia - WIFI, GUID, AUTHKEY, SERVER, EMAIL

Code: Select all


#include <SuplaDevice.h>
#include "Stepper_28BYJ_48.h"
#include <supla/control/roller_shutter.h>

// Motor pin definitions:
#define motorPin1  5      // IN1 on the ULN2003 driver
#define motorPin2  4      // IN2 on the ULN2003 driver
#define motorPin3  14     // IN3 on the ULN2003 driver
#define motorPin4  12     // IN4 on the ULN2003 driver

Stepper_28BYJ_48 stepper(motorPin1,motorPin2,motorPin3,motorPin4);

int gpio1 = 1;
int gpio3 = 3;

// Choose where Supla should store roller shutter data in persistant memory
// We recommend to use external FRAM memory 
#define STORAGE_OFFSET 100
#include <supla/storage/eeprom.h>
Supla::Eeprom eeprom(STORAGE_OFFSET);

#ifdef ARDUINO_ARCH_AVR
  #include <supla/network/ethernet_shield.h>
  uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
  Supla::EthernetShield ethernet(mac);

#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
  #include <supla/network/esp_wifi.h>
  Supla::ESPWifi wifi("NAZWAWIFI", "HASLO");
#endif

void setup() {

  Serial.begin(115200);

  pinMode(gpio1,INPUT_PULLUP);
  pinMode(gpio3,INPUT_PULLUP);

  // Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
  char GUID[SUPLA_GUID_SIZE] = {};

  // Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
  char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {};
 

  Supla::Control::RollerShutter *rs = new Supla::Control::RollerShutter(gpio1, gpio3, false);

 
  SuplaDevice.begin(GUID,              // Global Unique Identifier 
                    "svrXX.supla.org",  // SUPLA server address
                    "[email protected]",   // Email address used to login to Supla Cloud
                    AUTHKEY);          // Authorization key
  SuplaDevice.setName("Feeder");
    

}

void loop() {
  SuplaDevice.iterate();
  Feeder();
}

void Feeder() {
  
      if ( digitalRead(gpio1) == LOW ) {
              stepper.step(-1);
              digitalWrite(motorPin1, LOW);
              digitalWrite(motorPin2, LOW);
              digitalWrite(motorPin3, LOW);
              digitalWrite(motorPin4, LOW);
        }
        
      if ( digitalRead(gpio3) == LOW ) {
              stepper.step(1);
              digitalWrite(motorPin1, LOW);
              digitalWrite(motorPin2, LOW);
              digitalWrite(motorPin3, LOW);
              digitalWrite(motorPin4, LOW);
        }


 }
Źródła: PS: Pomysłodawczyni pozdrawia
Image
You do not have the required permissions to view the files attached to this post.
Last edited by kaju666 on Thu Jan 12, 2023 5:45 am, edited 4 times in total.
User avatar
Duch__
Posts: 2199
Joined: Wed Aug 24, 2016 7:26 pm
Location: Opole
Been thanked: 6 times

Post

Fajne, proste.
Zibi
Posts: 646
Joined: Wed Jul 31, 2019 9:20 am
Location: Białogard

Post

Coś zupełnie innego, bardzo ciekawy pomysł.
Nic tak nie cieszy jak własny projekt od "a" do "z".
Radość i satysfakcja jest i szczeniak zadowolony :D

Return to “Projekty użytkowników”