Author Topic: Read HB100's signal frequency with microcontroller PIC18F46K22  (Read 969 times)

0 Members and 1 Guest are viewing this topic.

Offline Fire91Topic starter

  • Newbie
  • Posts: 5
  • Country: it
Read HB100's signal frequency with microcontroller PIC18F46K22
« on: November 11, 2018, 11:27:14 am »
I'm trying to read the frequency of the signal generated by the HB100 sensor with the PIC18F46K22, the range of frequency is about 10-100 Hz. As shown in the picture, the wiring scheme is composed of an amplifier module made with the OPA2365 opamp with wich I amplify the HB100's signal, the output of this opamp is connected to the RA0 pin of the PIC followed by an internal comparator module, his reference voltage is set via software at 2.048 V (non-inverting pin) and output is pin RA4. The output of the comparator is connected to an input capture module (pin RC1) that reads the period, so I determine the frequency. The frequency counter block of the microcontroller works correctly, in fact, to test it I put in RA0 a sinusoidal 0-5V signal coming from a waveform generator and it reads correctly the frequency. However, when I put the HB100 signal into RA0, the comparator does not detect any signal variation from the inverting pin, ie its output is always low. Why does the circuit work with any signal and with the HB100 signal it does not work? The HB100's signal varies from 0 V to 5 V without problems, but the comparator can't detect when the signal is greater or less than 2.048 V. Can someone help me? Thanks.

« Last Edit: November 11, 2018, 11:28:52 am by Fire91 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf