Skip to content

Commit

Permalink
addde the files of nl50 nad nlcs11 sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
LT000-ops committed Sep 26, 2024
1 parent b32f6dd commit ebce34f
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/sensors/sensors/rus_04.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@

## 模块结构图

### RUS-04(蓝色款)尺寸图
### RUS-04(蓝色款)和HC-04(普通款)尺寸图

![RGB](rus_04/rus_04_blue_cad.png)
### RUS-04(蓝色款)尺寸图
### RUS-04(黑色款、蓝色款)尺寸图
![RUS-04](rus_04/rus_04_cad.png)


Expand Down
67 changes: 67 additions & 0 deletions docs/sensors/sensors/temperature_sensor_nl50.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# NL50温度传感器

## 实物图







## 概述

NL50是由我司自主研发的温度传感器,该温度传感器是利用二极管的基本原理来测量已知温度值。随着温度的升高,二极管俩端的电压的已知的速率增加.通过精确放大电压变化,产生与环境温度成正比的电压信号,从而获取相应的温度值。

因此NL50传感器具有精确度高,连接方式简单等优点。



## 模块参数

| 引脚名称 | 描述 |
| :------: | :------------------: |
| G | GND |
| V | VCC |
| S | DATA串行数据,单总线 |

- 供电电压:3v3/5V
- 连接方式:4PIN防反接杜邦线
- 模块尺寸:40 x 22.5 mm
- 安装方式:M4螺钉兼容乐高插孔固定



## Arduino示例程序

```c
/**
* @example read_temperature.ino
*/

#include "temperature_sensor_nl50.h"

namespace {
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP32S3)
constexpr uint8_t kPin = 34;
#elif defined(ARDUINO_ARCH_AVR)
constexpr uint8_t kPin = A0;
#endif

emakefun::TemperatureSensorNl50 g_nl50(kPin);
} // namespace

void setup() {
Serial.begin(115200);
Serial.println(String(F("temperature sensor NL50 lib version: ")) + emakefun::TemperatureSensorNl50::Version());
g_nl50.Initialize();
Serial.println(F("setup successful"));
}

void loop() {
Serial.println(String("temperature: ") + g_nl50.Read());
delay(100);
}

```

[点击下载Arduino库以及示例程序](temperature_sensor_nl50/nl50_example.zip)
Binary file not shown.
100 changes: 100 additions & 0 deletions docs/sensors/smart_modules/color_recognition_nlcs11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# NLCS11颜色识别模块

## 模块图









## 概述

NLCS11是一款基于颜色的光到数字的转换器,它结合了光电二极管、电流放大器、模拟电路和数字信号处理器。

为了提高精度,让颜色管理更加准确。板载自带一个高亮LED,可以让传感器在低环境光的情况下依然能够正常使用,实现“补光”的功能,可以通过LED Switch开关对它进行打开或关闭。颜色识别传感器模块采用I2C通信,拥有PH2.0防反插接口,使用便利

NLCS11设备可进行色温测量、亮度传感。内部状态机提供了将设备置于色温测量之间的低功率状态的能力,非常低的平均功耗。

此设备可以应用于亮度传感器丶彩色温度传感器、 小笔记本、 穿戴设备、工业及医疗等领域。



## 模块参数

* 工作电压:3.3-5V
* 工作电流:65uA
* 检测距离:3-10mm
* 时钟频率:0-400KHZ
* 接 口:IIC接口和2.54间距接口
* 温度范围:-30℃ ~ +70℃
* 通信方式: IIC通信,地址0x43
* 尺 寸:40 * 22 mm,兼容乐高积木和M4螺丝固定孔



## 引脚定义

| 引脚名称 | 描述 |
| -------- | ----------- |
| G | GND地线 |
| V | 5V电源引脚 |
| SDA | I2C数据引脚 |
| SCL | I2C时钟引脚 |



## Arduino读取RGB示例函数

```c
/**
* @example read_rgb.ino
*/

#include "color_sensor_nlcs11.h"

#define INFINITE_LOOP_ON_FAILURE InfiniteLoopOnFailure(__FUNCTION__, __LINE__)

namespace {
emakefun::ColorSensorNlcs11 g_color_sensor;
void InfiniteLoopOnFailure(const char* function, const uint32_t line_number) {
Serial.println(String(F("entering an infinite loop due to failure in ")) + function + F(", at line number: ") + line_number);
while (true) {
yield();
}
}

} // namespace

void setup() {
Serial.begin(115200);
Serial.println(F("setup"));

Wire.begin();

Serial.println(String(F("color sensor lib version: ")) + emakefun::ColorSensorNlcs11::kVersionMajor + "." +
emakefun::ColorSensorNlcs11::kVersionMinor + "." + emakefun::ColorSensorNlcs11::kVersionPatch);

const auto ret = g_color_sensor.Initialize();

if (emakefun::ColorSensorNlcs11::kOK == ret) {
Serial.println(F("color sensor initialization successful"));
} else {
Serial.println(String(F("color sensor device initialization failed: ")) + ret);
INFINITE_LOOP_ON_FAILURE;
}

Serial.println(F("setup successful"));
}

void loop() {
const auto color = g_color_sensor.GetColor();
Serial.println(String("r: ") + color.r + ", g: " + color.g + ", b: " + color.b);
delay(50);
}
```

[点击下载Arduino库以及示例程序](color_recognition_nlcs11/nlcs11_example.zip)

Binary file not shown.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ nav:
- 五路循迹传感器v2.0: sensors/sensors/five_way_tracking_sensor_v2.0.md
- 五路循迹传感器v3.0: sensors/sensors/five_line_tracker_v3/five_line_tracker_v3.md
- RGB超声波传感器: sensors/sensors/rus_04.md


- 执行器:
- 有源蜂鸣器模块: sensors/actuators/buzzerModel.md
Expand Down Expand Up @@ -108,6 +109,7 @@ nav:
- 语音合成模块: sensors/smart_modules/text_to_speech_synthesizer.md
- I2C扩展板模块: sensors/smart_modules/gpio_expansion_board.md
- RFID-I2C模块: sensors/smart_modules/RFID-I2C.md
- NLCS11颜色识别传感器: sensors/smart_modules/NLCS11.md
- 电源模块:
- 3.7V升压充电模块: sensors/power_module/3.7v_battery_module.md
- 7.4V充电电池模块: sensors/power_module/16340_2s_li_battery_module.md
Expand Down

0 comments on commit ebce34f

Please sign in to comment.