Alcohol Click Questions

General discussion on Libstock website & codes posted on this website.
Post Reply
Author
Message
elvinguitar
Posts: 2
Joined: 08 Jul 2015 05:52

Alcohol Click Questions

#1 Post by elvinguitar » 08 Jul 2015 06:22

I have the Alcohol Click and I'm trying to make it work. I have some questions regarding the MQ3 and the source code.

1. The MQ-3 datasheet (http://english.hwsensor.com/ewebeditor/ ... n/MQ-3.pdf) says "use a value of Load resistance (RL) that about 200Kohms (100kohms to 470kohms)." But why is that the load resistance in the Alcohol Click Manual http://www.mikroe.com/downloads/get/210 ... manual.pdf doesn't reach the recommended load resistance (200K) or the range (100k to 470k)? Am I right that the load resistance based on the Alcohol Click Manual is only 10470 ohms (470ohms from R2 plus 10kohms from the potentiometer, if max)?


2. In the source code from Libstock http://www.libstock.com/projects/downlo ... oc_pic.zip, it has an initialization of:

Code: Select all

const double Rl      = 5000.0;               // Rl (Ohm) - Load resistance
what is the use of the potentiometer if the value of Rload is constant? And why is it 5kohms and not the recommended 200kohms?


3. In this line of code:

Code: Select all

lgPPM = (log10(ratio) * -2.6)+ 2.7;        // Calculate ppm
may I ask where did you get that formula? I already searched the web and I didn't find that kind of formula. Where did the value -2.6 and 2.7 come from?


Sorry if I have too many questions. I'm just curious and I want some answers to my questions to gain some knowledge. Thank you and God bless :D

User avatar
aleksa.jovanovic
Posts: 526
Joined: 30 Jun 2015 08:48

Re: Alcohol Click Questions

#2 Post by aleksa.jovanovic » 08 Jul 2015 12:34

Hello,

Since you've opened a ticket I will answer you there.

Best regards,
Aleksa.

elvinguitar
Posts: 2
Joined: 08 Jul 2015 05:52

Re: Alcohol Click Questions

#3 Post by elvinguitar » 09 Jul 2015 01:55

I've already read your email and I'm not satisfied with the answer. Anyway, I think it would be better if you'll just post your reply here so that the others will also know the answers to my questions.

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: Alcohol Click Questions

#4 Post by Megahurts » 25 Jul 2015 19:01

Hi elvinguitar,
(curious about user name, as I play too)

You might want to read this thread and the posts I did about my H2 Click board also.
http://www.mikroe.com/forum/viewtopic.p ... 11#p249111

I had to replace the load resistor (R2) with different value one in order to get to work like expected.

The RL load constant value in the code needs to be changed to what you actually measure (with ohm meter) the adjustment potentiometer is set at after you are done calibrating.
(which is just setting the current draw through the sensor high enough so that output voltage is zero or near zero when sensor is warmed up and not exposed to alcohol fumes)

With no power to Click board, measure from ground pin to both ends of R2 - one end will be zero ohms, the other end will give you R2's actual value. Write this measurement value down.
Check that R2's value matches or is close to what the schematic indicates - mine did not and had to be replaced.
Now measure the resistance from ADC-output pin and ground pin, this is the "RL" value for the code constant. (potentiometer + R2, as you surmised)

My analysis of the gas detector circuits resulted with a need to check the fixed value resistor (R2) that is in series with the potentiometer. If its value is too high, getting a zero voltage output calibration
is not possible.
The value of R2 needs to be less than .5K (500 ohms), or lower if a zero volt output can not be achieved with potentiometer turned to minimum resistance (0 ohms) and no gas present.
Its (R2) function in the circuit is to provide enough current limiting resistance and voltage drop so that when the potentiometer is set at 0 ohms, the power supply is not then shorted to ground through the sensor
and output pin is also not shorted to ground so a voltage change can be seen at the ADC output pin.

The boards output voltage is derived from the sensor's (variable) resistance (on high side) and the resistance of potentiometer + R2 (on low side) configured as a variable voltage divider circuit.

The sensors resistance decreases with increased amounts of detectable gas, which means lower voltage drop across it so higher voltage at output.

Since the required power supply for operation is 5V, if you are going to use low power (3.3-3.6V) MCU host hardware, calibration and testing of the gas Click board(s) should be done as stand-alone before connecting the Click to the host MCU HW.
Possibility of over voltage damage to host ADC input can happen otherwise. So check that maximum ADC output voltage stays in host MCU input range before connecting them together.

it does not take much gas to saturate the sensor so its resistance goes to lowest, providing the highest voltage output for you to measure and check if in range.
(personally, I adjust and calibrate the high side voltage output instead of going for zero because zero voltage won't hurt my MCU, but allowing over voltage for a high concentration of gas will!)

I hope this clears things up and helps you out. If still having problem or questions, post it and will try to assist again.

Regards, Robert.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

Post Reply

Return to “Libstock Discussion”