V to Hz Click Board
V to Hz Click Board
The V to HZ Click Board™ is a device that converts an analogue voltage input signal into a pulse wave signal of a certain frequency. It has a linear response, so applying a voltage in a range of 0 to 5V on its input, will result in generating the pulse train with frequency linearly proportional to the input voltage.
The V to HZ Click Board™ features very good linearity, covers a frequency range from 10Hz to 10 kHz and it has good temperature stability.
Software Support
We provide a library for V to Hz click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Example Description
The demo application is composed of the application task, and set frequency function :
- Application Task - Alternates between different output frequencies
- v2hz_setOutputFrequency - Sets the PWM duty cycle to required value, changing
v2hz_setOutputFrequency(float frequency) { float dutyCycle; dutyCycle = PWM_TIM5_Init(50000); dutyCycle *= frequency; dutyCycle /= 10000; PWM_TIM5_Set_Duty(dutyCycle, _PWM_NON_INVERTED, _PWM_CHANNEL1); PWM_TIM5_Start(_PWM_CHANNEL1, &_GPIO_MODULE_TIM5_CH1_PA0); } void applicationTask() { v2hz_setOutputFrequency(1000); //1000 Hz output Delay_ms(3000); v2hz_setOutputFrequency(2000); //2000 Hz output Delay_ms(3000); v2hz_setOutputFrequency(5000); //5000 Hz output Delay_ms(3000); v2hz_setOutputFrequency(10000); //10000 Hz output Delay_ms(3000); }
The full application code, and ready to use projects can be found on our LibStock page.
Other MikroElektronika libraries used in the example:
- PWM
Additional Notes and Information
Depending on the development board you are using, you may need a 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.
V to Hz Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.