This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Doppler sensor interface with MSp430

Other Parts Discussed in Thread: MSP430G2231

I have recently received HB100 doppler sensor and want to interface it with MSp430.The output signal from the sensor has been amplified and conditioned and i get square wave signal .Now this square wave has to be interfaced with MSP430G2231 through ADC.Since I have little experience in programming ,I need help how can i process the  signal using MSP430 (any code which might help)

  • What type of output does this sensor produce? You mentioned square wave? Is it a pulse width modulated output? Having a square wave normally means the measurement of time e.g. frequency or the duty cycle of a PWM, therefore the ADC can be used, but a timer module would be better suited for that. Please provide some more information about the signal you get from the sensor.

    Dennis
  • >Now this square wave has to be interfaced with MSP430G2231 through ADC
    You don't need ADC to interface _square_ wave signal. Ensure that your signal conforms to logical levels of the chip and read it using timer capture input.
  • It is a square wave.Link below has a youtube video which shows type of waveform which is to be given to MSP430

    https://www.tindie.com/products/limpkin/hb100-doppler-module-with-backpack-1/

  • The link you provided mentions two outputs:

    The frequency output is measured with a timer capture and the voltage output with an ADC.

    Dennis

  • Thanks dennis ,How this voltage can be measured using ADC any code which can help me.I have tested the module when there is no obstruction it is ideally 2V .but when some obstacle cuts it it goes till max 4.5V.
  • 4.5V is too much for the MSP430, you will need to scale this voltage down. You could use a simple voltage divider with two identical resistors to half the output voltage. The MSP430G2231 has an internal 2.5V reference which will be suited in that case (maximum input voltage of 5V into your resistor divider). Example programs for using the ADC can be found here.

    The following examples show different scenarios for the ADC10:

    • msp430g2x31_adc10_01.c           ADC10, Sample A0, Set P1.0 if A0 > 0.5*AVcc
    • msp430g2x31_adc10_02.c           ADC10, Sample A1, 1.5V Ref, Set P1.0 if A1 > 0.2V
    • msp430g2x31_adc10_03.c           ADC10, ADC10, Sample A10 Temp, Set P1.0 if Temp ++ ~2C
    • msp430g2x31_adc10_04.c           ADC10, ADC10, Sample A1, Signed, Set P1.0 if A1 > 0.5*AVcc
    • msp430g2x31_adc10_05.c           ADC10, ADC10, Sample A11, Lo_Batt, Set P1.0 if AVcc < 2.3V
    • msp430g2x31_adc10_06.c           ADC10, ADC10, Output Internal Vref on P1.4 & ADCCLK on P1.3
    • msp430g2x31_adc10_07.c           ADC10, DTC Sample A1 32x, AVcc, Repeat Single, DCO
    • msp430g2x31_adc10_08.c           ADC10, ADC10, DTC Sample A1 32x, 1.5V, Repeat Single, DCO
    • msp430g2x31_adc10_09.c           ADC10, ADC10, DTC Sample A10 32x, 1.5V, Repeat Single, DCO
    • msp430g2x31_adc10_10.c           ADC10, ADC10, DTC Sample A3-01, AVcc, Single Sequence, DCO
    • msp430g2x31_adc10_11.c           ADC10, ADC10, Sample A1, 1.5V, TA1 Trig, Set P1.0 if > 0.5V
    • msp430g2x31_adc10_12.c           ADC10, Sample A7, 1.5V, TA1 Trig, Ultra-Low Pwr
    • msp430g2x31_adc10_13.c           ADC10, DTC Sample A1 32x, AVcc, TA0 Trig, DCO
    • msp430g2x31_adc10_14.c           ADC10, DTC Sample A1-0 16x, AVcc, Repeat Seq, DCO
    • msp430g2x31_adc10_16.c           ADC10, ADC10, DTC Sample A0 -> TA1, AVcc, DCO
    • msp430g2x31_adc10_temp.c      ADC10, Sample A10 Temp and Convert to oC and oF

    This is a good point to start from. Look in the user's guide for additional information. No need to read everything, just the chapter about the ADC10.

    Dennis

  • The MSP430G2231 has an internal 2.5V reference voltage.Is this also called threshold voltage
  • Not really...I do not know where you have that phrase from, but a threshold voltage more belongs to a comparator. Or maybe in this example

    • msp430g2x31_adc10_01.c           ADC10, Sample A0, Set P1.0 if A0 > 0.5*AVcc

    you could say that 0.5*AVcc is your threshold voltage where the program sets P1.0 - in this case the ADC works as an comparator (or at least the software does).

    Dennis

  • So just for example if we set our comparator at half of Vref and suppose if our input is above 1/2 Vref, set it to 1; if below, set it to 0. Am i right
  • Yes, but a comparator has only 1 bit of resolution - it is on or off. Is that enough for your purposes?

**Attention** This is a public forum