GithubHelp home page GithubHelp logo

Comments (3)

ostaquet avatar ostaquet commented on June 24, 2024

See below some answers.

1° I changed the original schema with a MOSFET to have a higher voltage on the heater. Using a BC337 is fine but, even saturated, you don't have 5V on the heater. There is always a drop of voltage in the transistor (Vbe). For the BC337, you end with 4.3V for the heater in ideal conditions. With the MOSFET, you have 5V for the heater, it is better the reach the temperature.

3° The voltage on the analog input is calculated by using the analog to digital from the Arduino. The analog input returns a value between 0 and 1023 which is corresponding the 0V to 5V. So, voltage (VRL) = analog value / 1024 x 5V.

The second part needs a bit more calculation...

The Rs and the RL in the circuit are a voltage divider. The concept of a voltage divider is by putting two resistors is series. The VRL measured on the Arduino analog pin is the final voltage coming from the voltage divider (usually called Vout). We also know the Vin (5V).

Vout = Vin * (R2 / (R1 + R2))

Where:

  • Vout = VRL
  • Vin = 5V
  • R2 = RL
  • R1 = Rs

We try to find Rs (so, R1)... The first line is the formula of a voltage divider to know the Vout (not easy reading in GitHub...)

Vout = Vin * (R2 / (R1 + R2))
Vout / Vin = R2 / (R1 + R2)
Vin / Vout = (R1 + R2) / R2
(Vin * R2) / Vout = (R1 + R2)
((Vin * R2) - R2) / Vout = R1
R1 = ((Vin * R2) - R2) / Vout
R1 = ((Vin / Vout) - 1) * R2

So... Rs = ((5V / VRL) - 1) * RL

4° R0 can vary, of course. According to some readings on the internet, the calibration process should be done every 3 months but I don't have specific experience on this. Calibration should be in clean fresh air, you should not do it at every sample.

5° No articles published (it was already a long time ago and not about this discipline ;-) ).

from arduino-mq131-driver.

marinajg avatar marinajg commented on June 24, 2024

Hi Oliver, again, thank you veeeery much for doing this! I wish you the best!

The last one!

Could you have chosen "any" resistance instead of 5.1kOhm, since the Hfe ranges from 100 to 630? (respecting the 40mA Arduino limit and knowing that the sensor needs 150mA)

I understand that the current is not relevant as the voltage for the heater...

Thanks!!!

from arduino-mq131-driver.

ostaquet avatar ostaquet commented on June 24, 2024

Hi Marina,

You can choose any resistor to control the transistor. I'm used to use the 5.1kOhms to pilot my NPN. The goal is to saturate the transistor. The voltage on the heater is key, that's why I recommend using a MOSFET.

KR

from arduino-mq131-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.