Industriële fabricage
Industrieel internet der dingen | Industriële materialen | Onderhoud en reparatie van apparatuur | Industriële programmering |
home  MfgRobots >> Industriële fabricage >  >> Manufacturing Technology >> Productieproces

Octopod:Smart IoT Home/Industry Automation Project

Componenten en benodigdheden

Arduino UNO
× 1
Arduino MKR WiFi 1010
Dit of een andere Wifi ESP8266/ ESP32Dit was niet beschikbaar in mijn land, dus ging ik met NodeMCU ESP8266
× 1
Maxim Integrated MAX32630FTHR
Je kunt kiezen tussen MAX32620FTHR, Arduino 1010 of een willekeurig ESP8266-bord. Met dit bord heb je externe wifi nodig Module of een Esp8266-chip voor Interent
× 1
Raspberry Pi Zero Wireless
Je kunt ook normale Raspi 2/3 gebruiken!
× 1
DHT11 temperatuur- en vochtigheidssensor (4 pinnen)
× 1
Seeed Grove - Gassensor(MQ2)
× 1
SparkFun Bodemvochtsensor (met schroefaansluitingen)
× 1
PIR-bewegingssensor (algemeen)
Optioneel
× 1
RFID-lezer (algemeen)
× 1
Relais (algemeen)
Bij voorkeur 2 kanalen
× 1
RGB diffuse gemeenschappelijke kathode
× 1
Raspberry Pi-cameramodule
× 1
Servo's (Tower Pro MG996R)
× 1
Zoemer
× 2
HC-05 Bluetooth-module
Optioneel
× 1
LED (generiek)
× 4
Wandadapter/ Powerbank
× 2
Geheugenkaart
meer dan 4 Gb en bij voorkeur Class 10 (vereist voor Raspberry Pi OS)
× 1

Benodigde gereedschappen en machines

Hot lijmpistool (algemeen)
3D-printer (algemeen)
Optioneel
Handgereedschap
Naaldbektang, schaar, snijder enz.

Apps en online services

Blynk
OpenCV

Over dit project

Er zijn veel IoT-automatiseringsprojecten, maar geloof me, zoiets bestaat niet! Octopod is gemaakt met behulp van NodeMCU (MAX32620FTHR of Arduino MKR 1010), Arduino Uno, en Raspberry Pi 3 . Met Octopod maak je je huis slim. Octopod stuurt u verschillende gegevens, zoals temperatuur , vochtigheid, en gaskwaliteit in uw huis/kantoor/industrie. Octopod stuurt je een melding wanneer het enige vorm van beweging detecteert binnen en vertelt je wanneer je je planten water moet geven . U kunt ook uw apparaten . bedienen via een Blynk applicatie op je smartphone. Octopod maakt zelfs echte stemmingsverlichting mogelijk!

Octopod is uitgerust met een piepklein camera , die u live feed . stuurt . Deze camera maakt ook gebruik van kunstmatige intelligentie om mensen in zijn zicht te detecteren en je hun foto's te sturen . Bovendien beschikt het over een RFID deurvergrendeling systeem ! Geweldig, toch?

Hoe alles werkt?

De NodeMCU is verbonden met een aantal sensoren, een relaismodule en RGB-leds. Hij is via wifi verbonden met de Blynk-app op een smartphone, die alle data verstuurt en waarmee je je huis kunt bedienen.

Raspberry Pi is ook verbonden met wifi, waardoor je de live feed via de Pi Camera kunt zien. We hebben ook OpenCV-bibliotheken op de Pi geïnstalleerd en de Pi geconfigureerd om mensen in zijn zicht te detecteren en u hun afbeeldingen te e-mailen.

De slimme deurunit maakt gebruik van een RFID-module. Wanneer de toegestane RFID binnen zijn bereik wordt gebracht, opent deze automatisch de deur.

STAP 1:Belangrijkste Octopod coderen

Ik heb op bijna elke regel commentaar toegevoegd, dus je kopieert niet alleen, maar je begrijpt het ook. Hier zal ik je in een notendop vertellen wat er werkelijk gebeurt als de code wordt uitgevoerd!

  • Inclusief de bibliotheken:

Deze code gebruikt 2 hoofdbibliotheken, de Blynk-bibliotheek om de code compatibel te maken met de Blynk-toepassing en de andere bibliotheek is de DHT11-temperatuurbibliotheek, die de onbewerkte gegevens van de sensor omzet in temperatuur en vochtigheid. Om deze bibliotheken te downloaden, gaat u naar de gegeven links in de code en downloadt u ze. Ga dan naar Arduino IDE Schets → Bibliotheek opnemen → Zip-bibliotheek toevoegen en uw gedownloade bibliotheken selecteren.

#include //Include Blynk Library#include //Include Blynk Library#include //Include DHT-sensorbibliotheek#define BLYNK_PRINT Serial 

Dit is een Blynk-code waarmee u uw nodemcu met internet kunt verbinden en vervolgens kunt verifiëren bij uw app.

// Je zou Auth Token in de Blynk-app moeten krijgen.// Ga naar de projectinstellingen (moerpictogram).char auth[] ="Your Auth Key";// Je wifi-inloggegevens.// Set wachtwoord naar "" voor open netwerken.char ssid[] ="Uw WiFi SSID";char pass[] ="Uw WiFi Pass"; 
  • Pinnen en gehele getallen definiëren:

In dit segment definiëren we de pinnen van onze verschillende sensoren. U kunt ze wijzigen volgens uw overtuiging. We definiëren ook enkele gehele getallen die we meestal gebruiken in de loop van onze code.

#define DHTPIN 2 // Waarop digitale pin temperatuur- en vochtigheidssensor is aangesloten#define soilPin 4 // Waar digitale pin bodemvochtsensor op is aangesloten#define gasPin A0 // Welke analoge pin gassensor is aangesloten to#define pirPin 12 // Welke digitale pin bodemvochtsensor is aangesloten op int pirValue; // Plaats om lees PIR Valueint soilValue op te slaan; // Plaats om op te slaan lees Bodemvocht Valueint PIRpinValue; // Plaats om de waarde op te slaan die is verzonden door Blynk App Pin V0int SOILpinValue; // Plaats om de waarde op te slaan die is verzonden door Blynk App Pin V1 
  • BLYNK_WRITE() :

Met deze code vertellen we de Blynk-app dat deze pin V0 en pin V1 kan gebruiken om de code te vertellen of bewegingsdetectie en bodemvochttest zijn ingeschakeld.

BLYNK_WRITE(V0) //VO-pin van de Blynk-app geeft aan of bewegingsdetectie AAN staat { PIRpinValue =param.asInt(); } BLYNK_WRITE (V1) // V1-pin van de Blynk-app geeft aan of Bodemvocht AAN is {SOILpinValue =param.asInt(); } 
  • void sendSensor() :

Deze code haalt de gegevens van DHT11 om het bruikbaar te maken en stuurt het vervolgens naar respectievelijk Pin V5 en V6.

void sendSensor(){ int h =dht.readHumidity(); int t =dht.readTemperature(); // of dht.readTemperature(true) for Fahrenheit if (isnan(h) || isnan(t)) { Serial.println("Kan niet lezen van DHT-sensor!"); // om te controleren of de sensor geen valse waarden retourneert; } // U kunt op elk moment elke waarde verzenden. // Stuur niet meer dan 10 waarden per seconde. Blynk.virtualWrite(V5, h); // stuur vochtigheid naar pin V5 Blynk.virtualWrite (V6, t); // stuur temperatuur naar pin V7} 
  • void getPirValue() &void getSoilValue() :

Leest de digitale waarde van de sensoren en voert vervolgens een if else-conditie uit om de status van de sensor te controleren. Als de sensor de gewenste status heeft, stuurt hij een melding van de Blynk-app.

void getPirValue(void){ pirValue =digitalRead(pirPin); if (pirValue) //digitale pin van PIR geeft hoge waarde aan menselijke detectie {Serial.println ("Beweging gedetecteerd"); Blynk.notify("Beweging gedetecteerd"); }}void getSoilValue(void){ soilValue =digitalRead(soilPin); if (soilValue ==HIGH) //digitale pin van bodemsensor geeft een lage waarde wanneer de luchtvochtigheid lager is {Serial.println("Water Plants"); Blynk.notify("Waterplanten"); }} 
  • ongeldige setup() :

In de setup doen we een aantal dingen die maar één keer bedoeld zijn. Zoals:de seriële communicatie starten met een vaste baudrate, deze code autoriseren voor de Blynk-toepassing, de Dht-sensormetingen beginnen, vervolgens tweeten naar uw Twitter-handle dat uw Smart Home-project online is en vervolgens het knooppunt vertellen dat Pir Pin en Bodemsensor Pin is bedoeld om alleen invoer te ontvangen.

void setup(){ // Debug console Serial.begin(9600); Blynk.begin(auth, ssid, pass); // U kunt ook de server specificeren://Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442); //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1.100), 8442); dht.begin(); // Begint DHT met het lezen van Blynk.tweet ("OCTOPOD IS ONLINE! "); // Twitteren op je Twitter Handvat dat je projecteert is online pinMode(pirPin,INPUT); // Definiëren dat Pir Pin bedoeld is om alleen invoer pinMode (soilPin, INPUT) te gebruiken; // Definiëren dat de bodemsensorpin bedoeld is om alleen invoer te gebruiken // Stel een functie in die elke seconde moet worden aangeroepen timer.setInterval(1000L, sendSensor);} 
  • void loop() :

In de loop schrijven we dingen die steeds opnieuw moeten worden gedaan. Hier zorgen we ervoor dat de code die we voor de installatie hebben geschreven, wordt uitgevoerd. Vervolgens schrijven we 2 If-Else Statements die de toestanden van Pin V0 en Pin V1 controleren en dienovereenkomstig de waarden van de sensoren overnemen.

void loop(){ Blynk.run(); timer.run(); if (PIRpinValue ==HIGH) // VO-pin van de Blynk-app geeft aan of bewegingsdetectie AAN is { getPirValue (); } if (SOILpinValue ==HIGH) // V1-pin van de Blynk-app vertelt of Bodemvocht AAN is {getSoilValue(); } } 

STAP 2:Het RFID Smart Lock coderen

Om eerlijk te zijn, dit is een eenvoudige en gemakkelijke code en behoeft niet veel uitleg. Maar ik zal je nog steeds in een notendop vertellen wat dit doet. Er zijn twee versies van de code, de ene is als u de deureenheid wilt verbinden met Bluetooth, zodat deze u via de seriële terminal laat weten wanneer uw deur open is. Andere zendt naar serieel zodat het kan worden bekeken als u uw Arduino op uw computer aansluit. Ik geef echter de voorkeur aan eenvoudig zonder Bluetooth-versie. Dus hier gaan we!

  • Ga naar Sketch → Bibliotheek opnemen → Bibliotheek beheren → Typ in de zoekbalk MFRC522 en installeer de bibliotheek. Ga dan naar Bestand → Voorbeelden → Aangepaste bibliotheken → MFRC522 → dumpInfo Sketch. In het begin kunt u lezen hoe u pinnen aansluit (of raadpleeg de afbeelding). Voer vervolgens de code uit en open de seriële monitor en breng een van uw Rfid-kaart voor de MFRC522-module en wacht 5 seconden. Noteer vervolgens de UID van de kaart op dezelfde manier en noteer de UID's van uw andere kaarten en sleutelhangers.
  • Download vervolgens welke code je maar wilt. Open de code en ga naar deze regel. Voeg hier in plaats van deze X's de UID toe van de kaart die u wilt gebruiken om de deur te openen. Nu ben je klaar, upload gewoon de code.
if (content.substring(1) =="XX XX XX XX") {} 

In deze code zijn er twee belangrijke dingen die we doen, namelijk in het If-Else deel van de code. Als we de Arduino vertellen dat als de UID van de kaart overeenkomt met de genoemde UID, de servo beweegt (zodat de deur opengaat) en een paar led's laat knipperen en wat geluiden maakt met behulp van de zoemer. Anders, als de UID's geen led's laten knipperen en geluiden maken met behulp van de zoemer.

STAP 3:Raspberry Pi Human Detection AI Setup

In deze begeleide stap gaan we leren hoe je een slimme beveiligingscamera kunt maken. De camera stuurt je een e-mail wanneer hij het object detecteert en als je op hetzelfde wifi-netwerk zit, kun je toegang krijgen tot de livebeelden van de camera door het IP-adres van je Raspberry Pi in te voeren. Ik zal je laten zien hoe je de slimme camera helemaal opnieuw kunt maken. Laten we gaan!

Vereisten:

1. OpenCV (Open Source Computer Vision Library)

2. Raspberry Pi 3B

3. Raspberry Pi-camera V2

Aannames:

1. Raspberry Pi 3 met Raspbian Stretch geïnstalleerd. Als je het Raspbian Stretch-besturingssysteem nog niet hebt, moet je je besturingssysteem upgraden om te profiteren van de nieuwe functies van Raspbian Stretch.

Om je Raspberry Pi 3 te upgraden naar Raspbian Stretch, kun je deze hier downloaden en deze upgrade-instructies volgen (of deze voor de NOOBS-route die wordt aanbevolen voor beginners).

Opmerking:als u uw Raspberry Pi 3 upgradet van Raspbian Jessie naar Raspbian Stretch, is er kans op problemen. Ga op eigen risico te werk en raadpleeg de Raspberry Pi-forums voor hulp. Belangrijk:ik raad je aan om door te gaan met een nieuwe installatie van Raspbian Stretch! Upgraden van Raspbian Jessie wordt niet aanbevolen.

2. Fysieke toegang tot je Raspberry Pi 3 zodat je een terminal kunt openen en opdrachten kunt uitvoeren Toegang op afstand via SSH of VNC. Ik doe het grootste deel van deze tutorial via SSH, maar zolang je toegang hebt tot een terminal, kun je het gemakkelijk volgen.

  • Stap 1:DE CAMERA AAN DE RASPBERRY PI 3 BEVESTIGEN

1. Open uw Raspberry Pi Camera-module. Houd er rekening mee dat de camera kan worden beschadigd door statische elektriciteit. Voordat u de camera uit de grijze antistatische zak haalt, moet u ervoor zorgen dat u zich hebt ontladen door een geaard voorwerp aan te raken (bijv. een radiator of pc-chassis).

2. Installeer de Raspberry Pi Camera-module door de kabel in de Raspberry Pi te steken. De kabel past in de connector tussen de Ethernet- en HDMI-poorten, met de zilveren connectoren naar de HDMI-poort gericht.

3. Start je Raspberry Pi op.

4. Voer vanaf de prompt "sudo raspi-config" uit. Als de optie "camera" niet in de lijst staat, moet u een paar opdrachten uitvoeren om uw Raspberry Pi bij te werken. Voer "sudo apt-get update" en "sudo apt-get upgrade" uit

5. Voer "sudo raspi-config" opnieuw uit - u zou nu de optie "camera" moeten zien.

COMMANDO-

$ sudo raspi-config 

6. Navigeer naar de "camera"-optie en schakel deze in (uitkijk in interface-optie). Selecteer "Voltooien" en start uw Raspberry Pi opnieuw op of typ het volgende:

$ sudo reboot 
  • Stap 2:OPEN CV-INSTALLATIE

Als dit de eerste keer is dat u OpenCV installeert of als u net begint met Rasbian Stretch. Dit is de perfecte tutorial voor jou.

Stap #1:bestandssysteem uitbreiden

Gebruik je een gloednieuwe installatie van Raspbian Stretch? Als dat het geval is, moet u eerst uw bestandssysteem uitbreiden om alle beschikbare ruimte op uw micro-SD-kaart op te nemen:

COMMANDO-

$ sudo raspi-config 

selecteer vervolgens het menu-item "Geavanceerde opties" en selecteer vervolgens "Bestandssysteem uitbreiden". Zodra daarom wordt gevraagd, moet u de eerste optie selecteren, "A1. Vouw Bestandssysteem uit", druk op Enter op uw toetsenbord, pijl omlaag naar de knop "" en start vervolgens uw Pi opnieuw op. Als u een kaart van 8 GB gebruikt, gebruikt u mogelijk bijna 50% van de beschikbare ruimte, dus een eenvoudig ding om te doen is om zowel LibreOffice als Wolfram-engine te verwijderen om wat ruimte op uw PI vrij te maken:

COMMANDO-

$ sudo apt-get purge wolfram-engine $ sudo apt-get purge libreoffice* $ sudo apt-get clean$ sudo apt-get autoremove 

Na het verwijderen van de Wolfram Engine en LibreOffice, kunt u bijna 1 GB terugvorderen!

Stap #2: Afhankelijkheden installeren

Dit is niet de eerste keer dat ik heb besproken hoe OpenCV op de Raspberry Pi moet worden geïnstalleerd, dus ik zal deze instructies aan de kortere kant houden, zodat je het installatieproces kunt doorlopen:ik heb ook de hoeveelheid tijd opgenomen het duurt om elke opdracht uit te voeren (sommige zijn afhankelijk van uw internetsnelheid), zodat u uw OpenCV + Raspberry Pi 3-installatie dienovereenkomstig kunt plannen (OpenCV zelf duurt ongeveer 4 uur om te compileren - hierover later meer). De eerste stap is het updaten en upgraden van bestaande pakketten:

COMMANDO-

$ sudo apt-get update &&sudo apt-get upgrade  

We moeten dan enkele ontwikkelaarstools installeren, waaronder CMake, waarmee we het OpenCV-bouwproces kunnen configureren:Raspbian Stretch:Installeer OpenCV 3 + Python op uw Raspberry Pi

COMMANDO-

$ sudo apt-get install build-essentiële cmake pkg-config 

Vervolgens moeten we enkele image I/O-pakketten installeren waarmee we verschillende imagebestandsformaten van schijf kunnen laden. Voorbeelden van dergelijke bestandsindelingen zijn JPEG, PNG, TIFF, enz.:Raspbian Stretch

COMMANDO-

$ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev 

Net zoals we I/O-pakketten voor afbeeldingen nodig hebben, hebben we ook I/O-pakketten voor video nodig. Met deze bibliotheken kunnen we verschillende videobestandsindelingen van schijf lezen en rechtstreeks met videostreams werken

COMMANDO-

$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev $ sudo apt-get install libxvidcore-dev libx264-dev 

De OpenCV-bibliotheek wordt geleverd met een submodule met de naam highgui die wordt gebruikt om afbeeldingen op ons scherm weer te geven en basis-GUI's te bouwen. Om de highgui-module te compileren, moeten we de GTK-ontwikkelbibliotheek installeren:Raspbian Stretch:Installeer OpenCV 3 + Python op uw Raspberry Pi

COMMANDO-

$ sudo apt-get install libgtk2.0-dev libgtk-3-dev 

Veel bewerkingen binnen OpenCV (namelijk matrixbewerkingen) kunnen verder worden geoptimaliseerd door een paar extra afhankelijkheden te installeren:

COMMANDO-

$ sudo apt-get install libatlas-base-dev gfortran 

Deze optimalisatiebibliotheken zijn vooral belangrijk voor apparaten met beperkte middelen, zoals de Raspberry Pi. Laten we tot slot zowel de headerbestanden van Python 2.7 als Python 3 installeren, zodat we OpenCV kunnen compileren met Python-bindingen:Raspbian Stretch

COMMANDO-

$ sudo apt-get install python2.7-dev python3-dev  

Als u werkt met een nieuwe installatie van het besturingssysteem, is het mogelijk dat deze versies van Python al de nieuwste versie hebben (u ziet een terminalbericht waarin dit wordt vermeld). Als u deze stap overslaat, ziet u mogelijk een fout met betrekking tot het Python.h-headerbestand dat niet wordt gevonden wanneer make wordt uitgevoerd om OpenCV te compileren. Stap 3:Download de OpenCV-broncode

Stap #3:Download de OpenCV broncode

Nu we onze afhankelijkheden hebben geïnstalleerd, laten we het 3.3.0-archief van OpenCV uit de officiële OpenCV-repository halen. Deze versie bevat de dnn-module die we bespraken in een vorige post waarin we Deep Learning met OpenCV deden (Opmerking:aangezien toekomstige versies van openCV worden uitgebracht, kunt u 3.3.0 vervangen door het nieuwste versienummer):

COMMANDO-

$ cd ~ $ wget -O opencv.zip   https://github.com/Itseez/opencv/archive/3.3.0.zi...>> p$ opencv.zip uitpakken

We willen de volledige installatie van OpenCV 3 (om toegang te hebben tot functies zoals SIFT en SURF, bijvoorbeeld), dus we moeten ook de opencv_contrib-repository pakken:Raspbian Stretch:Installeer OpenCV 3 + Python op je Raspberry Pi

COMMANDO-

$ wget -O opencv_contrib.zip   https://github.com/Itseez/opencv_contrib/archive/...>>3.3.0$ unzip opencv_contrib.zip 

Mogelijk moet u de bovenstaande opdracht uitbreiden met de knop "<=>" tijdens het kopiëren en plakken. De .zip in de 3.3.0.zip lijkt in sommige browsers te zijn afgesloten. De volledige URL van het OpenCV 3.3.0-archief is:https://github.com/Itseez/opencv_contrib/archive/... Opmerking:zorg ervoor dat uw opencv- en opencv_contrib-versies hetzelfde zijn (in dit geval 3.3.0) . Als de versienummers niet overeenkomen, zult u waarschijnlijk compile-time- of runtime-fouten tegenkomen. Stap 4:Python 2.7 of Python 3? Voordat we kunnen beginnen met het compileren van OpenCV op onze Raspberry Pi 3, moeten we eerst pip installeren, een Python-pakketbeheerder

COMMANDO-

$ wget    https://bootstrap.pypa.io/get-pip.py> 
>>
>$ sudo python get-pip.py $ sudo python3 get-pip.py 

Het kan zijn dat je bij het geven van deze commando's een melding krijgt dat pip al up-to-date is, maar je kunt deze stap beter niet overslaan. Als je al heel lang PyImageSearch-lezer bent, weet je dat ik een grote fan ben van zowel virtualenv als virtualenvwrapper.

Het installeren van deze pakketten is geen vereiste en je kunt OpenCV absoluut zonder ze installeren, maar dat gezegd hebbende, raad ik je ten zeerste aan om ze te installeren, aangezien andere bestaande PyImageSearch-tutorials (evenals toekomstige tutorials) ook gebruikmaken van virtuele Python-omgevingen.

Ik ga er ook van uit dat je zowel virtualenv als virtualenvwrapper hebt geïnstalleerd in de rest van deze handleiding. Dus, gezien dat, wat heeft het voor zin om virtualenv en virtualenvwrapper te gebruiken? Ten eerste is het belangrijk om te begrijpen dat een virtuele omgeving een speciaal hulpmiddel is dat wordt gebruikt om de afhankelijkheden die nodig zijn voor verschillende projecten op afzonderlijke plaatsen te houden door voor elk van hen geïsoleerde, onafhankelijke Python-omgevingen te creëren. Kortom, het lost het dilemma "Project X is afhankelijk van versie 1.x, maar Project Y heeft 4.x nodig" op.

Het houdt ook uw wereldwijde site-pakketten netjes, opgeruimd en vrij van rommel. Als je een volledige uitleg wilt over waarom virtuele Python-omgevingen een goede gewoonte zijn, lees dan zeker deze uitstekende blogpost op RealPython. Het is een standaardpraktijk in de Python-gemeenschap om een ​​of andere virtuele omgeving te gebruiken, dus ik raad je ten zeerste aan hetzelfde te doen:

COMMANDO-

$ sudo pip install virtualenv virtualenvwrapper$ sudo rm -rf ~/.cache/pip  

Nu zowel virtualenv als virtualenvwrapper zijn geïnstalleerd, moeten we ons ~/.profile-bestand bijwerken. voeg de volgende regels toe aan de onderkant van het bestand:Raspbian Stretch

COMMANDO-

$ nano ~/.profile 

Kopieer en plak de volgende regels onderaan het bestand:

COMMANDO-

# virtualenv en virtualenvwrapperWORKON_HOME=$HOME/.virtualenvs bron /usr/local/bin/virtualenvwrapper.sh  

OF

Je moet gewoon cat en output omleiding gebruiken om het updaten af ​​te handelen ~/.profile :

COMMANDO-

$ echo -e "\n# virtualenv en virtualenvwrapper">> ~/.profile $ echo "exportWORKON_HOME=$HOME/.virtualenvs">> ~/.profile$ echo "source /usr/local/ bin/virtualenvwrapper.sh">> ~/.profile  

Nu we ons ~/.profile hebben bijgewerkt, moeten we het opnieuw laden om ervoor te zorgen dat de wijzigingen van kracht worden. U kunt een herladen van uw ~/.profile-bestand forceren door:Uit te loggen en vervolgens weer in te loggen.

Een terminalinstantie sluiten en een nieuwe openen

Of mijn persoonlijke favoriet

COMMANDO-

$ bron ~/.profile  

Opmerking :Ik raad aan om elke keer dat je een nieuwe terminal opent het bronbestand ~/.profile uit te voeren om er zeker van te zijn dat je systeemvariabelen correct zijn ingesteld. Uw virtuele Python-omgeving maken Laten we vervolgens de virtuele Python-omgeving maken die we zullen gebruiken voor de ontwikkeling van computervisie:

COMMANDO-

$ mkvirtualenv cv -p python2  

Deze opdracht maakt een nieuwe virtuele Python-omgeving met de naam cv met behulp van Python 2.7.

Als u in plaats daarvan Python 3 wilt gebruiken, wilt u in plaats daarvan deze opdracht gebruiken:

COMMANDO-

$ mkvirtualenv cv -p python3 

Nogmaals, ik kan dit punt niet genoeg benadrukken:de cv Python virtuele omgeving is volledig onafhankelijk en afgezonderd van de standaard Python-versie die is opgenomen in de download van Raspbian Stretch.

Any Python packages in the global site-packages directory will not be available to the cv virtual environment. Similarly, any Python packages installed in site-packages of cv will not be available to the global install of Python.

Keep this in mind when you’re working in your Python virtual environment and it will help avoid a lot of confusion and headaches. How to check if you’re in the “cv” virtual environment If you ever reboot your Raspberry Pi; log out and log back in; or open up a new terminal, you’ll need to use the workon command to re-access the cv virtual environment.

In previous blog posts, I’ve seen readers use the mkvirtualenv command — this is entirely unneeded! Themkvirtualenv command is meant to be executed only once:to actually create the virtual environment. After that, you can use workon and you’ll be dropped down into your virtual environment:

COMMAND-

$ source ~/.profile $ workon cv 

To validate and ensure you are in the cv virtual environment, examine your command line — if you see the text (cv) preceding your prompt, then you are in the cv virtual environment:Make sure you see the “(cv)” text on your prompt, indicating that you are in the cv virtual environment.

Otherwise, if you do not see the (cv) text, then you are not in the cv virtual environment:

If you do not see the “(cv)” text on your prompt, then you are not in the cv virtual environment and need to run “source” and “workon” to resolve this issue. To fix this, simply execute the source and workon commands mentioned above. Installing NumPy on your Raspberry Pi Assuming you’ve made it this far, you should now be in the cv virtual environment (which you should stay in for the rest of this tutorial).

Step #4 :Installing NumPy on your Raspberry Pi

Our only Python dependency is NumPy, a Python package used for numerical processing:

COMMAND-

$ pip install numpy  

the NumPy installation can take a bit of time.

Step #5:Compile and Install OpenCV

COMMAND-

$ workon cv 

Once you have ensured you are in the cv virtual environment, we can setup our build using CMake:

COMMAND-

$ cd ~/opencv-3.3.0/ $ mkdir build $ cd build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \ -D BUILD_EXAMPLES=ON .. 

Now, before we move on to the actual compilation step, make sure you examine the output of CMake! Start by scrolling down the section titled Python 2 and Python 3 . If you are compiling OpenCV 3 for Python 2.7, then make sure your Python 2 section includes valid paths to the Interpreter, Libraries, numpy and packages

Checking that Python 3 will be used when compiling OpenCV 3 for Raspbian Stretch on the Raspberry Pi 3. Notice how the Interpreter points to our python2.7 binary located in the cv virtual environment. The numpy variable also points to the NumPy installation in the cv environment.

Again, the Interpreter points to our python3.5 binary located in the cv virtual environment while numpy points to our NumPy install.

In either case, if you do not see the cv virtual environment in these variables paths, it’s almost certainly because you are NOT in the cv virtual environment prior to running CMake! If this is the case, access the cv virtual environment using workon cv and re-run the cmake command outlined above.

Configure your swap space size before compiling Before you start the compile process, you should increase your swap space size. This enables OpenCV to compile with all four cores of the Raspberry PI without the compile hanging due to memory problems.

Open your /etc/dphys-swapfile and then edit the CONF_SWAPSIZE variable

COMMAND-

$ nano /etc/dphys-swapfile  

and then edit the following section of the file:#set size to absolute value, leaving empty (default) then uses computed value # you most likely don't want this, unless you have an special disk situation

# CONF_SWAPSIZE=100 CONF_SWAPSIZE =1024 

Notice that I’ve commented out the 100MB line and added a 1024MB line. This is the secret to getting compiling with multiple cores on the Raspbian Stretch. If you skip this step, OpenCV might not compile.

To activate the new swap space, restart the swap service:

COMMAND-

$ sudo /etc/init.d/dphys-swapfile stop $ sudo /etc/init.d/dphys-swapfile start  

Note:It is possible to burn out the Raspberry Pi microSD card because flash memory has a limited number of writes until the card won’t work. It is highly recommended that you change this setting back to the default when you are done compiling and testing the install (see below). To read more about swap sizes corrupting memory, see this page. Finally, we are now ready to compile OpenCV:

COMMAND-

$ make -j4 

The -j4 switch stands for the number of cores to use when compiling OpenCV. Since we are using a Raspberry Pi 2, we’ll leverage all four cores of the processor for a faster compilation.

However, if your make command errors out, I would suggest starting the compilation over again and only using one core

$ make clean$ make  

Once OpenCV 3 has finished compiling.Our OpenCV 3 compile on Raspbian Stretch has completed successfully.

From there, all you need to do is install OpenCV 3 on your Raspberry Pi 3:

COMMAND-

$ sudo make install$ sudo ldconfig  

Step #6 :Finish installing OpenCV on your Pi

We’re almost done — just a few more steps to go and you’ll be ready to use your Raspberry Pi 3 with OpenCV 3 on Raspbian Stretch.

For Python 2.7:

#5 Provided your Step without error, OpenCV should now be installed in/usr/local/lib/python2.7/site-pacakges . You can verify this using the ls command:

COMMAND-

$ ls -l /usr/local/lib/python2.7/site-packages/ total 1852 -rw-r--r-- 1 root staff 1895772 Mar 20 20:00 cv2.so  

Note:In some cases, OpenCV can be installed in /usr/local/lib/python2.7/dist-packages(note the dist-packages rather than site-packages ). If you do not find the cv2.so bindings insite-packages , we be sure to check dist-packages . Our final step is to sym-link the OpenCV bindings into our cv virtual environment for Python 2.7:

COMMAND-

$ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/ $ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so  

For Python 3:After running make install , your OpenCV + Python bindings should be installed in/usr/local/lib/python3.5/site-packages . Again, you can verify this with the ls command:

COMMAND-

$ ls -l /usr/local/lib/python3.5/site-packages/ total 1852 -rw-r--r-- 1 root staff 1895932 Mar 20 21:51 cv2.cpython-34m.so  

I honestly don’t know why, perhaps it’s a bug in the CMake script, but when compiling OpenCV 3 bindings for Python 3+, the output .so file is named cv2.cpython-35m-arm-linux-gnueabihf.so(or some variant of) rather than simply cv2.so (like in the Python 2.7 bindings). Again, I’m not sure exactly why this happens, but it’s an easy fix. All we need to do is rename the file:

COMMAND-

$ cd /usr/local/lib/python3.5/site-packages/ $ sudo mv cv2.cpython-35m-arm-linux-gnueabihf.so cv2.so  

After renaming to cv2.so , we can sym-link our OpenCV bindings into the cv virtual environment

for Python 3.5:

COMMAND-

$ cd ~/.virtualenvs/cv/lib/python3.5/site-packages/ $ ln -s /usr/local/lib/python3.5/site-packages/cv2.so cv2.so  

Step #7:Testing your OpenCV 3 install

Congratulations, you now have OpenCV 3 installed on your Raspberry Pi 3 running Raspbian Stretch! But before we pop the champagne and get drunk on our victory, let’s first verify that your OpenCV installation is working properly.

Open up a new terminal, execute the source and workon commands, and then finally attempt to import the Python + OpenCV bindings:

COMMAND-

$ source ~/.profile$ workon cv $ python>>> import cv2>>> cv2.__version__ '3.3.0'>>>  

OpenCV 3 has been successfully installed on my Raspberry Pi 3 + Python 3.5 environment . Once OpenCV has been installed, you can remove both the opencv-3.3.0 and opencv_contrib-3.3.0 directories to free up a bunch of space on your disk:

COMMAND-

$ rm -rf opencv-3.3.0 opencv_contrib-3.3.0  

However, be cautious with this command! Make sure OpenCV has been properly installed on your system before blowing away these directories. A mistake here could cost you hours in compile time.

Open your /etc/dphys-swapfile and then edit the CONF_SWAPSIZE variable COMMAND-

# set size to absolute value, leaving empty (default) then uses computed value# you most likely don't want this, unless you have an special disk situation CONF_SWAPSIZE=100 #CONF_SWAPSIZE=1024 

Notice that I’ve commented out the 1024MB line and uncommented the 100MB line. As stated above, larger swap spaces may lead to memory corruption, so I recommend setting it back to 100MB. If you skip this step, your memory card won’t last as long. To revert to the smaller swap space, restart the swap service

COMMAND-

$ sudo /etc/init.d/dphys-swapfile stop
$ sudo /etc/init.d/dphys-swapfile start
  • STEP 4:Setting Up Python Program

You can verify that the camera works by running.

COMMAND-

$ raspistill -o image.jpg 

which will save a image from the camera in your current directory.

After you checked the camera is working. Now download all the python files and models from below link :

LINK:

https://drive.google.com/file/d/0B98uoD6BbkpqZU9FT...

You can open up the file inspector and view the image.

Make sure you are using the virtual environment by typing the following commands:

COMMANDS-

$ source ~/.profile $ workon cv  

Next, navigate to the repository directory,

COMMANDS-

$ cd Smart-Security-Camera  

and install the dependencies for the project

COMMANDS-

$ pip install -r requirements.txt  

To get emails when objects are detected, you'll need to make a couple modifications to the mail.py file. Open mail.py with vim vim mail.py , then press i to edit. Scroll down to the following section

# Email you want to send the update from (only works with gmail)fromEmail ='[email protected]' fromEmailPassword ='password1234' # Email you want to send the update to toEmail ='[email protected]'  

and replace with your own email/credentials.

The mail.py file logs into a gmail SMTP server and sends an email with an image of the object detected by the security camera. Press esc then ZZ to save and exit.

You can also modify the main.py file to change some other properties.

email_update_interval =600 # sends an email only once in this time intervalvideo_camera =VideoCamera(flip=True) # creates a camera object, flip verticallyobject_classifier =cv2.CascadeClassifier("models/fullbody_recognition_model.xml") # an opencv classifier facial_recognition_model.xml fullbody_recognition_model.xml upperbody_recognition_model.xml 

Run the program python main.py

You can view a live stream by visiting the IP address of your pi in a browser on the same network. You can find the IP address of your Raspberry Pi by typing ifconfig in the terminal and looking for the inet address. Visit :5000 in your browser to view the stream.

Note:

To view the live stream on a different network than your Raspberry Pi, you can use ngrok to expose a local tunnel. Once downloaded, run ngrok with ./ngrok http 5000 and visit one of the generated links in your browser. Note:The video stream will not start automatically on startup. To start the video stream automatically, you will need to run the program from your /etc/rc.local file see this video for more information about how to configure that. Receiving Emails When receiving an email for the first time, you might get the following notification from Google:

By default, Google blocks apps from using SMTP without permissions. We can solve this by clicking on the allow "less secure apps" link and toggle the feature on. The next object detected will send an email.

STEP 4:Blynk App Interface Setup

This is one of the easiest and fun steps. So let's get started. Shall we?

  • Downloading the Blynk App is the first obvious step. Download it from App Store or Google Play Store. Sign Up or Login in the app to get started.
  • Click on New Project to create a new project. Name it whatever you like. In devices Choose NodeMCU. In connection type choose WiFi and click on Create.
  • Now you will get a Auth key on your Email. Make sure to copy that and add that to your code.
  • Now click on the + sign to add widgets. You may need to buy some energy!
  • Now add three Gauge's. Click on of the Gauge's, name it Temperature. Choose a color of you choice for this gauge. In the pin choose Virtual Pin V6. Set the range from 0 to 50 °C ( not sure for °F), make the label °C/ °F and keep the reading rate to Push.
  • Repeat this for other two Gauges using data as shown in the pictures.
  • Now, add a zeRGBa and set R to digital Pin GP15, B to GP3 and B to GP1.
  • Now add 4 Buttons, change there colors accordingly. Set them as shown in the pictures.
  • Add a SuperChart, add 3 data streams Temperature, Humidity and gas, set there colors, there pins, Range and Suffix.
  • Now, add tabs. Go to the second tab and add Twitter, Notifications, Email and Eventor. In Twitter add you twitter username and password. In Notifications, Switch on Notify when hardware goes off. In Email, set your Email address. In Eventor you can set many triggers, see the picture for the triggers that I have set up.
  • You are done. now click on the play button to use the interface that you have created. You can change the interface as you like. It is really simple and fun process!

STEP 5:Making Octopod Structure

Warning - This is going to be one of most time-consuming process!

NOTE:You can skip this step and 3D print the enclosure that I have provided!

Actually, this step is optional yet the most important step! You can just take a shoe box and avoid all of this hard work. But on the contrary, this hard work makes the project unique. The idea for this unique design striked me while, I was doing my math homework. This shape is inspired from an octagon. Rather, This is a 3D octagon! So let's get started!

Making the Structure:

  • Take your cardboard and draw a rectangle of 9 cm x 9.5 cm (You can change the dimensions as per your convince). Now, joining end to end draw 4 of theses similar rectangles (8 if your cardboard is long enough).
  • Now make partial cuts (somewhat like paper creases) in between these rectangles and cut out this whole long piece. Repeat this process until you have 4 of these long pieces.
  • Now, using a D draw a 135° and cut it out as shown in the images. Make 16 of these same angles.
  • Using Glue gun glue these angles in between the small pieces. Repeat this for all the joints.
  • Now using glue gun join 2 of these open structures to make a closed structure (somewhat octagon) .
  • Now glue the other two open structure perpendicularly, making a 3-D shape.
  • Now Cut 4 More pieces of of 9 x 9.5 cm and glue them in between all the empty spaces.
  • Now you will be left with only 8 open triangles. Using Acrylic Butter paper cut 8 triangles, which will fit on these open areas, but don't glue them now.

Paint Job:

For this you need to head out towards an open area! Wear your Mask and Gloves and just make one coat over the structure that you have created. You can go to Youtube, to learn proper ways to make a perfect coat. Now let this dry for 4- 5 Hours and then apply 1 more coat. I think 3 coats will be good for this.

That's it! You have arrived with a unique piece of art.

STEP 6:Making Door Lock Enclosure

Really simple. Just take a Shoe Box and apply 2- 3 even coats of spray. And maybe for design make check pattern using duck tape like we did!

STEP 7:Assembling the Octopod

I have tried to make this step as simple as possible, by making the schematic diagram. Refer the picture or the file, and make connections accordingly. I will briefly explain all the connections!

  • We have connected the nodeMCU to a large size Solderless Breadboard. We have also connected Breadboard power supply on the breadboard. NodeMCU, all the sensors, LED's and other components are powered by the power supply.
  • Following are the sensor connections:DHT11D4 / GP2 MQ2A0 / adc00 Soil Moisture SensorD2 / GP4 PIRD6 / GP1 RGB R → D8 / GP15, G → Rx / GP3, B → Tx / GP1 RelayLn1D0 / GP16, Ln2D5 / GP14 Make the following connections.
  • For powering this you can use Power Bank or a Wall Adapter, which will be connected to the breadboard Power supply.
  • Now, take your Raspberry Pi along with the Raspberry Pi Camera. Make a small hole in one of the walls of the cardboard and glue or tape your Raspberry Camera.

Now, insert all these electronics inside, through any open triangle and close the triangle by using the cut outs of acrylic butter paper that we made. It is better to leave 1 or 2 open, in case something inside needs to be fixed! Also let the prongs of the Soil Moisture Sensor sit outside.

All done! We have completed the making process of the Octopod! Now, Just switch On the power and keep your Octopod over the dining Table or maybe on the Guest's Table and enjoy! To see the live feed from the Raspberry Pi, just open a browser and put in the IP address of the Pi. Enjoy!

STEP 8:Assembling the Door Lock

After uploading the code on your Arduino just make the connections as shown in the picture or in fritzing file! It is quite simple. Then take the handy shoe box that we made make 2 holes in it for the LED's to pop out. and allow the servo to stand out. These days mechanical locks like servo's are also available in the market, though servo works just as fine. This is just an experiment, so please so please don't use this as you actual lock! Glue the Rfid to one wall of the box and also glue the small breadboard and Arduino. You can use a wall adapter or a Power bank to power this. Just power the Arduino and you will be good to go! Done!

CONCLUSION:

This was a really fun project to do!

I was really happy how it turned out. I think the lights look really well, and i think its well worth making even one of these as a side lamp. I really can't thank creators of Blynk and OpenCV libraries enough, they are both really excellent pieces of software and made this project possible! As always, if you have any questions on any part of the process please let me know and I will be happy to try help. Thanks a lot! And Please Vote for Us!

-Saksham

Arduino Blog

Full Instructable

UPDATE:

I have been working on integrating this system with Amazon Alexa, I am almost done. Will upload the code in 2-3 days!

Code

  • octopod.ino
  • octopod_door.ino
  • octopod_door_bluetooth.ino
octopod.inoArduino
This is the main code for Arduino MKR 1010 (NodeMCU in my case)
If you are using MAX32620FTHR, download libraries for it. Then change the board in board settings. Also change the pin as given bellow
ESP MAX
AO - - - - - - - - - - - - GPIO2
A1 - - - - - - - - - - - - - GPIO1

Soil Sensor MAX
analog sensor - - - GPIO3

Gas Sensor (MQ2) MAX
sensor - - - - - - - - - - - GPIO4

PIR Sensor MAX
sensor - - - - - - - - - - - -GPIO0

Relay MAX
1 - - - - - - - - - - - - - - - - - M0
2 - - - - - - - - - - - - - - - - - M1
/*************************************************************************** OCTOPOD:A SMART HOME AUTOMATION PROJECT MADE BY SAKSHAM Download latest Blynk library here:https://github.com/blynkkk/blynk-library/releases/latestDownload latest DHT Sensor library here:https://github.com/adafruit/DHT-sensor-library***************************************************************************/#include  //Include ESP8266 Wifi Library#include  //Include Blynk Library#include  //Include DHT sensor library#define BLYNK_PRINT Serial// You should get Auth Token in the Blynk App.// Go to the Project Settings (nut icon).char auth[] ="Your Blynk Auth Key";// Your WiFi credentials.// Set password to "" for open networks.char ssid[] ="Your WiFi SSID";char pass[] ="Your WiFi Password";#define DHTPIN 2 // What digital pin temperature and humidity sensor is connected to#define soilPin 4 // What digital pin soil moist ure sensor is connected to#define gasPin A0 // What analog pin gas sensor is connected to#define pirPin 12 // What digital pin soil moisture sensor is connected to int pirValue; // Place to store read PIR Valueint soilValue; // Place to store read Soil Moisture Valueint PIRpinValue; // Place to store the value sent by Blynk App Pin V0int SOILpinValue; // Place to store the value sent by Blynk App Pin V1// Uncomment whatever type you're using!#define DHTTYPE DHT11 // DHT 11//#define DHTTYPE DHT22 // DHT 22, AM2302, AM2321//#define DHTTYPE DHT21 // DHT 21, AM2301DHT dht(DHTPIN, DHTTYPE);BlynkTimer timer;// This function sends Arduino's up time every second to Virtual Pin (5).// In the app, Widget's reading frequency should be set to PUSH. This means// that you define how often to send data to Blynk App.BLYNK_WRITE(V0) //VO pin from Blynk app tells if Motion Detection is ON{ PIRpinValue =param.asInt(); } BLYNK_WRITE(V1) //V1 pin from Blynk app tells if Soil Moisture is ON{ SOILpinValue =param.asInt(); } void sendSensor(){ int h =dht.readHumidity(); int t =dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit if (isnan(h) || isnan(t)) { Serial.println("Failed to read from DHT sensor!"); // to check if sensor is not sending any false values return; } // You can send any value at any time. // Please don't send more that 10 values per second. Blynk.virtualWrite(V5, h); // send humidity to pin V5 Blynk.virtualWrite(V6, t); // send temperature to pin V7}void getPirValue(void){ pirValue =digitalRead(pirPin); if (pirValue) //digital pin of PIR gives high value on human detection { Serial.println("Motion detected"); Blynk.notify("Motion detected"); }}void getSoilValue(void){ soilValue =digitalRead(soilPin); if (soilValue ==HIGH) //digital pin of soil sensor give low value when humidity is less { Serial.println("Water Plants"); Blynk.notify("Water Plants"); }}void setup(){ // Debug console Serial.begin(9600); Blynk.begin(auth, ssid, pass); // You can also specify server://Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442); //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442); dht.begin(); // Begins DHT reading Blynk.tweet("OCTOPOD IS ONLINE! "); // Tweating on your Twitter Handle that you project is online pinMode(pirPin,INPUT); // Defining that Pir Pin is meant to take Input Only pinMode(soilPin,INPUT); // Defining that Soil Sensor Pin is meant to take Input Only // Setup a function to be called every second timer.setInterval(1000L, sendSensor);}void loop(){ Blynk.run(); timer.run(); if (PIRpinValue ==HIGH) //VO pin from Blynk app tells if Motion Detection is ON { getPirValue(); } if (SOILpinValue ==HIGH) //V1 pin from Blynk app tells if Soil Moisture is ON { getSoilValue(); } }
octopod_door.inoArduino
Code for Automatic Door Lock Control (NO BLUETOOTH VERSION)
/*********************************************************************************************************** OCTOPOD:A SMART HOME AUTOMATION PROJECT MADE BY SAKSHAM ARDUINO RFID DOOR LOCK CODELibrary Required - MFRC522 ************************************************************************************************************/#include #include #include  #define SS_PIN 10#define RST_PIN 9#define LED_G 5 //define green LED pin#define LED_R 4 //define red LED#define BUZZER 2 //buzzer pinMFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.Servo myServo; //define servo name void setup() { Serial.begin(9600); // Initiate a serial communication SPI.begin(); // Initiate SPI bus mfrc522.PCD_Init(); // Initiate MFRC522 myServo.attach(3); //servo pin myServo.write(0); //servo start position pinMode(LED_G, OUTPUT); pinMode(LED_R, OUTPUT); pinMode(BUZZER, OUTPUT); noTone(BUZZER); Serial.println("Put your card to the reader..."); Serial.println();}void loop() { // Look for new cards if ( ! mfrc522.PICC_IsNewCardPresent()) { return; } // Select one of the cards if ( ! mfrc522.PICC_ReadCardSerial()) { return; } //Show UID on serial monitor Serial.print("UID tag :"); String content=""; byte-letter; for (byte i =0; i  
octopod_door_bluetooth.inoArduino
Code for Automatic Door Lock Control (Bluetooth Version)
/*********************************************************************************************************** OCTOPOD:A SMART HOME AUTOMATION PROJECT MADE BY SAKSHAM ARDUINO RFID DOOR LOCK CODELibrary Required - MFRC522 ************************************************************************************************************/#include SoftwareSerial BTserial(0, 1); // RX | TX#include #include #include #define SS_PIN 10#define RST_PIN 9#define LED_G 5 //define green LED pin#define LED_R 4 //define red LED#define BUZZER 2 //buzzer pinMFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.Servo myServo; //define servo namevoid setup(){ BTserial.begin(9600); // Initiate a serial communication BTserial.println("Waiting for connections..."); SPI.begin(); // Initiate SPI bus mfrc522.PCD_Init(); // Initiate MFRC522 myServo.attach(3); //servo pin myServo.write(0); //servo start position pinMode(LED_G, OUTPUT); pinMode(LED_R, OUTPUT); pinMode(BUZZER, OUTPUT); noTone(BUZZER); BTserial.println("Put your card to the reader..."); BTserial.println();}void loop(){ // Look for new cards if ( ! mfrc522.PICC_IsNewCardPresent()) { return; } // Select one of the cards if ( ! mfrc522.PICC_ReadCardSerial()) { return; } //Show UID on serial monitor BTserial.print("UID tag :"); String content =""; byte-letter; for (byte i =0; i   

Aangepaste onderdelen en behuizingen

This is the basic design that you can use if you want to make the enclosure out of Cardboard/ Wood like me! octopod_v2_ukTmIJ0uMl.f3dProper Enclosure that you can 3D Print! octo_2_v3_sii4tuCF7d.f3d

Schema's

Pin configuration might be different with Arduino MKR 1010 Without Bluetooth
For Bluetooth connect Rx (HC-05) --> Tx (Arduino)
Tx (HC-05) --> Rx (Arduino)
and 5v to 5v
Ground to Ground ESP MAX
AO - - - - - - - - - - - - GPIO2
A1 - - - - - - - - - - - - - GPIO1

Soil Sensor MAX
analog sensor - - - GPIO3

Gas Sensor (MQ2) MAX
sensor - - - - - - - - - - - GPIO4

PIR Sensor MAX
sensor - - - - - - - - - - - -GPIO0

Relay MAX
1 - - - - - - - - - - - - - - - - - M0
2 - - - - - - - - - - - - - - - - - M1

Productieproces

  1. Toepassingen van domotica
  2. Verraderlijke malvertising prooien op smart home IoT
  3. RASPBERRY PI HOME AUTOMATION
  4. Slimme jaloezieën
  5. IOT - Smart Jar met ESP8266, Arduino en ultrasone sensor
  6. Smart Home Automation en beveiligingssysteem met 1Sheeld
  7. Tech-TicTacToe
  8. Arduino Countdown Timer
  9. RC Porsche Car (Arduino Project)
  10. Slim deurslot met WiFi-aanmeldingspagina door Arduino &ESP8266
  11. Automatisering in industrie 4.0