I connected a mq-135, an dht-11 and an lcd to my mega 2560, but it seems that the value measured from the MQ-135 is very voltage dependent: when i connect it via usb the voltage on the 5V is only 4.6 to 4.8V , and the measurement is all wrong (to high), but when i connect an extra power supply to the power in, it get to 4.9x volt and the measurement is good.
Is there any way of correcting this error?
I already tried to use aref (connected to the 5V) but it seems not to improve?
I am using the code from this site to measure the ppm of co2: hackaday CO2
USB should be 5V +/- 5%, or 4.75V to 5.25.V
Are you getting a lot of voltage drop across the green/gold PTC resettable fuse next to the USB connector?
Maybe go a little lower on the reference voltage then, like 4.25V.
CrossRoads:
USB should be 5V +/- 5%, or 4.75V to 5.25.V
Are you getting a lot of voltage drop across the green/gold PTC resettable fuse next to the USB connector?
Maybe go a little lower on the reference voltage then, like 4.25V.
I am getting 4.75V before and 4.65 after the fuse. I'll look into your suggestion tommorrow, thanks!
promy:
when i connect it via usb the voltage on the 5V is only 4.6 to 4.8V , and the measurement is all wrong
Datasheet states 5volt for the heater, +/- 0.1volt.
promy:
I already tried to use aref (connected to the 5V) but it seems not to improve?
?
Aref is by default already connected to the MCU supply (5volt/USB for a Mega).
You could change the load resistor into a voltage divider, and use/enable the stable 1.1volt Aref in your code.
That would take care of A/D instability, but not heater instability.
Don't know how much influence this has on the measured value.
Leo..