初学者
10 分钟

通过使用DRV8213电机驱动器、MF25060V2-1000U-A99散热风扇和PIC18F4458实现电子系统的最佳散热管理

紧凑型散热解决方案,用于管理电子系统中的热量

Cooler Click with EasyPIC v8

已发布 6月 24, 2024

点击板

Cooler Click

开发板

EasyPIC v8

编译器

NECTO Studio

微控制器单元

PIC18F4458

防止电子设备过热!使用此迷你空调添加高效散热。

A

A

硬件概览

它是如何工作的?

Cooler Click基于德州仪器的先进无刷直流电机驱动器DRV8213作为其核心组件。此创新板集成了微型温度传感器TMP007和冷却风扇MF25060V2-1000U-A99,直接在其表面,使其成为即插即用的冷却解决方案。它非常适用于易于过热的环境,例如服务器机架冷却、嵌入式系统和物联网设备、开发板原型制作、游戏机和PC冷却、汽车电子、医疗设备冷却或类似应用中,在这些应用中持续冷却至关重要。DRV8213是一款全面的电机驱动器,具有集成的全桥驱动器,具有电流感应和调节能力,并具有独特的电流感应输出。它设计高效,使用2针PWM接口,通过

mikroBUS™插座上的IN1和IN2引脚进行电机速度控制,覆盖从0到100kHz的宽PWM频率范围。值得注意的是,其自动休眠模式通过在不使用时自动进入低功耗模式减少了对额外GPIO连接的需求。DRV8213还增强了多种保护功能,例如欠压锁定、过流保护和过温关断,确保在各种条件下的可靠运行。另一个板载组件是来自德州仪器的TMP007传感器,采用红外热电堆技术测量温度而无需与物体直接接触。此功能可以准确监测Click板放置位置的周围温度。传感器的输出被数字化,并与晶片温度一起处理,以计算物体温度。它使用I2C接口与主机MCU通信,并通过

mikroBUS™插座的ALR引脚提供超温通知。补充这些组件的是MF25060V2-1000U-A99风扇,这是一款高性能冷却风扇,工作在5VDC电源下,最高转速可达10,000 RPM。此风扇对于高效散热至关重要,确保系统在运行期间保持凉爽。此Click板可以通过VCC SEL跳线选择3.3V或5V逻辑电压电平运行。这样,既支持3.3V又支持5V的MCU可以正确使用通信线路。此外,此Click板配备了一个包含易于使用的功能和示例代码的库,可用作进一步开发的参考。

Cooler Click hardware overview image

功能概述

开发板

EasyPIC v8 是一款专为快速开发嵌入式应用的需求而特别设计的开发板。它支持许多高引脚计数的8位PIC微控制器,来自Microchip,无论它们的引脚数量如何,并且具有一系列独特功能,例如首次集成的调试器/程序员。开发板布局合理,设计周到,使得最终用户可以在一个地方找到所有必要的元素,如开关、按钮、指示灯、连接器等。得益于创新的制造技术,EasyPIC v8 提供了流畅而沉浸式的工作体验,允许在任何情况下、任何地方、任何时候都能访问。

EasyPIC v8 开发板的每个部分都包含了使同一板块运行最高效的必要组件。除了先进的集成CODEGRIP程 序/调试模块,该模块提供许多有价值的编程/调试选项和与Mikroe软件环境的无缝集成外,该板还包括一个干净且调节过的开发板电源供应模块。它可以使用广泛的外部电源,包括电池、外部12V电源供应和通过USB Type-C(USB-C)连接器的电源。通信选项如USB-UART、USB DEVICE和CAN也包括在内,包括 广受好评的mikroBUS™标准、两种显示选项(图形和

基于字符的LCD)和几种不同的DIP插座。这些插座覆盖了从最小的只有八个至四十个引脚的8位PIC MCU的广泛范围。EasyPIC v8 是Mikroe快速开发生态系统的一个组成部分。它由Mikroe软件工具原生支持,得益于大量不同的Click板™(超过一千块板),其数量每天都在增长,它涵盖了原型制作和开发的许多方面。

EasyPIC v8 horizontal image

微控制器概述 

MCU卡片 / MCU

PIC18F4458

建筑

PIC

MCU 内存 (KB)

24

硅供应商

Microchip

引脚数

40

RAM (字节)

2048

使用的MCU引脚

mikroBUS™映射器

Current Monitor
RA2
AN
Fan Driver Control 2
RE1
RST
ID COMM
RE0
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Fan Driver Control 1
RC0
PWM
Alert Interrupt
RB0
INT
NC
NC
TX
NC
NC
RX
I2C Clock
RC3
SCL
I2C Data
RC4
SDA
Power Supply
5V
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

Cooler Click Schematic schematic

一步一步来

项目组装

EasyPIC v8 front image hardware assembly

从选择您的开发板和Click板™开始。以EasyPIC v8作为您的开发板开始。

EasyPIC v8 front image hardware assembly
Buck 22 Click front image hardware assembly
MCU DIP 40 hardware assembly
EasyPIC v8 DIP MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
NECTO Compiler Selection Step Image hardware assembly
NECTO Output Selection Step Image hardware assembly
Necto image step 6 hardware assembly
Necto DIP image step 7 hardware assembly
Necto image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto PreFlash Image hardware assembly

实时跟踪您的结果

应用程序输出

1. 应用程序输出 - 在调试模式下,“应用程序输出”窗口支持实时数据监控,直接提供执行结果的可视化。请按照提供的教程正确配置环境,以确保数据正确显示。

2. UART 终端 - 使用UART Terminal通过USB to UART converter监视数据传输,实现Click board™与开发系统之间的直接通信。请根据项目需求配置波特率和其他串行设置,以确保正常运行。有关分步设置说明,请参考提供的教程

3. Plot 输出 - Plot功能提供了一种强大的方式来可视化实时传感器数据,使趋势分析、调试和多个数据点的对比变得更加直观。要正确设置,请按照提供的教程,其中包含使用Plot功能显示Click board™读数的分步示例。在代码中使用Plot功能时,请使用以下函数:plot(insert_graph_name, variable_name);。这是一个通用格式,用户需要将“insert_graph_name”替换为实际图表名称,并将“variable_name”替换为要显示的参数。

软件支持

库描述

该库包含 Cooler Click 驱动程序的 API。

关键功能:

  • cooler_get_object_temperature - 此函数读取对象的温度数据,以摄氏度为单位。

  • cooler_set_out_state - 此函数控制冷却器的操作 - 开/关。

开源

代码示例

完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio 应用程序代码也可以在MIKROE的GitHub账户中找到。

/*!
 * @file main.c
 * @brief Cooler Click Example.
 *
 * # Description
 * This example demonstrates the use of the Cooler click board 
 * by reading the target object temperature and controlling the cooler.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * The initialization of the I2C module, log UART, and additional pins.
 * After the driver init, the app executes a default configuration.
 *
 * ## Application Task
 * The demo application measures the temperature of the target object in degrees Celsius 
 * and enables a cooler if the temperature exceeds the temperature high limit value.
 * Results are being sent to the UART Terminal, where you can track their changes.
 *
 * @author Nenad Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "cooler.h"

// Object temperature high limit
#define COOLER_TEMP_HIGH_LIMIT    30.0

static cooler_t cooler;   /**< Cooler Click driver object. */
static log_t logger;    /**< Logger object. */

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    cooler_cfg_t cooler_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    cooler_cfg_setup( &cooler_cfg );
    COOLER_MAP_MIKROBUS( cooler_cfg, MIKROBUS_1 );
    err_t init_flag = cooler_init( &cooler, &cooler_cfg );
    if ( ( ADC_ERROR == init_flag ) || ( I2C_MASTER_ERROR == init_flag ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( COOLER_ERROR == cooler_default_cfg ( &cooler ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    float temperature = 0;
    if ( COOLER_OK == cooler_get_object_temperature( &cooler, &temperature ) )
    {
        log_printf( &logger, " Temperature: %.2f degC\r\n", temperature );
        log_printf( &logger, " Cooler: " );
        if ( COOLER_TEMP_HIGH_LIMIT < temperature )
        {
            if ( COOLER_OK == cooler_set_out_state( &cooler, COOLER_ENABLE ) )
            {
                log_printf( &logger, " Enabled.\r\n\n" );
            }
        }
        else
        {
            if ( COOLER_OK == cooler_set_out_state( &cooler, COOLER_DISABLE ) )
            {
                log_printf( &logger, " Disabled.\r\n\n" );
            }
        }
    }
    Delay_ms ( 1000 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

// ------------------------------------------------------------------------ END

额外支持

资源

喜欢这个项目吗?

'购买此套件' 按钮会直接带您进入购物车,您可以在购物车中轻松添加或移除产品。