Tom Minnich
Published © GPL3+

DPS310 based Storm Window

The DPS310 barometric sensor with the help of a micro-controller closes the window before rain starts falling.

AdvancedFull instructions providedOver 1 day1,298
DPS310 based Storm Window

Things used in this project

Hardware components

Infineon Sensor Hub Nano
×1
Infineon XMC 2Go
×1
Adafruit Sensiron SHT31-D
×1
DAVE software developement IDE from Infineon
The IDE I used to develop this project
×1
prototyping board
×1
wire wrapping wire
×1

Story

Read more

Schematics

Infineon XMC1100

The microcontroller in XMC 2 Go

BLE Module Data Sheet

Stuff to know for applying Sensor Hub Nano

BLE Module User Guide

More stuff to know for applying Sensor Hub Nano

Circuit Board I2C Bus Interconnect

Shows how to connect I2C bus among the circuit boards

Pin Connections XMC 2 Go board

Helpful guide to the XMC 2 Go pinouts

Code

Starting Point Dave Project

C/C++
Used with XMC 2 Go Kit
/*
 * main.c
 *
 *  Created on: 2017 Aug 24 08:35:14
 *  Author: tminnich
 */




#include <DAVE.h>                 //Declarations from DAVE Code Generation (includes SFR declaration)
uint8_t data[] = "Infineon Technologies";
uint8_t rec_data[10];
/**

 * @brief main() - Application entry point
 *
 * <b>Details of function</b><br>
 * This routine is the application entry point. It is invoked by the device startup code. It is responsible for
 * invoking the APP initialization dispatcher routine - DAVE_Init() and hosting the place-holder for user application
 * code.
 */

int main(void)
{
  DAVE_STATUS_t status;
#define TOM_TIMER_LIMIT 1000000
  int tom_timer;

  status = DAVE_Init();           /* Initialization of DAVE APPs  */

  if(status != DAVE_STATUS_SUCCESS)
  {
    /* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */
    XMC_DEBUG("DAVE APPs initialization failed\n");

    while(1U)
    {

    }
  }

  /* Placeholder for user application code. The while loop below can be replaced with user application code. */
  UART_Transmit(&UART_0,data,sizeof(data) - 1);
  while(1U)
  {
  	for(tom_timer=0;tom_timer<TOM_TIMER_LIMIT;tom_timer++){
  	}
 	DIGITAL_IO_ToggleOutput(&DIGITAL_IO_0);
  }
}
void EndofTransmit()//
{
	UART_Receive(&UART_0, rec_data, sizeof(rec_data));
}
void EndofReceive()//
{
	 UART_Transmit(&UART_0, rec_data, sizeof(rec_data));
}

Credits

Tom Minnich

Tom Minnich

19 projects • 80 followers
Embedded software guy for a long time

Comments