We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-03-13
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Current sensor
Downloaded: 3685 times
Not followed.
License: MIT license
Hall Current 5 Click is a very accurate electric current measurement Click board based on the ACS733 IC. This IC is a galvanically isolated current sensor, which utilizes the Hall-effect principle.
Do you want to subscribe in order to receive notifications regarding "Hall Current 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Hall Current 5 click" changes.
Do you want to report abuse regarding "Hall Current 5 click".
Library Description
This library provides basic functionality for reading the current value and controlling the click board.
Key functions:
float hallcurrent5_getCurrent(uint16_t adcValue)
- Reads current in mA.float hallcurrent5_getADCVoltage(uint16_t adcValue)
- Reads voltage on the AN-pin.void hallcurrent5_setADCResolution(float adcRes)
- Set ADC resolution (10bit or 12bit).Examples description
The application is composed of the three sections :
void applicationTask()
{
int16_t ADC_value;
uint32_t sumADC = 0;
uint8_t cnt;
float current;
char demoText[ 50 ];
sumADC = 0;
for(cnt = 0; cnt < 20; cnt++)
{
sumADC += hallcurrent5_adcRead();
}
ADC_value = (sumADC / 20);
current = hallcurrent5_getCurrent(ADC_value/1.8);
if (current < 0) current = 0;
WordToStr(ADC_value, demoText);
mikrobus_logWrite(" ADC value: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
FloatToStr(current, demoText);
mikrobus_logWrite(" Current : ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
mikrobus_logWrite(" ", _LOG_LINE);
Delay_ms( 500 );
}
Note: Before the start of the program you have to set the starting voltage on AN pin. First, measure the voltage in mV on AN pin, when electronic load isn't connected to the Click board, and pass that value as an input parameter of the voltage initialization function.
Other mikroE Libraries used in the example:
ADC
UART
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.