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

Kweek het zelf | GIY

Componenten en benodigdheden

Microchip-technologie ATmega32U4
× 1
Espressief ESP8266 ESP-12E
× 1
16 MHz kristal
× 1
Power MOSFET N-kanaal
× 4
Digilent Voltage Regulator Module
× 1
DHT11 temperatuur- en vochtigheidssensor (4 pinnen)
× 1
Maxim Integrated DS18B20 Programmeerbare resolutie 1-draads digitale thermometer
× 1
MikroE Water Detect-klik
× 1
Arduino LCD-scherm
× 1
Fotoweerstand
× 1

Benodigde gereedschappen en machines

3D-printer (algemeen)
Lasersnijder (algemeen)

Apps en online services

Autodesk Fusion 360
Arduino IDE

Over dit project

Inleiding

Ik was enorm geïnspireerd na het zien van de TED Talk over digitale landbouw, gehouden door Caleb Harper, de directeur van het Open Agriculture Initiative van MIT, met het onderwerp:This Computer Will Grow Your Food in the Future . De belangrijkste vraag die in zijn lezing aan de orde kwam en die me echt inspireerde, was:Wat als we heerlijk, voedzaam voedsel konden verbouwen, overal ter wereld binnenshuis? En hier werd het idee geboren!

Dus wat ik probeer te doen, is zoiets als een doos of broedmachine, die in staat is om de ideale klimaatomstandigheden te creëren die nodig zijn voor groei, en precies de hoeveelheid licht en voedingsstoffen levert die een plant nodig heeft. Ik wil een zonlichtemulator, irrigatiesysteem en klimaatcontroller bouwen in één elegant en modern ontwerp.

Ik ben van plan de gewenste resultaten te bereiken door de volgende technologie te implementeren:

Led-licht laten groeien - het chlorofyl in planten reageert voornamelijk op slechts twee golflengten, vertegenwoordigd door 450 nm en 650 nm. Het LED-systeem dat ik van plan ben te gebruiken, heeft een combinatie van rode en blauwe LED-lampen om de perfecte mix te bieden om zowel de vegetatieve als de bloeiende groei te helpen.

Ultrasone verstuiver (mistmaker) - Ik wil een nieuwe irrigatiemethode gebruiken, die ik onlangs voor mezelf heb ontdekt, genaamd aeroponics (FogPonics) die de planten water geeft door middel van met kunstmest doordrenkte mist.

Automatische dosering van voedingsstoffen - Dit systeem doseert automatisch de voedingsstoffen voor planten precies wanneer ze het nodig hebben.

Waterdetectiesysteem - Ik wil mijn systeem uitrusten met pH- en TDS-sensoren (Total Dissolved Solids) om een ​​evenwichtige pH-waarde in het waterreservoir te behouden die het beste bij planten past, en om te weten en te waarschuwen wanneer de voedingsstoffen moeten worden gedoseerd.

Wateruitwisselingssysteem - het systeem dient te zijn voorzien van een aansluiting voor automatische waterverversing. Ik wil dit proces eenvoudig en gecontroleerd maken met slechts één klik op de knop.

Luchtregelsysteem - Het zorgt voor een nauwkeurige controle over de temperatuur en vochtigheid in het systeem, tot op een enkele graad. De achterliggende technologie omvat het gebruik van een temperatuur-/vochtigheidssensor zoals DHT22 of DHT11 om de gegevens te ontvangen, en een ventilator met een spoel om deze dienovereenkomstig te regelen.

Mobiele app - Ik wil echt voor het eerst in mijn leven een app bouwen! Deze app moet realtime informatie bevatten over de pH-waarde, temperatuur, vochtigheid, voedingsstoffen, ppm enz. en een grafische weergave in de tijd om statistieken bij te houden en de groeivoortgang op sociale media te delen. Ik wil ook intelligente waarschuwingen implementeren die me laten weten wanneer het systeem mijn betrokkenheid nodig heeft. Ik wil ook niet alleen de gegevensweergave op mijn telefoon ontvangen, maar ook de klimaatomstandigheden in het systeem kunnen instellen!

Helaas ben ik niet de eerste die met dit soort idee kwam, maar de beste manier om op een creatief idee te komen is door de bestaande te verbeteren!

Er zijn verschillende vergelijkbare projecten op de markt, maar ondanks alle individuele voordelen hebben ze ook enkele nadelen, zoals te veel ruimte innemen of te klein zijn, te duur, slechts één gewas tegelijk verbouwen enz. Ik heb veel gedaan onderzoek en analyseerde zorgvuldig de sterke en zwakke punten van de beschikbare projecten, en gezien de reactie van de markt, wil ik een nieuw geavanceerd open source systeem bedenken, dat de nadelen zal verminderen en alleen de beste functies zal implementeren.

Heel ambitieus, niet? Maar laten we het proberen

Experimenten

Omgaan met planten kost veel tijd! Ze hebben meestal enkele weken tot enkele maanden nodig om te groeien, en daar moet ik klaar voor zijn!

Omdat ik al weet wat ik voor mijn eindproject wil bouwen, moet ik dat van tevoren regelen en niet alles op het laatste moment laten liggen. Daarom ga ik zo snel mogelijk beginnen met testen en experimenteren!

Het eerste wat ik wil weten, is het feit dat het kweken van planten met behulp van voedselrijke mist en LED-lampen laten groeien is beter dan een conventioneel systeem in bodem en natuurlijk zonlicht! In theorie zou dit precies het geval moeten zijn, maar ik geloof niets totdat ik het probeer!

Dus besloot ik mijn eigen experiment te starten, dat enige tijd zal vergen, en het bestaat uit het verdelen van de planten in verschillende groepen:

  • (bodem + zonlicht) - deze groep groeit in absoluut natuurlijke omstandigheden, geplant in aarde en op de vensterbank geplaatst.
  • (Mist + zonlicht) - deze groep wordt in een container geplaatst met een voedingsrijke mist aan de binnenkant, en ook op dezelfde vensterbank
  • (Led-lamp Bodem + Groei) - deze groep zal in de grond zijn, maar zal kunstmatig Grow LED-licht gebruiken in plaats van het zonlicht
  • (Mist + Grow LED-licht) - dit zou de HELD moeten zijn group) Omdat mijn toekomstige systeem deze twee functies, het kweek-LED-licht en de voedingsrijke mistwolk, zal implementeren, hoop ik erachter te komen dat deze combinatie de beste resultaten zal opleveren!

In de plaatselijke Duitse winkel Kaufland, in de plantenafdeling, kocht ik de zaden van gemengde kruiden. Dit worden mijn testbaby's :p

Het was de eerste keer in mijn leven dat ik iets plantte :D veroordeel me niet als ik iets verkeerd heb gedaan!)

Ik heb eerder verschillende tutorials bekeken en ik heb geleerd dat ik de zaden eerst moet ontkiemen. Ik kreeg een plastic bak, waar ik de zaden deed, en bedekte ze met een papieren handdoek. In dit stadium hebben ze bijna 100% vochtigheid nodig, daarom heb ik een spray gebruikt om de papieren handdoeken water te geven en de container met de plastic zak bedekt, zodat het water niet verdampt.

Ik liet de zaden 1,5 week staan ​​en toen ik de container opende, was ik echt verrast!

Bijna alle zaden zijn ontkiemd! Ik was zo blij als een kind)

Vervolgens moest ik de beste kleine planten selecteren, degenen met de dikste stengel, en zagen er in het algemeen groter en beter uit.

In de tutorial die ik volgde (YouTube-blogger), raadde de man aan om de kleine plantjes in elk type medium te planten, totdat ze zogenaamde "tweede bladeren" geven. Op Amazon bestelde ik kokosnootpellets . Ze zijn organisch, hebben vergelijkbare eigenschappen als aarde, en het leuke is dat wanneer de korrels worden bewaterd, ze 6 keer groter worden.

Ik heb ook een doos gekocht, die speciaal voor opplant afscheiders heeft! Ik kreeg het voor slechts 2 euro, en dit maakte de dingen een stuk overzichtelijker. Ik plaatste de kokosnootpellets in de afscheiders van de doos, gaf ze water totdat ze volledig gehydrateerd waren, plaatste de kleine plantjes in het midden en bedekte de doos met een transparant stuk plastic dat bij de dooskit werd geleverd.

Mijn kleine kas zag er zo uit:

Ik sloot de doos en liet hem een ​​week staan!

En nogmaals, toen ik het opendeed, was ik verrast! Ze zijn echt groter geworden! Ik had me nooit kunnen voorstellen dat het me lukt om wat planten te kweken, het lukt me amper om voor mezelf te zorgen :D

Na een week is het verschil merkbaar!

Als ik nu de eerste wortels zie, kan ik ze in aarde en kleiballen plaatsen en beginnen te experimenteren met mist!

Tijdens de Computer-Aided Design-week ontwierp ik de netbekers, waarin ik de planten plaatste

Ik kocht ook in een plaatselijke winkel een plastic container met de geschatte afmetingen die ik nodig heb, en schetste de gaten om te boren!

En hier is mijn samengestelde testsysteem, met de planten in de kokosnootpellets en kleiballen, evenals aarde!

Om eerlijk te zijn, de resultaten kunnen beter :D

Slechts enkele planten overleefden in mijn mistsysteem. Mijn gok is vanwege het groeimedium! De mist is niet sterk genoeg om de kleiballen nat te houden, noch de grond.

Paasvakantie!

Tijdens de paasvakantie heb ik niets gedaan, en omdat het lab gesloten was, stond ook het hele systeem uit. Dus mijn planten stierven allemaal

Met een frisse geest besloot ik een ander systeem te maken, maar deze keer met een ander groeimedium op basis van de eerdere observaties

Het groeimedium dat ik voor dit systeem heb gekozen is Rock Wool . Ik kocht het in onze plaatselijke IKEA-winkel. Ik kocht ook een paar zaden van hun afdeling

En ik plaatste de nieuwe zaden in de steenwol voor ontkieming voor een week!

Na een week checkte ik mijn doos en merkte dat de ene soort zaden succesvol was, de andere faalde! Door tijdgebrek ging ik verder met de zaadjes die ontkiemden

In de tussentijd heb ik een ander mistsysteem opgezet en zal ik proberen de werktijd te verlengen, om te zien of ik zaden kan ontkiemen met behulp van mist, ALLEEN MIST!

Ik zal blijven experimenteren met verschillende parameters en instellingen, en kijken hoe ver ik kan komen!)

Elektronica ontwerp en productie

Voordat ik begon met het ontwerpen van het definitieve bord, ging ik zitten om op een stuk papier alle functies en vereisten te tekenen die het bord moet implementeren en vervullen! Ik houd ook bij hoeveel pinnen er zullen worden gebruikt, om beter te kunnen inschatten en te beslissen welke de uiteindelijke microprocessor zal zijn

Hier is de schets van wat er op het bord zou moeten staan:

De uiteindelijke keuze op welk bord te gebruiken was tussen satshakit van Daniele Ingrassia en FABLEO door Jonathan Grinham

satshakit is een 100% Arduino IDE en bibliotheken compatibel, fabbable en open source board, en ook een verbeterde versie van Fabkit.

De belangrijkste verbeteringen en functies ten opzichte van Fabkit zijn:

  • 16Mhz in plaats van 8Mhz
  • kristal in plaats van resonator
  • kost minder (7-9 euro vs 13 euro)
  • 100% compatibel met standaard Arduino IDE (satshakit wordt herkend als Arduino UNO)
  • ADC6/7 aangesloten in plaats van ADC6/7 niet aangesloten (satshakit laser en cnc)
  • grotere ruimte voor eenvoudig solderen (satshakit laser en cnc)

Aan de andere kant heeft de FabLeo zeer vergelijkbare functies, plus de hardware USB! Omdat ik de ATmega328p al eerder gebruikte, wilde ik iets nieuws proberen en besloot ik het FabLeo-ontwerp als uitgangspunt te nemen

Mijn bijbel en #1 gids voor deze opdracht was de ATmega32u4 pinout

Om het bord te ontwerpen, is de software die ik hiervoor ga gebruiken EAGLE (Eenvoudig toepasbare grafische lay-outeditor) is een flexibel en uitbreidbaar EDA-programma voor schematische opname, PCB-lay-out, autorouter en CAM. EAGLE is populair onder hobbyisten vanwege de freeware-licentie en de uitgebreide beschikbaarheid van componentbibliotheken op het web.

Eagle heeft twee vensters die tegelijkertijd worden gebruikt om een ​​bord te ontwerpen:

  • Schema (.sch) - logische componenten
  • Boardlay-out (.brd) voor het eigenlijke bord dat we frezen

Nadat ik EAGLE heb geïnstalleerd, is het eerste dat ik wil doen Een nieuw schema maken . Een schema in de elektronica is een tekening die een circuit voorstelt. Het gebruikt symbolen om elektronische componenten uit de echte wereld weer te geven. Het meest elementaire symbool is een eenvoudige geleider (sporen), eenvoudig weergegeven als een lijn. Als draden in een diagram worden aangesloten, worden ze weergegeven met een punt op de kruising.

Om mijn componenten op de schema's te plaatsen, moet ik speciale Bibliotheken . downloaden en gebruiken . Eagle heeft veel ingebouwde bibliotheken met componenten die we kunnen gebruiken. Het fab-netwerk onderhoudt ook een bibliotheek die voortdurend wordt bijgewerkt:

fab.lbr

Om de bibliotheek te installeren, gaat u in de EAGLE-omgeving naar de bovenste werkbalk en selecteert u de Bibliotheek menu. Selecteer vervolgens gebruik en open de .lbr bestand dat ik zojuist heb gedownload.

Nu kan ik naar Component toevoegen . gaan en als ik de bibliotheek selecteer, kies ik het onderdeel dat ik wil plaatsen.

Als ik alle componenten op mijn schema's heb geplaatst, moet ik ze allemaal aansluiten op de pinnen van de microprocessor. In het linker menu van EAGLE klik ik op Net , opdracht waarmee ik groene lijnen kan tekenen en de pinnen kan verbinden. Belangrijk is om de verbinding te starten vanaf het lijntje op de pin (ik heb het gemarkeerd op de foto)

Om meerdere verbindingen te vermijden, gebruik ik Labels. . In het linkermenu van EAGLE druk ik op Label toevoegen en voeg het toe aan het einde van mijn verbindingslijn. Als ik op de klik met de rechtermuisknop . druk en kies vervolgens naam , Ik kan aan het label dezelfde naam toekennen die ik heb gebruikt voor de microprocessor-pin, en ze op deze manier verbinden!

Als ik alles goed heb gedaan, zou er een bericht moeten verschijnen met de tekst:Weet je zeker dat je je label (N$10) wilt verbinden met GND?

In dit stadium, in de scheikunde, is het belangrijkste de Logica van alle verbindingen, niet zoals het eruit ziet. Nadat ik alle componenten heb geplaatst en op een logische manier heb aangesloten, ziet het er zo uit:

Ik heb de AVRISP . toegevoegd pinheaders, en plaatste ze in de volgorde voor de connector. Deze pinnen worden gebruikt om mijn bord te programmeren.

Hier is het schema van de USB circuit samen met het kristal

Ik heb ook een Voltage Regulator . toegevoegd circuit dat het hele bord van stroom voorziet door de ingang 12V om te zetten in 5V

Een van de belangrijke kenmerken van dit bord is de MOSFET circuits, ik heb er 4 toegevoegd, 3 rechtstreeks aangesloten op de ingang (12V), en één zal worden aangesloten op een step-up spanningsregelaar. De laatste wordt gebruikt om de mist van stroom te voorzien die werkt op 24V

Nadat ik alle verbindingen dubbel heb gecontroleerd, kan ik doorgaan naar de volgende stap, namelijk de Board Layout . In het bovenste menu druk ik op Genereren/Switch to Board .

Het eerste wat ik doe is het Grid . vergroten oplossing. Ik ga naar Bekijken menu, en druk op Grid , en verander de waarden in 0.01 . Hierdoor kan ik nauwkeuriger zijn bij het tekenen van de routelijnen.

Verrassend genoeg was de routing van het meest complexe bord dat ik tot nu toe heb gemaakt ook het snelst!) Ik ben trots op mezelf. De ervaring met het maken van boards had een goede invloed op het verbeteren van de snelheid. Nadat ik klaar was met routeren, ziet het kleine beest er zo uit:

Voor dit bord gebruik ik ook de truc die ik eerder heb geleerd. Ik teken een polygoon rond mijn componenten en door op de klik met de rechtermuisknop . te drukken op de polygoonlijn verander ik de naam in GND. Dit zal het hele gebied binnen de polygoon vullen en het de GND maken.

Dit bespaart veel tijd, ruimte en moeite

Als ik alles dubbel controleer, kan ik Exporteren mijn bestand als een .png afbeelding.

In het venster dat verschijnt, verhoog ik de resolutie naar 1500 dpi , klik op monochroom en selecteer venster modus.

Om de.png-afbeelding te bewerken, gebruik ik Ik open mijn afbeelding in GIMP , en met behulp van de rechthoekige selectietool , Ik selecteer de afbeelding en laat aan alle kanten wat ruimte vrij. Nadat ik op Bestand . heb gedrukt en Kopiëren het geselecteerde gebied. Om verder te werken met de geselecteerde afbeelding, klik ik opnieuw op Bestand , en Maken vanaf het klembord

Dit krijg ik na alle bewerkingen:

Deze afbeelding is klaar om te worden afgedrukt en ik noem het Inside_Cut

Ik bereid het proces voor op de Outside Cut , en dit is wat ik krijg:

Omdat mijn bord dubbelzijdig is, moet ik twee stukken frezen en deze vervolgens aan elkaar lijmen. Het enige om in gedachten te houden is dat het onderste deel horizontaal gespiegeld . moet zijn

Onderste deel Inside_Cut

Onderste deel Outside_Cut

Nu kan ik overgaan tot de CNC-freesmachine. Dus nogmaals, ik gebruikte FabModules om de.PNG-bestanden te converteren naar Gcodes voor de Roland-machine.

Laten we aan de slag gaan met de Fab-modules. Wanneer ik het ip-adres in het browservenster invoer, is de eerste interface die verschijnt:

Nadat ik op de grijze knop heb gedrukt invoerformaat , zou er een nieuw menu moeten verschijnen met de optie om de .PNG-afbeelding te laden. Hier upload ik de eerste afbeelding, de binnengravure. Daarna verschijnt het voorbeeld van de afbeelding in de Fab-modules en ook andere velden en andere parameters verschijnen

Aan de rechterkant van het venster hebben we veel invoerparameters. Om de machine te kunnen verplaatsen, moeten we de volgende parameters invoeren:

mod_lp.py /dev/usb/lp0 in de verzendopdracht veld

hostname_of_your_machine naar de server veld (alleen het adres zonder http of /)

Om de machine te verplaatsen, voer ik in de respectievelijke velden de x-, y- en z-positiecoördinaten in. Voordat ik de machine ga verplaatsen, moet ik ervoor zorgen dat de zjog parameter is altijd ingesteld op 0, zelfs als deze automatisch verandert. Om de machine te verplaatsen, moet ik op de move to xyz0 . drukken knop.

* Een kleine lifehack is om de multimeter te gebruiken en te controleren of er een verbinding is tussen het gereedschap en het oppervlak. Als hulpmiddel voor het graveren van PCB's wordt aangeraden een diameter te gebruiken vanaf 0,2 mm en lager, terwijl we voor het snijden een 1 mm . kunnen gebruiken hulpmiddel.

Dus mijn uiteindelijke instellingen zien er als volgt uit:

Voor de buitensnede blijven de instellingen hetzelfde met uitzondering van de waarde van de Z-as, aangezien ik het 0,2 mm-gereedschap heb vervangen door het 1 mm-gereedschap. Zo ziet het eruit:

Herhaal hetzelfde proces voor het Onderste gedeelte en frees de binnenkant en de buitenkant:

Dit is het eindresultaat voor de Top deel:

En de Onderkant deel:

And now Let's solder this!

In order to make sure that I soldered everything in a right way, after each component soldered, I used the multimeter to check if there is conductivity between the component and the traces.

Short animation of the process:

When I plugged in the PCB board to check if everything is fine, I noticed an error. From experience, I know that the error was from a short circuit, because the computer was disconecting the Arduino all the time I connect the VCC and GND to it. So my guess was that somewhere on the board VCC and GND are connected, and using the multimeter, I confirmed that I was right.

It was late, and I got so f*ckin' mad because of that, took me one hour under the microscope to find that little mistake. Here it is:

I fixed it by scratching with a knife, and increasing the isolation!

Another thing is placing the Step Up Voltage Reguator on the back side of my board.

I measured the dimensions in advance, and designed predrilled holes to fix it with the pinheaders. But before soldering it on the back side, I have to calibrate it.

The idea is that when I power the board with 12V, the step up will output 24V necessary for the Ultrasonic Atomizer, which is connected to the MOSFET circuit

I used the bench power supply, with a fixed 12V, to measure the output voltage using a multimeter.

After I adjust the output to the one that I need, 24V in my case, I can solder it to the back side of my board!

Also on the back side, I placed the WiFi board which I made during the Networking and Communications week!

So, here is The BEAST :

A HERO picture for those who may think that it was easy, and everything went smooth :D

Download Files:

GIY Schematics (.sch)

GIY Layout (.brd)

Board#1 Internal Cut(.png)

Board#1 External Cut (.png)

Board#2 Internal Cut (.png)

Board#2 External Cut (.png)

Wiring &Embedded programming (I/O Devices)

To program my board I used Arduino IDE . I connect the arduino board to the USB hub, in the tools menu select the right board (Arduino Leonardo) and the port, after go to File --> examples and open the Arduino as ISP schetsen. Upload de code.

After I see done uploading, which means that the code is uploaded to the board, I disconnect the arduino from the PC. The next step is to connect my PCB board to Arduino using some wires. The connection scheme is this one:

  • SCLK:Serial Clock (output from master) ----------> Arduino Pin 13
  • MOSI:Master Output Slave Input ----------> Arduino Pin 11
  • MISO:Master Input Slave Output ----------> Arduino Pin 12
  • VCC:Positive supply voltage ----------> Arduino VCC
  • GND:Ground ----------> Arduino GND
  • RST:----------> Arduino Pin 10

I connect the arduino board to the USB hub. Under Tools select the right board, select Arduino as ISP programmer, double check the parameters, and press the Burn Bootloader button.

And I see Done Uploading! Good sign)

To test the board, I upload the basic Blink example code:

Ohh, I LOVE that BLINK :D      Now let's go to sensors!

First sensor that I want to use is DHT11 - Temperature &Humidity Sensor

These sensors are very basic and slow, but are great for hobbyists who want to do some basic data logging. The DHT sensors are made of two parts, a capacitive humidity sensor and a thermistor. There is also a very basic chip inside that does some analog to digital conversion and spits out a digital signal with the temperature and humidity. The digital signal is fairly easy to read using any microcontroller.

Some characteristics:

  • Ultra low cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 20-80% humidity readings with 5% accuracy
  • Good for 0-50°C temperature readings ±2°C accuracy
  • No more than 1 Hz sampling rate (once every second)
  • Body size 15.5mm x 12mm x 5.5mm
  • 4 pins with 0.1" spacing

The wiring is pretty easy, just VCC, GND, and any Digital Pin! In my case, I designed in advance the connection for this sensor.

To test it, I will upload a simple sketch. The sketch includes the library DHT.h

So here is the code:

 // DHT11 Temperature and Humidity Sensors Example#include "DHT.h" //include DHT library#define DHTPIN 2 //define as DHTPIN the Pin 2 used to connect the Sensor#define DHTTYPE DHT11 //define the sensor used(DHT11)DHT dht(DHTPIN, DHTTYPE); //create an instance of DHTvoid setup() { Serial.begin(9600); //initialize the Serial communication dht.begin(); //initialize the Serial communication}void loop() { float h =dht.readHumidity(); // reading Humidity float t =dht.readTemperature(); // read Temperature as Celsius (the default) Serial.print("Temperature ="); Serial.println(t, 2); //print the temperature Serial.print("Humidity =");; Serial.println(h, 2); //print the humidity delay(2000); //wait 2 seconds } 

When I open the Serial Monitor, this is what I get:

Another sensor which I want to use is DS18B20 - One Wire Digital Temperature Sensor

DS18B20 is 1-Wire digital temperature sensor from Maxim IC. Reports degrees in Celsius with 9 to 12-bit precision, from -55 to 125 (+/-0.5). Each sensor has a unique 64-Bit Serial number etched into it - allows for a huge number of sensors to be used on one data bus.

This is by far one of the most simple digital sensors to hookup. Aside from power and ground, it has a single digital signal pin that I will be connecting to digital pin which I designed in advance. It also requires a 4.7k pull-up resistor between the signal and power pin, which unfortunately I forgot to place on my PCB. That is why, I will solder it manually directly to the sensor cables.

Before I start, I have to download the libraries:OneWire.h and DallasTemperature.h

Upload the following sketch:

 // First we include the libraries#include #include #define ONE_WIRE_BUS 3 // Setup a oneWire instance to communicate with any OneWire devices, (not just Maxim/Dallas temperature ICs) OneWire oneWire(ONE_WIRE_BUS); // Pass our oneWire reference to Dallas Temperature. DallasTemperature sensors(&oneWire);void setup(void) { // start serial port Serial.begin(9600); sensoren.begin(); } void loop(void) { // call sensors.requestTemperatures() to issue a global temperature (request to all devices on the bus)sensors.requestTemperatures(); // Send the command to get temperature readings Serial.print("Temperature is:"); Serial.print(sensors.getTempCByIndex(0)); //You can have more than one DS18B20 on the same bus. 0 refers to the first IC on the wire delay(1000); }  

The funny thing is that after I successfully programmed the sensor, It stopped working while I was integrating all the sensors together! I spend quite a long time trying to figure out why it does not work, but due to the limited time, I decided to use another DS18B20 sensor which was available in our FabLab stock, and waterproof it by myself!

So I took the sensor, and used the datasheet to properly solder the cables, and isolate them from each other using shrink tubes

I guess you have got the idea how I am going to waterproof it, right? :D Mama ama engineer!

Said &DONE!

Yeah, I know what it looks like :D but I assure you, its just a hand waterproof sensor. The most important is that it works, and does not leak when submerged in water!

And we go to the next sensor which is LDR =Light Dependent Resistor

LDR is a passive electronic component, basically a resistor which has a resistance that varies depending of the light intensity. The resistance is very high in darkness, almost high as 1MΩ but when there is light that falls on the LDR, the resistance is falling down to a few KΩ (10-20kΩ @ 10 lux, 2-4kOmega; @ 100 lux) depending on the model.

The LDR gives out an analog voltage when connected to Vcc (5V), which varies in magnitude in direct proportion to the input light intensity on it. That is, the greater the intensity of light, the greater the corresponding voltage from the LDR will be. Since the LDR gives out an analog voltage, it is connected to the analog input pin on the Arduino. The Arduino, with its built-in ADC (Analog to Digital Converter), then converts the analog voltage (from 0-5V) into a digital value in the range of (0-1023). When there is sufficient light in its environment or on its surface, the converted digital values read from the LDR through the Arduino will be in the range of 800-1023.

Here is the sketch code to test the sensor:

 int sensorPin =A0; /* select the input pin for LDR */int sensorValue =0; /* variable to store the value coming from the sensor */void setup(void) { Serial.begin(9600); /* start serial port */} void loop(void) { sensorValue =analogRead(sensorPin); // read the value from the sensor // We'll have a few threshholds, qualitatively determined Serial.print("LDR Value ="); Serial.print(sensorValue); if (sensorValue <100) { Serial.println(" (Dark)"); } else if (sensorValue <200) { Serial.println(" (Dim)"); } else if (sensorValue <500) { Serial.println(" (Light)"); } else if (sensorValue <800) { Serial.println(" (Bright)"); } else { Serial.println(" (Very bright)"); } delay(3000);}  

Next is Water Level Sensor

I want to have a water level sensor in order to receive an alarm when the water container is empty, and its time to add some water. Because I did not think about it in advance, and we did not have any water level sensor in our stock, I decided that I can make my own water sensor!

I decided to use the materials available, in my case the Soil Moisture Sensor . The basic principle of the water level sensor is to measure electric conductivity, which is the same for the soil moisture sensor. I thought that If I can calibrate the sensor in a way that will fulfil my requirements, I can use the moisture sensor like an water level sensor) In principle, this is an analog sensor and the data that we will read will be values from 0 to 1024, and the rest is just math!

But as it often happens, the reality is slightly different. When the sensor is not in touch with the water, the analog value is 0, and when I submerge only the tip, the value goes to 800. I used the following sketch to read the values:

 /* Print values from analog pin A4 to serial monitor */void setup(){ Serial.begin(9600); }void loop(){ Serial.println(analogRead(A4)); delay(100);}  

After I can read the values, I calibrated the sensor to give out three different responses:EMPTY! - when the value is 0, LOW when the values are around 800, and Full when the values are more than 900!

Graphic LCD Display

Because usually the LCD displays use a lot of pins, I had to find a way to connect the 128×64 screen in another way, and I DID!!! This way alows using only 3 Digital Pins on the board which is awesome because I may need the rest of the pins for other stuff, and it does not create a mess of wires. I premade the pins for the LCD on my PCB, and this is how I connected everything:

After I connect the LCD, It's time to programm it!

First of all, I have to download the U8glib library from HERE. Another important thing is the declared pins used in the code. The one I used are the following: U8GLIB_ST7920_128X64 u8g(4, 12, 6, U8G_PIN_NONE)

Using the "HELLO WORLD" library example, I came up with this test code:

 #include "U8glib.h"U8GLIB_ST7920_128X64 u8g(4, 12, 6, U8G_PIN_NONE);void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.setFont(u8g_font_unifont); u8g.setPrintPos(0, 20); // call procedure from base class, http://arduino.cc/en/Serial/Print u8g.print("GIY Project v1.0!");}void setup(void) { // flip screen, if required // u8g.setRot180();}void loop(void) { // picture loop u8g.firstPage(); doe { tekenen(); } while( u8g.nextPage() ); // rebuild the picture after some delay delay(500);} 

And this is what I get:

One cool idea that came to my mind was to display the FabLab logo for some seconds, all the time when the display is powered. I spent quite a lot of time on doing this, but I finally did it! In order to display it on the Graphic LCD, I had to have a (.bmp) format picture, and display it as a bitmap.

First thing which I did was download the FabLab logo from the internet as a (.png) file, and reduce it significantly in size, so it fits my small LCD borders. I used the following online service to do that:LINK

These are the configurations I used:

The next step is to convert my small picture into (.bmp) format. I used the following online service to do that:LINK

Now, after I have my (.bmp) file, in order to place it into my code, I have to convert it into HEX array. I used a nice tool called LCD Assistant . To load up an image in LCD Assistant, go to File> Load Image. A preview of the image should open up, make sure it’s the right size – 128 pixels wide, 64 pixels tall . Also make sure the Byte orientation is set to Horizontal and the Size endianness is set to Little . These are the configurations for my LCD Display:

Then I go to File> Save output to generate a temporary text file. Open that text file to have a look at my shiny new array.

pH Sensor

I should admit that this is the most tricky sensor from all that I played with! It is really hard to find any info about the sensor which I am using (logo ph sensor v1.1) , so I decided to make a detailed description about it!

The probe is like a (tiny) battery when placed in a liquid. Depending the pH it output a positive or negative voltage of a couple of millivolts. This value is too small and other tech stuff like impedance make it unusable directly with an Arduino, that's why you need an "op amp". The op amp board just convert the millivolts of the probe into to something acceptable for Arduino (positive between 0 and 5v).

There are 3 common buffer solutions used for pH measurement:pH 4.01, pH 6.86 and pH 9.18 (7.0 and 10.0 exists). I suggest the powder instead the liquid because it's cheaper, expire after longer and the powder can't be contaminated (vs bottle). You should read the product instructions but usually you have to put the content of the bag into 250ml of water and stir. You can use any water with an average pH (6-8) because the powder will saturate the water at the correct pH level. I personally use tap water (pH 7.4) and didn't see any difference between distilled, and demineralized water. Buffers are not stable in the time, this means that you cannot keep the solution for weeks or months.

Now let's talk more about the sensor that I am using!

  • Pin To:Should be the temperature but I can't make it work
  • Pin Po:Analog input signal
  • Pin To:Should be the temperature but I can't make it work
  • Pin Do:High/Low 3.3v adjustable limit.
  • Pin G/GND:Probe ground. It is useful when the ground is not the same as your Arduino. In some circumstances the ground voltage of the liquid to measure can be different.
  • Pin G/GND:Power ground (direct from the board).
  • Pin V+/VCC:Input power 5V DC (direct from the board).
  • Blue potentiometer (close to BNC):pH offset.
  • Blue potentiometer (close to pins):limit adjustment.

Now let's try to calibrate the sensor! There are 2 different parameters, the "offset" value and the "step" value

The offset is the shifting of all pH values to a specific voltage range. If a pH 7 output a voltage of 2.2v and pH 8 a voltage of 2.1v, then a shift of +0.3v move the pH 7 to 2.5v and the pH 8 to 2.4v. This can be done on the board or via software but it's probably easier on the board because it's probe independent and there are less programming to do.

Connect GND (both) and Vcc to Arduino GND and 5v. Remove the probe and do a short circuit between the the small BNC hole and the external part of BNC. Put a voltmeter (or Arduino) to measure the voltage between GND and Po. Adjust the pot (close BNC) until the output is 2.5v. Now the pH 7 have an exact value of 2.5v (511 with analogRead function) because the probe will output 0 millivolt.

To calibrate the steps I need one or more buffer solutions depending on the range and precision required. Ideally it is better to know the range of the measure with the system. I use water between pH 5 and pH 7, then I choose the buffer 4.01 (and 6.86 to verify my stuff). If you usually measure pH between 8 and 10 choose buffer 9.18 (eventually 6.86 also).

I connect the (clean) probe and put it in the buffer, then let it stabilize for a minute. I know it's stable when it goes up and down (3.04 then 3.05 then 3.03 then 3.04).Take note of the voltmeter (or Arduino) value, in my example it's 3.05v.

That's all, now I can use it with the code below.

 int ph_pin =A7; //This is the pin number connected to Povoid setup() {  Serial.begin(9600);}void loop() {  int measure =analogRead(ph_pin); Serial.print("Measure:"); Serial.print(measure); double voltage =5 / 1024.0 * measure; //classic digital to voltage conversion  Serial.print("\tVoltage:"); Serial.print(voltage, 3); // PH_step =(voltage@PH7 - voltage@PH4) / (PH7 - PH4)  // PH_probe =PH7 - ((voltage@PH7 - voltage@probe) / PH_step)  float Po =7 + ((2.5 - voltage) / 0.18); Serial.print("\tPH:"); Serial.print(Po, 3); Serieel.println(""); vertraging(2000);}  

The PH_step calculation is quite simple. I take the difference between the two known voltage, in my example 2.5v@pH7 and [email protected] which is -0.55v. It's the voltage range equivalent of the pH range from 7 to 4.01, which is 2.99 pH units. A small division of the voltage by pH units gives a volts per pH number (0, 1839... in my case).

The PH_probe is calculated by taking the known pH 7 voltage (2.5v) where we add some PH_step to match the probe voltage. This means that a pH of 8 has a voltage value of 2.5v (pH 7) + 0.1839 (1 unit/step); pH 9 then is 2.5v + 0.1839 + 0.1839 =2.87v.

No magic, JUST MATH :D

MOSFET output:

I connected the RGB LED stripe and the Ultrasonic Atomizer to the MOSFET circuit outputs, which are controlled by digital pins. For the LED lights, I stated in the setup digitalWrite (LED, HIGH); , which means that the LED will switch on all the time when the system is powered. For the Fog maker, I made an If function depending on the water level value. If there is water, the fog maker is ON, if there is no water, EMPTY!, then the fog is OFF!

Now Let's put things together!

Here I came up with my final code:

 #include "dht.h"#include "U8glib.h"#include #include #define DHT11_PIN 2 // what digital pin we're connected to#define ONE_WIRE_BUS 3#define WATER_LEVEL A4#define LDR_PIN A3#define PH_PIN A5#define GROW_LIGHT 10#define FOG_PUMP 13int waterLevel;int LightLevel;int pH;dht DHT;OneWire oneWire(ONE_WIRE_BUS); DallasTemperature waterTemp(&oneWire);U8GLIB_ST7920_128X64 u8g(4, 12, 6, U8G_PIN_NONE);const unsigned char logo [] PROGMEM ={0xFF, 0xFF, 0xFF, 0xFE, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFE, 0x00, 0x03, 0xC0, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF8, 0x00, 0x07, 0xE0, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF0, 0x00, 0x1F, 0xF8, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xE0, 0x00, 0x3F, 0xFE, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xC0, 0x00, 0 x18, 0x1F, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x80, 0x00, 0x00, 0x03, 0xC0, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFE, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x03, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF8, 0x07, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x1F, 0xF0, 0x00, 0x00, 0x1F, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0x3F, 0xF0, 0x00, 0x00, 0x1F, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFF, 0xF0, 0x00, 0x00, 0x3F, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x0 0, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFF, 0xF0, 0x00, 0x00, 0x3F, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xFF, 0xF8, 0x00, 0x00, 0x7F, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xFF, 0xFC, 0x00, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xFF, 0xFF, 0x00, 0x01, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xC0, 0x07, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFE, 0x1F, 0xFF, 0xFF, 0xF0, 0x3C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xF8, 0x03, 0xFF, 0xFF, 0xC0, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xF0, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0xF0, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0xE0, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x1F, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x0F, 0xF0, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x07, 0xF0, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xF0, 0x00, 0x07, 0xF0, 0x00, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x 00, 0x00, 0x00, 0x00,0xC0, 0xF0, 0x00, 0x07, 0xF0, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xF8, 0x00, 0x07, 0xF0, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xF8, 0x00, 0x07, 0xF0, 0x00, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFC, 0x00, 0x07, 0xF0, 0x00, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFE, 0x00, 0x0F, 0xF0, 0x00, 0x3F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0x3E, 0x00, 0x0F, 0xF0, 0x00, 0x7C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0x1E, 0x00, 0x1F, 0xF8, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF8, 0x06, 0x00, 0x1F, 0xFC, 0x01, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x00, 0x00, 0x7F, 0xFF, 0x0F, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFE, 0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x00, 0x00, 0x7F, 0xFF, 0xF0, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x80, 0x00, 0x7F, 0xFF, 0xC0, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xC0, 0x00, 0x7F, 0xFF, 0x80, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xE0, 0x00, 0x7F, 0xFE, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF0, 0x00, 0x1F, 0xF8, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF8, 0x00, 0x0F, 0xF0, 0x00, 0x1F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFC, 0x00, 0x03, 0xC0, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0 x00, 0x00, 0x00,0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xFF, 0xFD, 0x3F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};bool first;float hum =0.0;double T=0.0;void dht_test(float * humPerc);void setup(void) { waterTemp.begin(); pinMode (GROW_LIGHT, OUTPUT); pinMode (FOG_PUMP, OUTPUT); digitalWrite (GROW_LIGHT, HIGH); first =true; // assign default color value if ( u8g.getMode() ==U8G_MODE_R3G3B2 ) { u8g.setColorIndex(255); // white } else if ( u8g.getMode() ==U8G_MODE_GRAY2BIT ) { u8g.setColorIndex(3); // max intensity } else if ( u8g.getMode() ==U8G_MODE_BW ) { u8g.setColorIndex(1); // pixel on } else if ( u8g.getMode() ==U8G_MODE_HICOLOR ) { u8g.setHiColorByRGB(255,255,255); } // picture loop u8g.firstPage(); do { u8g.drawBitmapP( 32, 0, 16, 64, logo); } while( u8g.nextPage() ); dht_test(&hum);}void RefreshDisplay(float * humPerc, double *T, int *WL, int *LL, int *pH_value) { u8g.setFont(u8g_font_fub11); u8g.setFontRefHeightExtendedText(); u8g.setDefaultForegroundColor(); u8g.setFontPosTop(); u8g.drawStr( 4, 0, "Hum%"); u8g.setPrintPos( 68, 0); u8g.print( *humPerc); u8g.drawStr( 4, 15, "Temp"); u8g.setPrintPos( 68, 15); u8g.print( *T); u8g.drawStr( 4, 30, "Wlvl"); if (*WL ==0){ u8g.drawStr (68, 30,"EMPTY!"); digitalWrite (FOG_PUMP, LOW); } else{ if (*WL <800) u8g.drawStr (68, 30,"LOW"); else { digitalWrite(FOG_PUMP, HIGH); u8g.drawStr (68, 30,"HIGH"); } } if (*LL <100) { u8g.drawStr (68, 45,"Dark"); } else if (*LL <200) { u8g.drawStr (68, 45,"Dim"); } else if (*LL <500) { u8g.drawStr (68, 45, "Light"); } else if (*LL <800) { u8g.drawStr (68, 45,"Bright"); } else { u8g.drawStr (68, 45,"2Bright"); } double voltage =5.0 / 1024.0 * (*pH_value); float Po =7 + ((2.5 - voltage) / 0.18); u8g.drawStr (4, 45,"pH"); u8g.setPrintPos( 28, 45); u8g.print( Po); }void loop(void) {waterTemp.requestTemperatures();T =waterTemp.getTempCByIndex(0);waterLevel =analogRead(WATER_LEVEL);LightLevel =analogRead(LDR_PIN);pH =analogRead (PH_PIN);char status;int chk =DHT.read11(DHT11_PIN);hum =DHT.humidity; dht_test(&hum); if(first) { first =false; } else { u8g.firstPage(); do { RefreshDisplay(&hum, &T,&waterLevel, &LightLevel, &pH); } while( u8g.nextPage() ); }}void dht_test(float * humPerc) { // Wait a few seconds between measurements. delay(1000);}  

Download Files:

GIY Final Code (.ino)

3D Design &3D Printing

Actually for my final system, I used a lot of 3D design and 3D printing technique. I used two different printers, and played a lot with the settings until I got the desired result!

For 3D design, I used which as I mentioned before, is my favourite CAD software! I will not go too much into details of how to create simple shapes, and extrude objects, all this could be found during my Computer-Aided Design week, where I learned how to use diferent softwares, as well as 3D Scanning and Printing week.

The main task was to design the physical appearence of my system! The challenge was that I wanted it to look SEXY!!!

The aesthetics was a very important criteria, as well as functionality! The system should also be assemblable, which makes it even more challenging. I also wanted to integrate the skills which I learned like 3D printing, CNC milling, Laser cutting etc.

Before designing it in the digital world, I made a simple sketch on paper! Here it is:

And this is the final 3D design:

My sexy ass system :D

First thing which I designed was the water container . Here it is:

It incorporates several features! First, there is enough space for plants to grow, as well as in the middle I made a hole to place the Ultrasonic Atomizer. It is done because I wanted to level the fogger with the container. The thing is that the water level should be above the fogger by 2cm, so all the water which is leveled with the fogger hight, will not be used (waste)! So if I place the fogger below the container level, I have a water zero level exactly at the point where it should be, zero for the container =2cm above the fogger. In this way, all the water is used!

I also considered the hight of the container. Actually, all the dimensions of the container are measured during the experimental stage!

As you can see, I made a hole on the wall, which will be used for the cables from sensors placed in the water to hide into the electronics section. In the front of the container, I made the slot to attach the graphic display. I also designed some handles to easily remove the container when need!

From this perspective, you can see the electronics section. Now its opened, but I also designed a lid to close it. Inside the electronics section, I designed a hole to have access to power and program the board

On the bottom side I designed sliders which will be attached to the rest of the system, and make it easier to remove the container when needed, it will also play a role of fixation of the container in place!

And now Let's Print It!

I can proudly announce that the printer which I will be using is called BigRep 3D Printer , only available in our FabLab Kamp-Lintfort. It has a capacity of one cubic meter, and provides the largest FFF build volume for professional and industrial use.

The slicing software which I use is Simplify3D , one of the most advanced slicing tools, in my opinion, with a lot of configurations and options.

I do not think that there is a right and a wrong way to print something, you just have to play with the settings until you find the best options for the specific object to print.

Because this printer is new, there are not too many testings made. So, I had to experiment with the settings, and try, try and again try...

I will show bellow the settings that I will be using for my water container print, but some of them are intuitive.

I choose the Tool1 , because the BigRep Printer has two nozzels with two different filaments, and I have to specify which nozzel I want to use, as well as the nozzle diameter and the rest of the settings.

Layer:

Additions:

Infill:

Ondersteuning:

Temperature:

Cooling:

Other:

Advanced:

These are the changes that I made, the rest of the settings I just left by default.

And then press on Prepare to Print . The software will generate the paths, and here we can check if everything is good, before sending the .gcode to the maschine.

Briefly about some of the printer's settings. I used Nozzle Temperature =205 deg.C , and the Bed Temperature =70 deg.C . After I positioned the X, Y, and Z axis , and double checked all the settings, I launched the job!

This is how the raw model looks like:

When I started removing the support and cleaning the model, I realized that this is a BIG pain in the ASS :D

As you can notice, the settings which I used are not really perfect, because the container has some big holes next to the edges. I had in my mind to waterproof it anyway, you can see how I did it in the Moulding &Casting section!

The next 3D printed part was the Net Pot . This is a cup which is designed to hold the seeds in the growing medium. More detailes about the first version of them you can see during my Computer-Aided Design week

This time I will improve the design a bit based on the observations that I made during the experimental stage. The main difference is the size of the empty space, which is increased a lot, to give an easier access for the fog to pass in, and for the roots to go through

So I just modified the old design, and added one more thing!

I made a slight fillet on the top part, to make the transition smoother. I also added a ball on the bottom, and used the Move command to move it a bit inside, and leave on the bottom around 2-3mm structure width

After I used the boolean substraction or Combine function, and I get this nice curviture at the bottom!

Now let's print it!

The 3D printer which I used is Ultimaker 2+ . To slice my 3D model, I will use, a very nice software, with an easy interface, and also functional. The material that I am using is PLA filament

After I import my .stl file, these are the settings that I am using:

Here it is my little army :D

From the final design of the system, I decided to also 3D print the bottom part. Its a big piece, and I will use the BigRap as well for this.

I wouldn't say that there is anything new about this, because I used the same settings as I used for the water container , and more or less the rest is the same

Here is the preview of the print:

Another thing which I 3D printed are the rounded corners on the top side of the system. I used the Ultimaker for this, and used the following settings:

The trick here was to achieve maximum smoothness on the surface, and I think I got a pretty good result:

Download Files:

GIY System Design (.f3d)

Net Pot Design (.f3d)

2D Design &Laser Cutting

I used the Laser cutting technique to cut acrylic parts which will cover all the inside part of the system, and give it a finished look!

I actually did not design the parts again, I just exported the already created sketches from Fusion 360 as .dxf files . After I exported the file, I used to edit the design before importing it into the lasercut machine

This is how the sketch looks in Fusion360:

Looks like a big mess, but the good part is that everything is parametric! It looks messy because I had to align everything into the right position, and keep the stuff parametric in case I have to make a change later

This is how the final sketch looks in Rhino before lasercutting:

I decided to use a green acrylic piece because it gives an organic look, and combines well with the green plants

For the front and the back cover, I decided to use white color. Its all about the taste, this is the way I see it, and this is how I like it.

The front and the back cover are very similar, have the same dimensions, except the inside cuts! The front cover has the hole for the LCD Display, here it is:

For the back cover, I want to make a hole to have access to power and program the board! This is how it looks:

Another lasercutted piece is on the top! I decided to use a transparent acrylic part, in order for the light to go through! I also designed some additional cuts, to decrease the weight, and give more space for the light to pass! I also measured the width of the RGB LED stripes, and will attach them in a way that there is enough room for the sunlight as well as artificial light!

I finished with the design, and now Let's Laser Cut!

The Laser Cutter that we are using here in FabLab is Epilog Fusion 60Watt, a CO2 lasercutter with a working area of 1016 x 711 mm. It can cut and ingrave materials like wood, cardboard, acrylic or other engineered plastics.

Because I used the same material for all the pieces, plexiglass 5mm , I used the same settings for all of them!

Download Files:

Front / Back Cover (.dxf)

Plant Holder (.dxf)

LED Light Holder (.dxf)

CNC Milling

Because I wanted to integrate in my system all the skills and techniques that I learned, I also have a piece of structure to CNC mill. I did not design it again, but I exported the .dxf file from Fusion360 sketch!

To cut my design, I will be using the big CNC monster.

A CNC (computer numerically controlled) is a machine that uses a cutting bit that rotates at a very high speed to remove material from a part.

The machine reads a pre‐programed computer file telling it where and how to cut, usually .GCode file. A cutting bit is rotated at a very high RPM by a spindle motor, which can move the bit up and down. This mechanism is moved left, right, front, and back by a cross arm. The machine is therefore known as a three‐axis router because it can move on the X, Y &Z axis. The machine can do two dimensional cutouts and etching, as well as three‐dimensional relief work.

In FabLab Kamp-Lintfort we have a CNC portal milling machine by  e(sign:Easy Worker MasterPro 2513.

It’s working area is 2600 x 1400 x 300mm and it comes with a vacuum table. We primarily use it for wood milling but with its HSD Spindel (3.9KW; 24.000U/min) it is also capable to mill metals easily.

The material which I will be using is 18mm Plywood

At first, I place the wood sheet on the CNC bed, and after I aligned it, switch on the vacuum. After I exported the .dxf file, I used to edit the design before importing it into the machine CAM software.

First, I have to HOME the machine!

To set the X, Y and Z Zero Positions, I home the machine by pressing the home button in the software (or on the remote control).

At first, I can set my zero X and Y roughly aligned to one of the corners of the bed. We also tried to use the laser for this, but all the time when simulating the process, it was showing collisions, because the zero was going out of the working area

Now I have to find the Z axis, which I do using the special tool which comes with the machine:

Important thing is to place it on the bed of the machine!

Now I can launch the first job, which is making the engraving. These are the settings which I used:

I press Calculate Toolpath to simulate the job and make sure that there are no collisions! After I save the .GCode , and launch the job, I get this window:

Now I can launch the outside cut:

This is what I get after the job is done:

Another piece which I had to mill is used for the Moulding &Casting section!

I prepared the mould to waterproof my water container. Here is the design:

There is nothing new about this. I used exactly the same settings as above. The only thing is the material thickness was 10mm wood , and I had to cut 7 pieces, to glue them together later and prepare my mould!

Download Files:

Structure Walls (.dxf)

Mould (.dxf)

Moulding &Casting

I used this technique in order to prepare a water container, to waterproof my existing container! I see it as a thin layer of material (a smaller container) which can be easily removable!

This is the result from the previous section CNC Milling

I cut 7 identical pieces, and aligned them using the reference holes! I also cut a big hole in the middle of 5 bottom pieces , in order to place the air pump inside, and easily remove the cast later.

After I glued all the pieces together, and fixed them, this is how it looks:

While waiting for the glue to dry out, I prepared a little plastic "thing" (do not know how to call it :D) for the pump. The idea is to be able to screw it on my mould, and remove it whenever I want!

When the mould is ready, this is how it looks:

And the back side:

I am ready to vacuum cast!

I used a vacuum machine available in our FabLab Kamp-Lintfort called Formech – Manual Vacuum Forming Machine

The thing is that I tried to do it many times, and all the time I could not remove the mould without breaking the cast! After several hours of trials, I came up with a solution! First, I vacuum casted one thin layer of material, and without removing it, I will cast the actual container on top of it. The first thin layer is slippery, and If I spray it with silicon, it will allow me to remove the mould way easier

After I let the silicon to dry a bit, I can cast the actual layer!

And here we are!!!

A hero shot for those who may thing that it was easy

Putting All Together

Now, let's put everything together! I will start by assembling the structure. Put next to me all the necessary tools:

A short animation of the process:

To assemble the lights, I cut the RGB LED stripes into 4 pieces (I measured the length in advance), and soldered them accordingly!

After I connected all the sensors, and managed the wiring, I fixed the board in the electronics section

And here it is the system!!! Everything assembled, nice looking growing system GIY

A HERO shot during the working process!

Final Presentation Video

© 2017 Albot Dima. All rights reserved | [email protected]

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

For more details about de project, please visit de official source:

http://archive.fabacademy.org/2017/fablabkamplintfort/students/396/final.html

Code

  • GIY Board - CODE
  • GIY BOARD - LCD + LIGHT CODE
GIY Board - CODEArduino
#include "dht.h"#include "U8glib.h"#include #include #define DHT11_PIN 2 // what digital pin we're connected to#define ONE_WIRE_BUS 3#define WATER_LEVEL A4#define LDR_PIN A3#define PH_PIN A5#define GROW_LIGHT 10#define FOG_PUMP 13int waterLevel;int LightLevel;int pH;dht DHT;OneWire oneWire(ONE_WIRE_BUS); DallasTemperature waterTemp(&oneWire);U8GLIB_ST7920_128X64 u8g(4, 12, 6, U8G_PIN_NONE);const unsigned char logo [] PROGMEM ={0xFF, 0xFF, 0xFF, 0xFE, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFE, 0x00, 0x03, 0xC0, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF8, 0x00, 0x07, 0xE0, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF0, 0x00, 0x1F, 0xF8, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xE0, 0x00, 0x3F, 0xFE, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xC0, 0x00, 0 x18, 0x1F, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x80, 0x00, 0x00, 0x03, 0xC0, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFE, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x03, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF8, 0x07, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x1F, 0xF0, 0x00, 0x00, 0x1F, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0x3F, 0xF0, 0x00, 0x00, 0x1F, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFF, 0xF0, 0x00, 0x00, 0x3F, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x0 0, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFF, 0xF0, 0x00, 0x00, 0x3F, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xFF, 0xF8, 0x00, 0x00, 0x7F, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xFF, 0xFC, 0x00, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xFF, 0xFF, 0x00, 0x01, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xC0, 0x07, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xFE, 0x1F, 0xFF, 0xFF, 0xF0, 0x3C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xF8, 0x03, 0xFF, 0xFF, 0xC0, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xF0, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0xF0, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0xE0, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x1F, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x0F, 0xF0, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x80, 0xE0, 0x00, 0x07, 0xF0, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xF0, 0x00, 0x07, 0xF0, 0x00, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x 00, 0x00, 0x00, 0x00,0xC0, 0xF0, 0x00, 0x07, 0xF0, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xF8, 0x00, 0x07, 0xF0, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xC0, 0xF8, 0x00, 0x07, 0xF0, 0x00, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFC, 0x00, 0x07, 0xF0, 0x00, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xE0, 0xFE, 0x00, 0x0F, 0xF0, 0x00, 0x3F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0x3E, 0x00, 0x0F, 0xF0, 0x00, 0x7C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF0, 0x1E, 0x00, 0x1F, 0xF8, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xF8, 0x06, 0x00, 0x1F, 0xFC, 0x01, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x00, 0x00, 0x7F, 0xFF, 0x0F, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFC, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFE, 0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x00, 0x00, 0x7F, 0xFF, 0xF0, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x80, 0x00, 0x7F, 0xFF, 0xC0, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xC0, 0x00, 0x7F, 0xFF, 0x80, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xE0, 0x00, 0x7F, 0xFE, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF0, 0x00, 0x1F, 0xF8, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xF8, 0x00, 0x0F, 0xF0, 0x00, 0x1F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFC, 0x00, 0x03, 0xC0, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0 x00, 0x00, 0x00,0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xFF, 0xFD, 0x3F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};bool first;float hum =0.0;double T=0.0;void dht_test(float * humPerc);void setup(void) { waterTemp.begin(); pinMode (GROW_LIGHT, OUTPUT); pinMode (FOG_PUMP, OUTPUT); digitalWrite (GROW_LIGHT, HIGH); first =true; // assign default color value if ( u8g.getMode() ==U8G_MODE_R3G3B2 ) { u8g.setColorIndex(255); // white } else if ( u8g.getMode() ==U8G_MODE_GRAY2BIT ) { u8g.setColorIndex(3); // max intensity } else if ( u8g.getMode() ==U8G_MODE_BW ) { u8g.setColorIndex(1); // pixel on } else if ( u8g.getMode() ==U8G_MODE_HICOLOR ) { u8g.setHiColorByRGB(255,255,255); } // picture loop u8g.firstPage(); do { u8g.drawBitmapP( 32, 0, 16, 64, logo); } while( u8g.nextPage() ); dht_test(&hum);}void RefreshDisplay(float * humPerc, double *T, int *WL, int *LL, int *pH_value) { u8g.setFont(u8g_font_fub11); u8g.setFontRefHeightExtendedText(); u8g.setDefaultForegroundColor(); u8g.setFontPosTop(); u8g.drawStr( 4, 0, "Hum%"); u8g.setPrintPos( 68, 0); u8g.print( *humPerc); u8g.drawStr( 4, 15, "Temp"); u8g.setPrintPos( 68, 15); u8g.print( *T); u8g.drawStr( 4, 30, "Wlvl"); if (*WL ==0){ u8g.drawStr (68, 30,"EMPTY!"); digitalWrite (FOG_PUMP, LOW); } else{ if (*WL <800) u8g.drawStr (68, 30,"LOW"); else { digitalWrite(FOG_PUMP, HIGH); u8g.drawStr (68, 30,"HIGH"); } } if (*LL <100) { u8g.drawStr (68, 45,"Dark"); } else if (*LL <200) { u8g.drawStr (68, 45,"Dim"); } else if (*LL <500) { u8g.drawStr (68, 45,"Light"); } else if (*LL <800) { u8g.drawStr (68, 45,"Bright"); } else { u8g.drawStr (68, 45,"2Bright"); } double voltage =5.0 / 1024.0 * (*pH_value); float Po =7 + ((2.5 - voltage) / 0.18); u8g.drawStr (4, 45,"pH"); u8g.setPrintPos( 28, 45); u8g.print( Po); }void loop(void) {waterTemp.requestTemperatures();T =waterTemp.getTempCByIndex(0);waterLevel =analogRead(WATER_LEVEL);LightLevel =analogRead(LDR_PIN);pH =analogRead (PH_PIN);char status;int chk =DHT.read11(DHT11_PIN);hum =DHT.humidity; dht_test(&hum); if(first) { first =false; } else { u8g.firstPage(); do { RefreshDisplay(&hum, &T,&waterLevel, &LightLevel, &pH); } while( u8g.nextPage() ); }}void dht_test(float * humPerc) { // Wait a few seconds between measurements. vertraging(1000);}
GIY BOARD - LCD + LIGHT CODEArduino
#include "U8glib.h"int led =10;U8GLIB_ST7920_128X64 u8g(4, 12, 6, U8G_PIN_NONE);void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.setFont(u8g_font_unifont); u8g.setPrintPos(0, 20); // call procedure from base class, http://arduino.cc/en/Serial/Print u8g.print("GIY Project v1.0!");}void setup(void) { pinMode (led, OUTPUT); digitalWrite (led, HIGH);}void loop(void) { // picture loop u8g.firstPage(); doe { tekenen(); } while( u8g.nextPage() ); // rebuild the picture after some delay delay(500);}

Schema's


Productieproces

  1. Tic Tac Toe-spelvisitekaartje
  2. Multitemperatuursensor
  3. DIY-soldeerboutbesturing voor 862D+
  4. MotionSense
  5. 3D-printer brandveiligheid
  6. IoT-meter met Arduino, Yaler en IFTTT
  7. Arduino afstotende elektromagnetische levitatie
  8. Grijperbot met afstandsbediening
  9. Arduino aangedreven weerballon datalogger
  10. ArduFarmBot - Part 2:Remote Station an IoT Implementation
  11. CoroFence - Thermische Detector🖖