Giter Site home page Giter Site logo

microchip-pic-avr-examples / avr128db48-overcurrent-protection-mplab-mcc Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 1.06 MB

This repository provides a MCC MPLAB® X project for a core independent overcurrent protection and handling with auto-calibration of current draw trigger level using the internal OPAMP, TCD and AC.

License: Other

Makefile 2.58% C 94.91% Assembly 2.51%
avr-db overcurrent-protection

avr128db48-overcurrent-protection-mplab-mcc's Introduction

MCHP

AVR128DB48 Current Spike Detection

A new feature introduced in the AVR® DB family is the Analog Signal Conditioning (OPAMP) peripheral. In this example, the OPAMP is used together with an Analog Comparator (AC) to form a current spike detector. The fan is enabled by a TCD waveform output. This output will be shut off automatically when the current spike is detected by the detector, making it an ideal solution for applications where functional safety is needed. As an example of an application where a current spike might indicate failure or danger, is a computer fan. Under normal operation, the current consumption is nonlinear, but does not exceed a certain threshold, dependent on the fans spec. By autotuning the gain of the internal OPAMP by using the internal resistor ladders, we can automatically boost the signal to a measurable range, and automatically set a trigger level for the AC by use of the on board DAC to define what an "unnaturally" high current consumtion is, indicating a touch or something stuck in the fan.

Related Documentation

Software Used

Hardware Used

  • AVR128DB48 Curiosity Nano
  • A small computer fan (M1)
  • 3x 1 kOhm resistor (R2, R3, R5)
  • 1x 10 kOhm resistor (R6)
  • 1x 0.1 Ohm current sense resistor (R1)
  • 2x 100nF capasitors (C1, C2)
  • 1x N-Channel MOSFET transistor (Q1)
  • 1x Signal Diode (D1)

Setup

  • Hook up the circuit as shown in the figure below
  • For minimal noise, soldering the circuit onto a perfboard/stripboard is prefered, although a breadboard could be used with worse performance

Circuit Drawing

Operation

  • Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable
  • Download the *.zip file or clone the example to get the source code
  • Open avr128db48-overcurrent-protection-mcc.X in MPLAB X
  • Press the make and program button to program the device
  • If no tool has been chosen, a window will open, select the AVR128DB48 Curiosity Nano. The tool can also be choosen in the project settings.
  • After the LED stops flashing, it is done calibrating
  • Gently apply preassure to the fan, being very careful not to hurt yourself. The fan should now stop.
  • Click the onboard button (SW1) to re-enable the fan

Conclusion

After going through this example, you should have a better understanding of how to combine the OPAMP and AC peripherals to make a current spike detector.

avr128db48-overcurrent-protection-mplab-mcc's People

Contributors

aku-work avatar bjornamr avatar carlehe avatar

Watchers

 avatar  avatar  avatar

Forkers

uttambasu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.