diff --git a/components.json b/components.json index 8f0d535d..ba86b9f4 100644 --- a/components.json +++ b/components.json @@ -11,7 +11,10 @@ "prefix": "" }, "aliases": { - "components": "src/components", - "utils": "src/lib/utils" + "components": "@site/src/components", + "utils": "@site/src/lib/utils", + "ui": "@site/src/components/ui", + "lib": "@site/src/lib", + "hooks": "@site/src/lib/hooks" } } \ No newline at end of file diff --git a/docs/boards/mcu/mcu-overview.mdx b/docs/boards/mcu/mcu-overview.mdx index b9c00f1f..72bc5c45 100644 --- a/docs/boards/mcu/mcu-overview.mdx +++ b/docs/boards/mcu/mcu-overview.mdx @@ -175,7 +175,7 @@ export const MCUManager = () => { {
- -## Technische Information - -- "Plug-in-and-Go" senseBox kompatibel -- Relative Luftfeuchte (RH) Betriebsbereich 0% bis 100% -- 14 Bit Messauflösung -- Relative Luftfeuchte Genauigkeit ±4% -- Temperatur Genauigkeit ±0.2°C -- 2100nA Stromzufuhr -- Betriebsspannung 2.7 V bis 5.5 V -- I2C Schnittstelle - -## Anschluss - - - -## Programmierung (Arduino) - -### Software Bibliothek - -Um den Sensor in Arduino zu Programmieren musst du die Software Bibliothek [Adafruit HDC1000 Library](https://www.arduino.cc/reference/en/libraries/adafruit-hdc1000-library/) installieren. - -### Code - -Dieser Code gibt die Temperatur und die relative Luftfeuchte im Seriellen Monitor aus. - -```cpp -#include // http://librarymanager/All#Adafruit_HDC1000_Library - -Adafruit_HDC1000 hdc = Adafruit_HDC1000(); - -void setup(){ - Serial.begin(9600); - hdc.begin(); -} - -void loop(){ - Serial.print("Temperature: "); - Serial.println(hdc.readTemperature()); - Serial.print("Humidity: "); - Serial.println(hdc.readHumidity()); -} -``` - -## Programmierung (Blockly) - -In Blockly kann der Sensor über folgenden Block ausgelesen werden: - -![](/img/hardware-bilder/temperatur-luftfeuchte/block_temperatur_luftfeuchte.svg) - -Im Block kannst du zwischen den verschiedenen Parametern des Temperatur und Luftfeuchtigkeitsensor auswählen: - -- Temperatur in Grad Celsius (°C) -- Luftfeuchtigkeit in Prozent (%) - -{useBoardStore((state) => (state.board === 'MCU-S2' || state.board === ':edu S2') && ( -<> -

Programmierung (CircuitPython)

- -

Um den Sensor mit CircuitPython zu programmieren, muss die senseBox MCU-S2 zunächst mit CircuitPython geflasht werden. Eine Anleitung dazu findest du hier.

- -

Software Bibliothek

- -

Lade dir die HDC1080 CircuitPython Bibliothek herunter. Entpacke die .zip Datei und kopiere die hdc1080.mpy Datei aus dem lib Ordner in den lib Ordner deiner senseBox (CIRCUITPY Laufwerk).

- -

Code

- -

Mit dem CircuitPython Editor deiner Wahl kannst du nun den Sensor programmieren und seine Werte auslesen. Dieser Code gibt die Temperatur und die relative Luftfeuchte in der Konsole aus:

- -
{`import time
-import board
-import digitalio
-from hdc1080 import HDC1080
-
-# IO Enable Pin (only needed for senseBox MCU-S2)
-io_enable_pin = digitalio.DigitalInOut(board.IO_POWER)
-io_enable_pin.direction = digitalio.Direction.OUTPUT
-io_enable_pin.value = False
-
-# Initialize I2C bus
-i2c = board.I2C()
-
-# Initialize HDC1080 sensor
-sensor = HDC1080(i2c)
-
-while True:
-    temperature = sensor.temperature
-    humidity = sensor.humidity
-
-    print("Temperature: {:.2f} °C".format(temperature))
-    print("Humidity: {:.2f} %".format(humidity))
-
-    time.sleep(2)  # Wait for 2 seconds before next reading`}
- -))} - -## Projekte - -- #### [IoT Messstation](https://sensebox.de/projects/de/2024-01-10-iotmesstation_s2) - -## Extras - -> - [Shop](https://sensebox.kaufen/products/temperatur-luftfeuchtesensor) -> - [TI HDC1080 Datenblatt](https://www.ti.com/lit/ds/symlink/hdc1080.pdf) diff --git a/docs/hardware/sensors/temperatur-luftfeuchte/arduino-temperatur-luftfeuchte.ino b/docs/hardware/sensors/temperatur-luftfeuchte/arduino-temperatur-luftfeuchte.ino new file mode 100644 index 00000000..9202f04b --- /dev/null +++ b/docs/hardware/sensors/temperatur-luftfeuchte/arduino-temperatur-luftfeuchte.ino @@ -0,0 +1,15 @@ +#include // http://librarymanager/All#Adafruit_HDC1000_Library + +Adafruit_HDC1000 hdc = Adafruit_HDC1000(); + +void setup(){ + Serial.begin(9600); + hdc.begin(); +} + +void loop(){ + Serial.print("Temperature: "); + Serial.println(hdc.readTemperature()); + Serial.print("Humidity: "); + Serial.println(hdc.readHumidity()); +} \ No newline at end of file diff --git a/docs/hardware/sensors/temperatur-luftfeuchte/circuitpy-temperatur-luftfeuchte.py b/docs/hardware/sensors/temperatur-luftfeuchte/circuitpy-temperatur-luftfeuchte.py new file mode 100644 index 00000000..047af602 --- /dev/null +++ b/docs/hardware/sensors/temperatur-luftfeuchte/circuitpy-temperatur-luftfeuchte.py @@ -0,0 +1,23 @@ +import board +import digitalio +from hdc1080 import HDC1080 + +# IO Enable Pin (only needed for senseBox MCU-S2) +io_enable_pin = digitalio.DigitalInOut(board.IO_POWER) +io_enable_pin.direction = digitalio.Direction.OUTPUT +io_enable_pin.value = False + +# Initialize I2C bus +i2c = board.I2C() + +# Initialize HDC1080 sensor +sensor = HDC1080(i2c) + +while True: + temperature = sensor.temperature + humidity = sensor.humidity + + print("Temperature: {:.2f} °C".format(temperature)) + print("Humidity: {:.2f} %".format(humidity)) + + time.sleep(2) # Wait for 2 seconds before next reading \ No newline at end of file diff --git a/docs/hardware/sensors/temperatur-luftfeuchte/temperatur-luftfeuchte.mdx b/docs/hardware/sensors/temperatur-luftfeuchte/temperatur-luftfeuchte.mdx new file mode 100644 index 00000000..ebca25c1 --- /dev/null +++ b/docs/hardware/sensors/temperatur-luftfeuchte/temperatur-luftfeuchte.mdx @@ -0,0 +1,82 @@ +--- +sidebar_position: 9 +title: Temperatur- und Luftfeuchtigkeitssensor +hide_title: false +description: Temperatur- und Luftfeuchtigkeitssensor (HDC1080) +--- + +import ImageWithText from '@site/src/components/ImageWithText/ImageWithText' +import tempSensor from '@site/static/img/hardware-bilder/temperatur-luftfeuchte/sensor_temperatur_luftfeuchte.png' +import TutorialPorts from '@site/src/components/TutorialPorts/TutorialPorts' +import { useBoardStore } from '@site/src/lib/stores/store' +import { ProgrammingTabs } from '@site/src/components/ProgrammingTabs/ProgrammingTabs' + +# Temperatur- und Luftfeuchtesensor + +Der HDC1080 ist ein digitaler Feuchtigkeits- und Temperatursensor. Der Sensor hat eine hohe Genauigkeit und eine sehr geringe Stromaufnahme und passt dadurch ideal zur senseBox. Die Sensoren sind ab Werk kalibirert und können direkt eingesetzt werden. + + + +## Technische Information + +- "Plug-in-and-Go" senseBox kompatibel +- Relative Luftfeuchte (RH) Betriebsbereich 0% bis 100% +- 14 Bit Messauflösung +- Relative Luftfeuchte Genauigkeit ±4% +- Temperatur Genauigkeit ±0.2°C +- 2100nA Stromzufuhr +- Betriebsspannung 2.7 V bis 5.5 V +- I2C Schnittstelle + +## Anschluss + + + +## Programmierung + + +

Software Bibliothek

+

Installiere die Adafruit HDC1000 Library.

+ + ), + circuitpython: ( + <> +

Um den Sensor mit CircuitPython zu programmieren, muss die senseBox MCU-S2 zunächst mit CircuitPython geflasht werden. Eine Anleitung dazu findest du hier.

+

Software Bibliothek

+

Lade dir die HDC1080 CircuitPython Bibliothek herunter. Entpacke die .zip Datei und kopiere die hdc1080.mpy Datei aus dem lib Ordner in den lib Ordner deiner senseBox (CIRCUITPY Laufwerk).

+

Code

+

Mit dem CircuitPython Editor deiner Wahl kannst du nun den Sensor programmieren und seine Werte auslesen. Dieser Code gibt die Temperatur und die relative Luftfeuchte in der Konsole aus:

+ + ), + }} +/> + +## Blockly + + +In Blockly kann der Sensor über folgenden Block ausgelesen werden: + +![](/img/hardware-bilder/temperatur-luftfeuchte/block_temperatur_luftfeuchte.svg) + +Im Block kannst du zwischen den verschiedenen Parametern des Temperatur und Luftfeuchtigkeitsensor auswählen: + +- Temperatur in Grad Celsius (°C) +- Luftfeuchtigkeit in Prozent (%) + + +## Projekte + +- #### [IoT Messstation](https://sensebox.de/projects/de/2024-01-10-iotmesstation_s2) + +## Extras + +> - [Shop](https://sensebox.kaufen/products/temperatur-luftfeuchtesensor) +> - [TI HDC1080 Datenblatt](https://www.ti.com/lit/ds/symlink/hdc1080.pdf) diff --git a/docs/products/bike/bike-overview.mdx b/docs/products/bike/bike-overview.mdx index 92eb07e1..ea0a0744 100644 --- a/docs/products/bike/bike-overview.mdx +++ b/docs/products/bike/bike-overview.mdx @@ -141,7 +141,7 @@ export const MCUManager = () => { <>
{ +