Comments: Hazardous Gas Monitor
Looking for answers to technical questions?
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
If you've found an issue with this tutorial content, please send us your feedback!
Can someone tell me where D6 goes? In the code D6 is defined as CORelayPin, but nowhere on the Fritzing does it show anything connected to D6. Should the yellow wire that is currently connected to 3V3 in the Fritzing be connected to D6 instead?
This question came up the other day. The 3V3 pin should not be connected to D6. You should not use an IO pin to turn on/off the relay. Microcontroller pins may not have enough power to drive the relay and there is a possibility of destroying the pin depending on the specs of the relay that you are using. In this case, the relay needs more power than the Particle Photon's I/O pins can provide to toggle the switch so it is connected 3V3 pin and MOSFET.
While the code defines D6 as the
CORelayPin
and D7 asCOVoltPin
, JENFOXBOT did not use D6. Looking at the logic and pin D7, the code seems to be written as we expect it to from JENFOXBOT's explanation in the tutorial. When the CO gas sensor's heater needs to be in the 5V phase (turnHeaterHigh()
),COVoltPin
is low so the relay is off and stays on the NC pin. When the heater needs to be in the ~1.5V phase, (turnHeaterLow()
),COVoltPin
is high so the relay is on and switches to the NO pin.Thus, the lines of code that use
CORelayPin
on D6 can be ignored or commented out. Here's an example with them commented out. There are four instances where it is used.I adjusted the Fritzing diagram a little in this tutorial and included a few notes to make it more clear.
Currently wondering the same thing. Trying to adapt this for an Arduino set up currently.
Is that a diode between the two pins of the relay? If so, what kind? IN4004? I didn't see any mention of a diode in the list of components.
I think there may be some discrepancies between the description of the circuit for the MQ-7 sensor and its Fritzing representation. Could somebody more competent than me please check them? For example, the Fritzing diagram shows that a potentiometer pin should be connected to the voltage regulator output, while the description doesn't mention it at all... Which one is to be followed?
If I understand the described intention... They are both wrong.
I believe steps 7 & 8 have a typo and should be A1 not H1 to get 5V. Then H1 should be tied to the COM on the relay.
I'll update the tutorial, but that being said... this tutorial is 3 years old and Phant is no longer in service due to operational costs and maintenance.
Thank you very much, I have corrected my circuit according to the updated tutorial, but something doesn't seem to work yet. It probably is because I'm using the same 3.7v LiPo battery for every power line; however, I can't change that in my project. How could I get it to work? The original tutorial does mention the possibility of swapping the AAs with some LIBs, but doesn't really go further than that...
Using a 3.7V LiPo on the gas sensor circuit won't work because of the voltage regulators. They are 5V regulators, which regulate higher voltages down to 5V and can't be used to step lower voltages up to 5V. That is why the tutorial uses 2 different power sources.
There are a few options like a booster circuit, tying 2 LiPos in series to create 7.4V, etc. However, it would all be dependent on your setup. For more assistance, please post a new topic on our forums.
For additional resources on power check out the following tutorials:
Hi, I am doing a similar project to this and I was wondering if you had to calibrate your gas sensors before hand? Thanks!
Hi, in the code COVoltPin is defined as D7. Who is connected to D7? Thanks.
Hello! Hope you were able to figure this out! If not (and for other folks who may have the same question), the D7 pin is connected to the relay ground that controls the power to the CO (MQ7) sensor. In the schematic, it's the orange wire going to the MOSFET. Hope that helps!