• 0
Manas

Analog sensor interfacing with artix7

Question

Hi,

I'm trying to use xadc demo project to read sensor output and perform necessary action based on the xadc output.

I'm getting the digital output when some analog signal is fed to the ports A18 and B18 of artix7. 

I'm stuck as how convert the values to ppm value so as to generate a warning system.

Hope someone can help.

Regards

Manas

 

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

@Manas,

I'm afraid I'd need more details in order to help you:

  1. If you are "getting the digital output", does that mean you are or are not successfully using the XADC?
  2. Are you trying to recover a known PPM (pulse position modulation) signal, or stuck with one that is somehow PPM when it isn't supposed to be?

Dan

 

Share this post


Link to post
Share on other sites
  • 0

@D@n

Thanks for addressing my issue. I'm able to see the output using the xadc demo through the  segment display when analog signal is fed to A18 and B18 port using analog discovery kit. My main concern now is to interface gas sensor like MQ-6 and use the digital value to get meaningful readings in the form of parts per million. I'm stuck as how to proceed to realize the project. 

Regards

Manas

Share this post


Link to post
Share on other sites
  • 0

@Manas,

Is this the sensor you wish to interface to?  Looks fairly straightforward.  You'll need to run the output voltage through a divider, though, since (if I recall correctly) 5V is too much for the XADC.  As I recall, 3.3V is the maximum you would want to put into the XADC.  Xilinx discusses more of the external electronics associated with connecting up an XADC in this note.

As far as the logic is concerned, you will need to get an equation that translates voltage to PPMs from the sensor manufacturer, and a similar equation that converts counts (i.e. ADC output value) to voltage from Xilinx.  Counts to voltage is usually simply a linear scaling between the max voltage and the max ADC value, so that scaling is fairly simple.  voltage to parts-per-million (PPM) of a given sensor reading ... well, that's more application specific.

Let me know if this isn't enough of a help to get you going, or if not ... where your struggle lies.

Dan

Share this post


Link to post
Share on other sites
  • 0

@D@n

Thanks again. I'm planning to use MQ-5 sensor. Please find data sheet attached below. The xadc demo display the output voltage in the 7 segment display of artix7. I was contemplating on somehow to convert the output values to parts-per-million(PPM). Will this approach be possible? And regarding the equation to get PPM value, I have no clue. Basically I'm struggling to get meaningful result from artix7 board using the MQ-5 gas sensor. 

Regards

Manas 

MQ-5-Datasheet.pdf

Share this post


Link to post
Share on other sites
  • 0

@Manas,

Yeah, that's quite the sensor to use.  If I understand the figure on the second page properly, there is not a single equation from counts to PPM.  You will have one equation for each gas you want to be measuring ppm's of, and it isn't clear what the ppm meaning will be when there are multiple gasses in the environment.  To make matters worse, the sensor's resistance adjusts as a result of its measurement, so you will need to very carefully work that resistance network on the output to get the right voltage measurement when you are done.

The conversion from XADC measurement to PPM value is therefore highly dependent upon the circuit you build to feed the XADC.  As a result, I can't solve it from here for you.

Dan

Share this post


Link to post
Share on other sites
  • 0

@D@n 

I initially plan to detect only one gas. I was also thinking to interface lm35 temperature sensor. How should i proceed with the xadc to get the temperature displayed in Celsius in the 7 segment display? How should i proceed with the lm35 temperature sensor?

Thanks

Regards

Manas

Share this post


Link to post
Share on other sites
  • 0

@Manas,

Is this the sensor you are referencing now?

Either way, temperature sensors can be difficult to test--mostly because the lab rooms in which people work in/at tend to be maintained at a nearly constant temperature.  Turning a fan on won't necessarily change the temperature.  So ... how can you get the temperature to adjust?  or worse, how will you know if your reading is accurate?

If you have never displayed anything on a seven segment display before, than you may wish to pause and examine how to do that.  Send the display fixed/known values until you have confidence that you can do so.  You can even practice by sending changing values, just make certain that your test is simple enough that when things go wrong, you can back out what is going wrong.

I got a seven segment display working for a Basys-3 project--it's the only 7-segment display I have in my lab.  The only gotcha I found was that you had to follow Digilent's instructions rather closely.  That means that each LED in the display must receive voltage for the amount of time they list (roughly).  I originally tried to build a seven segment display controller that would dim the various pieces and ... just ended up frustrated.  (My voltages were lighting up multiple LED's, confusing the output.)  Follow the reference material and you should be fine.

Dan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now