author
1Instructables41,833Views127CommentsKyiv, UkraineJoined January 28th, 2017
I love cyberpunk and work as an electronics engineer, not much to add here

Achievements

100+ Comments Earned a bronze medal
10K+ Views Earned a bronze medal
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor10 days ago
    Arduino CO Monitor Using MQ-7 Sensor

    Hmm. these sensors really have high variation in resistance of sensitive coil - but it looks a bit too much (one with low readings implies sensing resistance of ~40k instead of 10k, one with high readings implies sensing resistance of ~3k instead of nominal 10k). Still not impossible, especially if sensors are from different manufacturers.Have you added capacitors C1 and C2? From your data it looks like in modified_modul file you are missing C2: values are very noisy.As for CO measurements - in the second case (sensor_with_pcb_only), data look +- fine, so you can replace R3 with something like 30k and then calibrate the sensor (fill sensor_reading_clean_air variable at line 95 with your actual reading and fill reference_resistor_kOhm variable with actual R3 value in kOhms)

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor12 days ago
    Arduino CO Monitor Using MQ-7 Sensor

    *actually, if you modified my code - please upload your project here. I'm heavily using hardware timers, if you added library that uses them too, then that might be the answer ))

    What powers Nano? Is that source good enough? If you are powering it via USB from a PC port, it might not be able to send more than 100 mA (due to usb configuration specifics - depending on exact Nano model that might or might not be the case). You can check that by powering it via USB that is connected to some phone charger.*if you are powering Nano with some kind of 9V battery - then it's most likely the case, 9V ones normally can't output enough current.Also have you checked that base/emitter/collector of transistor are connected in the right way? You never can rely on how a package looks, always need to check datasheet for this exact part.If all of it is not the case - and if you are storing not calculated CO values but raw analog output from the sensor - then I need to see a longer...

    see more »

    What powers Nano? Is that source good enough? If you are powering it via USB from a PC port, it might not be able to send more than 100 mA (due to usb configuration specifics - depending on exact Nano model that might or might not be the case). You can check that by powering it via USB that is connected to some phone charger.*if you are powering Nano with some kind of 9V battery - then it's most likely the case, 9V ones normally can't output enough current.Also have you checked that base/emitter/collector of transistor are connected in the right way? You never can rely on how a package looks, always need to check datasheet for this exact part.If all of it is not the case - and if you are storing not calculated CO values but raw analog output from the sensor - then I need to see a longer sample, maybe I'll have a guess what else could be wrong here

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor17 days ago
    Arduino CO Monitor Using MQ-7 Sensor

    80mA might be ok, it varies a lot from sensor to sensor. But it's worth checking if you are powering it properly - what power source you are using?As for your chart - not sure how you got it, if it is CO value from my program then probably something vent wrong ))

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor3 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    I'm not 100% sure but it's very likely that mq-135 would require the same procedure of heating-cooling cycles and taking sample at the end of cooling cycle

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor7 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    They shouldn't be reversed logically, but I can't guarantee it without re-assembling the board :) The most reliable way to tell is to check how it reacts to high CO concentration

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor7 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    This looks like red and green leds are mixed. Please put lighter next to the sensor so CO level will rise - if you'll see red led turning off and green one lighting up, then that's it - change places of red and green ones :)

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor7 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    I'm so sorry for your loss! It's terrible! I actually want to create a wearable sensor one day, but still hadn't found a low power option for CO measurement.When you put lighter, readings will update at the end of measuring cycle - so if you put it in the middle of heating phase, you will see the result only in about 2 minutes. If you will put lighter during heating phase, and then will remove it still during heating phase - sensor won't see it at all (heating phase clears sensor surface).But if you put lighter soon before measuring cycle ends, and won't see any result - then something is definitely wrong.Burn cycle is required only once in a lifetime for a sensor (maybe once again if it wasn't used for years, but definitely not days).Sensor without cap and resistor removed will produce...

    see more »

    I'm so sorry for your loss! It's terrible! I actually want to create a wearable sensor one day, but still hadn't found a low power option for CO measurement.When you put lighter, readings will update at the end of measuring cycle - so if you put it in the middle of heating phase, you will see the result only in about 2 minutes. If you will put lighter during heating phase, and then will remove it still during heating phase - sensor won't see it at all (heating phase clears sensor surface).But if you put lighter soon before measuring cycle ends, and won't see any result - then something is definitely wrong.Burn cycle is required only once in a lifetime for a sensor (maybe once again if it wasn't used for years, but definitely not days).Sensor without cap and resistor removed will produce wrong results, although there is a way around it with a neat trick in the code - but I hadn't thought about it when created this project, and so hadn't implemented (also, it isn't clear if it will work well with BJT transistors, it could be that it will give accurate results only with mosfets).Also, for accurate measurements, correction by humidity and temperature must be introduced (humidity/temperature change can move zero point very significantly, for 50-100 ppm, so without them sensor is good only for quite high concentrations, but might not detect less dangerous ones) - I started this work and even made a dedicated PCB for it, but never really completed. Maybe I will soon

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor7 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    The value won't change anymore. Put current value as clean air value in the code

    Great that you figured that out! :)720 measuring, ~200 heating looks very good, I'm almost sure you have everything right now

    Clean air value of 970 is completely wrong if you have correct load resistor. Since before you had reasonable PPM value, it almost surely means that you had correct schematics before. On my photo there is a relatively rare transistor package which has base pin not in the center.In any case, you can't use neither photo nor breadboard diagram as a reference: base, collector and emitter are not marked there, and for different transistor models they will be placed in different places. You need to look at schematics and make sure you connect base, collector and emitter to the correct points - and you can find function of each pin of your transistor by looking at its datasheet.

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor7 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Blue pot doesn't have any effect if you made modification described in step 2.But you need to measure and write in the code clean air value after 10 hours run: each sensor is different, value in the code works only for my particular unit. When you will put it there, in clean air it should reliably produce 0-5 ppm. Without that adjustment, 38 ppm looks completely normal.Thanks :)

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor8 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Thanks :)These resistor and capacitor are connected from AO to sensor's GND pin. The problem is, in this setup sensor's GND is not connected to the schematic's ground, but to transistor which controls heating coil using PWM (the main problem of the module is that heating coil is connected in parallel with measurement sensor - and modification breaks this connection). Resistor would prevent getting any reasonable readings when PWM is on, and capacitor would introduce PWM-induced noise, so both have to go. Recently MakerMaik proposed alternative approach in comments that will work without modifying the module - to turn off PWM and open transistor during (short) measurement phase - but I hadn't thought of this during initial development. Also this would work reliably only with MOSET transi...

    see more »

    Thanks :)These resistor and capacitor are connected from AO to sensor's GND pin. The problem is, in this setup sensor's GND is not connected to the schematic's ground, but to transistor which controls heating coil using PWM (the main problem of the module is that heating coil is connected in parallel with measurement sensor - and modification breaks this connection). Resistor would prevent getting any reasonable readings when PWM is on, and capacitor would introduce PWM-induced noise, so both have to go. Recently MakerMaik proposed alternative approach in comments that will work without modifying the module - to turn off PWM and open transistor during (short) measurement phase - but I hadn't thought of this during initial development. Also this would work reliably only with MOSET transistor (because BJT, which I used in this case, will introduce generally unknown voltage shift).R3 forms voltage divider with sensing element - because sensor is a resistor, which resistance depends on CO concentration. Yes, technically it is a load resistor - but I don't like term "load" when resistor has higher resistance than sensing element, it may lead to a wrong idea about the sensor behavior.C2 is used to stabilize readings, and is connected to Vcc because at the moment I thought that Vcc might be a bit more stable than GND on a breadboard (since we switch transistor on GND side, not on Vcc side). Although this might be not true depending on particular wiring approach and I believe it won't make any real difference if C2 is connected between AO and GND. But without C2 at all, readings are significantly worse - I showed oscilloscope output with and without it in step 3.

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor9 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    I see - but you put there wrong formulas. Columns B and C don't make any sense, *0.001 and *0.9999 are parts of the filter, they are used to average over tens of thousands of readings - you can't put them into excel sheet and expect any result.Arduino code measures thousands of values per second, each with significant random noise, and this approach allows to get rather precise result by averaging them

    Have you changed clean air value in the code to your real data?3V in clean air is a correct value, depending on sensor, for given resistor it could be between 2 and 3.5 V.Also, how do you increase CO concentration to test the system?You can send your data to my mail aka.3d6@gmail.com

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor9 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    What data you are getting? Have you performed 10-hours running before calibration? Without it, value drifts a lot, often to a complete nonsense.1. yes, 0-1023, it is value from Arduino's analogRead.2. if you will send your raw data, I can make a guess what is wrong

    Wow, great visualization!Converting from mV into ppm is relatively simple using charts from the datasheet, but is never precise without direct calibration

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor10 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    The board is good btw, although I prefer smaller PCBs with separate MCUs for quite a while already, but here size is not a problem I think. I've made a version with atmega328 and connector for dht11, but when it came from board house I didn't liked it - it's just not useful like this, need at least to add some radio, or switch MCU to nRF51 altogether

    Hi! It's a good experiment, but concentration is a bit too high to get useful data. If you burned charcoal well, then CO concentration was in 10-15k ppm range - so after 20:500 dilution it is in 600+ ppm. No wonder you won't see huge difference between single and double, triple concentrations - all of them are in saturated area of this sensor. I don't think it's possible to precisely estimate concentrations in this area without humidity measurements, and also I'm not sure if this is area of high interest - if you have any control over situation, you want to do something when CO hits 100 ppm already (because at 1000 it might be too late).The most interesting is whether it's possible to measure something like 30-50 ppm at various humidity

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    On the output, raw value is ADC reading - so it's not resistance, but middle point of voltage divider where one side is sensor, other is 10k. Actually it's a great idea to transform this reading into resistance itself and plot graphs, will do.But in order to move further with analysis I need rated samples for different humidity (it would be perfect to get verified ones, but relative where we have x1, x2, x4 concentrations without knowing absolute value would also do) - that's what stopped me all this time :)NN is a very simple and rather predictable method (if it is a small MLP and you know what you are doing :) ), that's the only reason why I want to use it - just might be faster and more reliable. Even though I would prefer exact model of physical processes going there, for now I'm no...

    see more »

    On the output, raw value is ADC reading - so it's not resistance, but middle point of voltage divider where one side is sensor, other is 10k. Actually it's a great idea to transform this reading into resistance itself and plot graphs, will do.But in order to move further with analysis I need rated samples for different humidity (it would be perfect to get verified ones, but relative where we have x1, x2, x4 concentrations without knowing absolute value would also do) - that's what stopped me all this time :)NN is a very simple and rather predictable method (if it is a small MLP and you know what you are doing :) ), that's the only reason why I want to use it - just might be faster and more reliable. Even though I would prefer exact model of physical processes going there, for now I'm not understanding all details deep enough

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Thanks for the data!Can't agree with this formula though. I've attached a sample from your data, with levels adjusted so initial value is zero in both cases. As you can see, in high CO case, we get exponential decrease (slow enough for it to look like linear), while in low CO case we see slow increase. From physical point of view, both cases must have asymptotic behavior - resistance can't get to zero or infinity - and I believe its position depends on all conditions.I actually can't explain physics of high CO case, why resistance decreases when more CO is absorbed. Has it something to do with temperature of maximum sensitivity? Like during cooling, at seconds 5-15 sensor bonds with more CO than would be its equilibrium state at temperature which is reached later? But if that is the cas...

    see more »

    Thanks for the data!Can't agree with this formula though. I've attached a sample from your data, with levels adjusted so initial value is zero in both cases. As you can see, in high CO case, we get exponential decrease (slow enough for it to look like linear), while in low CO case we see slow increase. From physical point of view, both cases must have asymptotic behavior - resistance can't get to zero or infinity - and I believe its position depends on all conditions.I actually can't explain physics of high CO case, why resistance decreases when more CO is absorbed. Has it something to do with temperature of maximum sensitivity? Like during cooling, at seconds 5-15 sensor bonds with more CO than would be its equilibrium state at temperature which is reached later? But if that is the case, why we see the opposite in low CO? Is it because there are so few CO molecules that we need much longer time to reach equilibrium state?In any case, this is not exp * linear. Neural network is just a simple way to deal with function without analyzing it directly :) For a good function I would gladly write some fitting algorithm - but it's necessary to understand the role of each parameter of such function to interpret the result

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Great experiment, thanks! It's very interesting that absolute values of sensor readings are affected by humidity really a lot, but shape of the curve remains very similar. Can you send the data too? Plain difference between beginning and end of 90s period works, but I believe much better result can be obtained by analyzing first 30-40 seconds, I still think neural network could be the best solution here (although that requires confirmation).If you have time/inspiration to make more quantitative CO samples (like I did, using syringe and putting in 5, 10, 20, 40 cc of high-CO sample into a known sensor's air volume), for several humidity levels - then I can promise that I will make NN-based part and share its code really soon :) I wanted to make such set of measurements myself for quite a...

    see more »

    Great experiment, thanks! It's very interesting that absolute values of sensor readings are affected by humidity really a lot, but shape of the curve remains very similar. Can you send the data too? Plain difference between beginning and end of 90s period works, but I believe much better result can be obtained by analyzing first 30-40 seconds, I still think neural network could be the best solution here (although that requires confirmation).If you have time/inspiration to make more quantitative CO samples (like I did, using syringe and putting in 5, 10, 20, 40 cc of high-CO sample into a known sensor's air volume), for several humidity levels - then I can promise that I will make NN-based part and share its code really soon :) I wanted to make such set of measurements myself for quite a while already, but just can't find enough time and will for it

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Interesting! Intuitively I would expect that DHT22 is sensitive only to very high CO concentrations (500+ ppm) - can you confirm whether it's true? Overall, by analyzing dynamics it could be possible to estimate concentration quite well even if humidity and temperature are unknown - I saw indications of it in my experiments, but never really studied it well. If you can record a set of data in different conditions, I would be happy to analyze them and we can publish the result :)

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    They wanted to make a digital output that switches at given CO concentration but failed to do so, because haven't followed sensor datasheet

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Resistance is correct, but your values are not good. In clean air you should get something around 600-700 if schematics works. Value of 987 could be caused by non-working transistor - please triple check if you connected it right.

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Hi! DO connection is left unused, that's right.90uF are fine, as for polarity - caps that have polarity have some markings on their case, if you are not sure you can try to google by how it looks.You should see raw data output in serial monitor. Also, after you'll run your sensor for ~10 hours, you'll need to write this raw value in .ino sketch to calibrate the sensor (each sensor is a bit different, so program doesn't know what is "zero" before you fill it - this code works for my particular sensor).

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    Hi! Excellent point about modification, really we can just turn on 100% to get value, haven't thought of that! Will use it for sure.But can't agree with reading at 90s only - in this case we lose signal dynamics, which tells a lot about actual concentration. It's possible to detect high CO level much earlier than in 90 seconds, and it's possible to estimate low level more precise looking at the whole curve. I wasn't using it in this instructable, but these data are generally useful. It's not complicated to adjust program so PWM cycle is stopped each second for 5...10 ms to get sample at that moment. - great idea about 60+10+10... cycles, really can make it fully independent this way. Will use it too, thanks :) - yeah, I even made a 2nd version with DHT11 and its own PCB, but still haven...

    see more »

    Hi! Excellent point about modification, really we can just turn on 100% to get value, haven't thought of that! Will use it for sure.But can't agree with reading at 90s only - in this case we lose signal dynamics, which tells a lot about actual concentration. It's possible to detect high CO level much earlier than in 90 seconds, and it's possible to estimate low level more precise looking at the whole curve. I wasn't using it in this instructable, but these data are generally useful. It's not complicated to adjust program so PWM cycle is stopped each second for 5...10 ms to get sample at that moment. - great idea about 60+10+10... cycles, really can make it fully independent this way. Will use it too, thanks :) - yeah, I even made a 2nd version with DHT11 and its own PCB, but still haven't run full experiment with it, but I will one day )) - as for raw values, that's for sure, I just hope that relative change of resistance is more or less consistent across different sensors (so with proper initial value adjusted in the code, result will be fine). But I haven't checked, if it's not true, then I see no way to get accurate readings without full calibration of each particular one

    What is your sensor resistance (between AO and Vin) when it is completely disconnected from the board? Another person wrote me recently with the same problem, and it appears that particular sensor had completely wrong resistance, it could be the case here too (maybe they changed production line and new sensors just have different default value? Or they just randomly produce wrong ones? I have no idea)Also, have you filled correct clean air value in the code? Even though with such readings you won't get useful data, it would be closer to real level then....on Fritzing that connection really does nothing, I just forgot it ))

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    I have no idea, for my particular sensors it seems +-10 ppm precise for low concentrations (haven't tested much past 100 ppm), but I tested only with 2 units bought at the same time - who knows, maybe for different ones from different production lines it will be much worse

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor11 months ago
    Arduino CO Monitor Using MQ-7 Sensor

    You can try - noise will be higher, but it still will work. If you are looking for higher precision, then it's better to get 10 uF.

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    I'm not sure - never worked with them - but probably they are

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    Yes, but you must connect its ground to Arduino's ground

    With 2560, hardware timer pins probably are not the same - so it won't work as intended without some modifications. Need to check atmega2560 datasheet to see whether timer code will work, and which pins will be affected

    transistors can't have 4 logical pins (they might have 4th thermal pad, but logically transistor by definition has 3 pins - one where charge goes into it, one where charge goes out of it, and one which controls whether charge will flow or it's blocked)

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    The simplest way to produce a sample of CO is to cover an ordinary candle with a glass jar. Inside the jar flame will consume significant part of oxygen and will produce some CO. It's hard to say how much exactly, but probably it will be inside 3000...10000 ppm range. If you produce it in a jar with volume less than 1 liter, then even if it's opened in a small room, concentration won't get anywhere close to a dangerous level

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    I don't see any way to use it for battery powered device while following manufacturer's datasheet.It might be used in a different mode, with heating turned completely off most of the time. In this case we can monitor its resistance, and detect increase in CO concentration when it drops too fast. But in this scenario sensor surface will be covered with other substances over time, so probably no static threshold can be used at all, and once in a while you'll need to run 60-second heating cycle to clean the sensor.Experiments are required to determine how often this is actually needed, if it will be enough to heat it for 60 seconds once in several hours, then it can be used with batteries. Measurement precision will be much worse in this mode, but probably still good enough to detect 50 pp...

    see more »

    I don't see any way to use it for battery powered device while following manufacturer's datasheet.It might be used in a different mode, with heating turned completely off most of the time. In this case we can monitor its resistance, and detect increase in CO concentration when it drops too fast. But in this scenario sensor surface will be covered with other substances over time, so probably no static threshold can be used at all, and once in a while you'll need to run 60-second heating cycle to clean the sensor.Experiments are required to determine how often this is actually needed, if it will be enough to heat it for 60 seconds once in several hours, then it can be used with batteries. Measurement precision will be much worse in this mode, but probably still good enough to detect 50 ppm. Any application of such sensor in this mode requires extensive experiments with multiple units (performed better than ones in manufacturer's datasheet)

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    Everything is correct: sensor signal isn't stable when we turn heat down, it stabilizes only at the end of the low heat cycle. So program makes decision about CO concentration a few seconds before turning on heating. Therefore, when placed in high-CO environment, you will see alarm approximately at the beginning of the next heating cycle.For really high CO concentration decision can be made much faster (just a few seconds into cooling phase), but my program is optimized for scenario when concentration is changing slowly.Pins 10 and 9 depend on timer channels - arduino timers often have 2 separate channels, they share the same counter and all settings, but have different threshold values (so you can make 2 PWM signals using a single timer). In order to switch between pin 9 and pin 10 in ...

    see more »

    Everything is correct: sensor signal isn't stable when we turn heat down, it stabilizes only at the end of the low heat cycle. So program makes decision about CO concentration a few seconds before turning on heating. Therefore, when placed in high-CO environment, you will see alarm approximately at the beginning of the next heating cycle.For really high CO concentration decision can be made much faster (just a few seconds into cooling phase), but my program is optimized for scenario when concentration is changing slowly.Pins 10 and 9 depend on timer channels - arduino timers often have 2 separate channels, they share the same counter and all settings, but have different threshold values (so you can make 2 PWM signals using a single timer). In order to switch between pin 9 and pin 10 in my program, in all places where function setTimer2PWM is called, you need to switch first and second parameters (now first is 0, second is some value, so one channel of this timer isn't used).

    It depends mostly on 2 parameters: reference resistor (10k in my schematics, but you can use different value) and sensor's manufacturing process - they are supposed to have the same clean air resistance, but I believe it actually varies quite significantly

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    ...and also you need to add modification into code lines 212-216:pinMode(5, OUTPUT);pinMode(6, OUTPUT);pinMode(3, OUTPUT);pinMode(9, OUTPUT);pinMode(10, OUTPUT); - change pins numbers to new ones

    Yes, pin 3, controlled by timer2 - everything else is optional. AnalogWrite according to this page: https://www.arduino.cc/en/Reference/AnalogWrite produces PWM at 490Hz. This is very low frequency, power-related noise at such frequency won't be filtered by capacitors and, therefore, will distort readings. With direct timer setting, PWM frequency is 62.5KHz - more than 100 times higher - so capacitor filters it quite well

    In order to make it work with the same pins, all timers code must be rewritten. Here are timer pins: https://playground.arduino.cc/Main/TimerPWMCheatsh... My code simply writes values into timer control registers (with names like TCCR1A), I got values from atmega328p datasheet (like pages 131-135 for TImer 1, it's easy to find them when you are looking for timer register description).Timers are devices that are independent from microcontroller core, in this case I'm using them to generate PWM signals. Timer has cycle length which is defined in control registers (in this program it's 255), and threshold. When counter is below threshold, corresponding pin is low, when it's above threshold, corresponding pin is high. Counter is increased automatically with configurable rate.PWM, in turn, i...

    see more »

    In order to make it work with the same pins, all timers code must be rewritten. Here are timer pins: https://playground.arduino.cc/Main/TimerPWMCheatsh... My code simply writes values into timer control registers (with names like TCCR1A), I got values from atmega328p datasheet (like pages 131-135 for TImer 1, it's easy to find them when you are looking for timer register description).Timers are devices that are independent from microcontroller core, in this case I'm using them to generate PWM signals. Timer has cycle length which is defined in control registers (in this program it's 255), and threshold. When counter is below threshold, corresponding pin is low, when it's above threshold, corresponding pin is high. Counter is increased automatically with configurable rate.PWM, in turn, is needed for 3 different purposes:1. it controls heating coil, in order to provide low heat phase (according to MQ-7 datasheet, CO measurement must be performed not with heater turned off, but when it runs at lower power). This part is essential and PWM is the only reliable way to achieve it.2. it's used to change intensity of green and red LEDs. It's not really important, but gives more visual information about detected concentration.3. it's used to generate sound on piezo buzzer. Can be replaced with some kind of piezo generator that only requires power to produce sound.

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    Everything seems to be correct (assuming that you never connected "gnd" of MQ-7 board to Arduino's GND). Are you sure that your "D2" actually is connected to D3 pin of Arduino? Are you 100% sure that you put transistor in a correct way, not swapped emitter and collector? In which way you are providing power to all components?

    Are both collector and emitter connected to GND? I'm not sure if I recognized your labels correctly

    I'm sorry - I never really looked in Arduino Mega datasheet and assumed that it has the same pins as others arduinos, based on atmega328p processor. But it's not like this!Arduino Mega has different pins for timers 0, 1, 2. And since everything here is based on timers, pin connections must be different:pins 5, 6 must be changed to 13, 4;pin 3 must be changed to 9;pins 9, 10 must be changed to 12, 11.Please write if it will work - I can't confirm right now that my code will init/set timers for atmega2560 correctly, I briefly looked at datasheet and it seems ok, but I easily could have missed something

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    Because these modules are designed by people who are supposed to finish such PCBs within a couple of days (so their price stays really low). It's only natural that they have design mistakes

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    Link is at the end of chapter 5 of this instructable :)

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    Sure, arduino uno will work in exactly the same way. Most arduino models have the same chip in their core - atmega328p - so schematics and software will be 100% compatible

    View Instructable »
  • MIDI-Controlled 88 Key Reed Organ With MIDI-Over-Bluetooth

    Awesome work! It's a completely different level, one of the most complicated DIY projects I've ever seen - and I mean it, 88 keys fully reworked and calibrated so they work flawlessly, that's something!You can somewhat simplify electronics by using shift registers - 11 of them will be enough to control the whole range, in this case a single Arduino will handle everything. But that's a minor thing, not sure if it's worth working on it.

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    It seems you did everything correctly, maybe you just put red led on a place of a green one? Because if you'll switch red and green, it works like it should - normally blinks green, and when there is CO, blinks red.Is buzzer working when you put lighter there, or you haven't attached one?

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    That means that detected CO level is too high. This, in turn, could be caused by problem in calibration. Have you left it on for 10 hours before measuring calibration value? How you performed calibration?

    View Instructable »
  • the_3d6 commented on TanyaAkinora's instructable Elveet. Kinetic Charger Powerbank1 year ago
    Elveet. Kinetic Charger Powerbank

    I believe you have not measured this properly. If there really was present 300mA current, it would have destroyed NCP1402 which you used: your coils have copper resistance of more than 50 Ohms, so if you would get there 300mA, it would mean that at the very least 15 Volts of EMF were produced (that completely ignores all other parts of circuit and inductances, so more likely you'll need 25V to get 300mA through coils). NCP1402 absolute maximum input voltage is 6V.Since it survives your device operation, it can be safely assumed that your peak current doesn't normally get above 50mA.And even if it was going higher than 300mA for a few milliseconds, any decent capacitor would have reduced it greatly. Average current in this device will be in a few milliamps range. 10uF might be not suffic...

    see more »

    I believe you have not measured this properly. If there really was present 300mA current, it would have destroyed NCP1402 which you used: your coils have copper resistance of more than 50 Ohms, so if you would get there 300mA, it would mean that at the very least 15 Volts of EMF were produced (that completely ignores all other parts of circuit and inductances, so more likely you'll need 25V to get 300mA through coils). NCP1402 absolute maximum input voltage is 6V.Since it survives your device operation, it can be safely assumed that your peak current doesn't normally get above 50mA.And even if it was going higher than 300mA for a few milliseconds, any decent capacitor would have reduced it greatly. Average current in this device will be in a few milliamps range. 10uF might be not sufficient for that purpose, but 0.47F supercap would be more than enough.BQ25504 is much more efficient in converting power, so this is a good option.

    View Instructable »
  • the_3d6 commented on medinc's instructable Build This TinyLiDAR Arduino Radar1 year ago
    Build This TinyLiDAR Arduino Radar

    Thanks for the info! I was thinking of using two separate lenses (which is complicated in such a small footprint), but proper light insulation still is an issue in this case. Overall, I'm not sure if it is technically feasible, but I'll try

    Wow, VL53L0X seems to be a great part, thanks for sharing!Have you tried to put there some optics in order to increase operating range?

    View Instructable »
  • Multi Channel Analyzer for Gamma Spectroscopy With Arduino & Theremino

    Thanks for sharing! Never thought of it - such a simple and elegant way to determine radiation source! I have an old USSR-times scintillator laying around, that approach will make a great use of it :)What sensitivity can I expect from it? At how many Bq signal is strong enough to reliably determine source type?

    View Instructable »
  • Laser Microscope & Laser Diffraction

    Diffraction is a result of interference. In this particular case, diffraction pattern is caused by interference between two parts of beam, separated by string.

    This is the result of interference: wire effectively separates beam into 2 parts, which then produce interference pattern - like in experiment with two slits. For vertical wire, pattern would be horisontal, because it separates beam into left and right "slits"

    In this particular case, light pattern is caused by interference between two parts of beam, separated by string. Some may call it diffraction pattern, it isn't wrong, but underlying mechanism here is interference

    View Instructable »
  • the_3d6 commented on VitG's instructable Ukrainian Scissors1 year ago
    Ukrainian Scissors

    Great concept! But intuitively I would expect quite a lot of friction in sliders - is it really happening, or intuition here isn't working?

    View Instructable »
  • the_3d6 commented on bmrtin's instructable RF Meter for Multimeter1 year ago
    RF Meter for Multimeter

    Have you tried to add some amplifier before diodes? If done right, it should greatly improve sensitivity (in this setup, if I'm getting it right, when wave produces less than 300mV on antenna, it won't be detected at all), but I have zero experience in this field, so I have no idea whether it is doable

    View Instructable »
  • the_3d6 commented on HardiqV's instructable Amazing ARDUINO Killer1 year ago
    Amazing ARDUINO Killer

    Thanks for detailed instruction! We are using stm32 for a long time, but since Maple project has ended, I hadn't seen really cheap and convenient replacement. Seems like a great option for someone who needs more than arduino can provide

    View Instructable »
  • An Unusual Use of Alcohol to Extract DNA From Cells

    There surely will be some DNA in this mixture, but there will be much more other stuff, even what is broken by ethanol still is there, in a changed form. Any idea how to filter it?

    View Instructable »
  • Plotting-real-time-sound-sensor-data-from-Arduino-using-Python

    Nice! In your code on github, sample rate is one reading per second. How fast this approach can actually work? What is its speed limit?

    View Instructable »
  • Build an EMG Audio Amplifier! (Electromyography)

    With MIDI, you have to add ADC into schematics (with Arduino's internal adc results will be quite disappointing), and some kind of spectrum detection in processing code (FFT would work fine). Adruino can't really handle that, you need to use something like stm32, and that overall increases project complexity quite a lot. We went through this step some time ago though (https://www.youtube.com/watch?v=Q37SSbgYr_4) - but here I see the main point in keeping everything analog, without moving into digital processing, so it's much easier to replicate

    View Instructable »
  • Build an EMG Audio Amplifier! (Electromyography)

    Nice approach! But it should sound better if frequencies were multiplied a couple of times. Maybe there are some guitar processors which do that? It should be not too difficult to attach one

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    You are right. They are connected this way because in my schematics I started with unmodified module, and later realized that it can't be done without breaking connection on it - but capacitors were already there, and I never thought that it would be actually more logical to connect them to ground

    In the second step here we are breaking connection on the module, which turns it into clean MQ7 sensor plus reference resistor, totally ignoring all other parts on the module. So if you do similar operation with any other module utilizing the same sensor, it will work.If you will use different sensor, but one that also uses heating-cooling cycles and similar sensitive layer, I think it will work just fine (if you will calibrate it with 100 ppm sample).

    Only because I had one at hand, and didn't have any mosfets with gate voltage below 5V. Low voltage mosfet would definitely be better there

    View Instructable »
  • the_3d6 commented on the_3d6's instructable Arduino CO Monitor Using MQ-7 Sensor1 year ago
    Arduino CO Monitor Using MQ-7 Sensor

    Yes, I overlooked divider on A0, your cal14 and cal50 functions are fine.But your formula for Rs is still wrong: you have (5000 - Rf) term, 5000 are in mV, Rf is in kOhms, you can't do this.I also overlooked that you have Rs on the ground in your divider, not on the positive side, so let's write correct formula now: I = 5000 / (Rs + Rf) (current vs resistance at 5V)vin = I * Rs (voltage at divider relative to ground)Rs * 5000 / (Rs + Rf) = vin (put first two together)Rs = vin / 5000 * (Rs + Rf)Rs - Rs * vin / 5000) = Rf * vin / 5000Rs = Rf * (vin / 5000) / (1 - vin / 5000)Rs = Rf * vin / (5000 - vin)so that would be the correct one

    Your schematics is very good, it should produce much cleaner results than my version.But I didn't get some parts of your code, not sure if they are correct:#define Rf 9.5 //reference voltagewhy reference voltage is 9.5 when in schematics it seems to be 5? float Rs = (vin * Rf) / ( 5000 - Rf);here Rf is 9.5, presumably in volts? But 5000 is in millivolts, so (5000 - Rf) doesn't make sense.Maybe you've meant Rf to be reference resistance? Then formula should be different:Rs = Rf * 5000/vin - Rf, which is equivalent to Rs = Rf * (5000 - vin) / vinAlso, in cal14 and cal50 functions you are mapping voltage into 0-10000, not into 0-5000, so your actual heating voltage would be 2.5V, and measurement voltage would be 0.7V, it's best to fix it - but that's a minor problem. Calculations are what ...

    see more »

    Your schematics is very good, it should produce much cleaner results than my version.But I didn't get some parts of your code, not sure if they are correct:#define Rf 9.5 //reference voltagewhy reference voltage is 9.5 when in schematics it seems to be 5? float Rs = (vin * Rf) / ( 5000 - Rf);here Rf is 9.5, presumably in volts? But 5000 is in millivolts, so (5000 - Rf) doesn't make sense.Maybe you've meant Rf to be reference resistance? Then formula should be different:Rs = Rf * 5000/vin - Rf, which is equivalent to Rs = Rf * (5000 - vin) / vinAlso, in cal14 and cal50 functions you are mapping voltage into 0-10000, not into 0-5000, so your actual heating voltage would be 2.5V, and measurement voltage would be 0.7V, it's best to fix it - but that's a minor problem. Calculations are what is really unclear there, and they seem to be wrong.

    View Instructable »
  • the_3d6 commented on ancienthart's instructable Advanced Hexagonal Mesh in Freecad1 year ago
    Advanced Hexagonal Mesh in Freecad

    Wow, thanks for sharing! Always wanted to get all parameters in one place - now I can!

    View Instructable »
  • More Activities