Connect the Sensor Boards

sensors_breadboard.mics5524.mq3.sample.medres.jpg
Breadboard with gas sensors powered by 4 NiMH batteries + sample on cotton bud.

Soldering

The MiCS-5524 board comes with some header pins which need attaching by soldering for use on a breadboard. The pins are best inserted into the breadboard before soldering to ensure they are located properly. The board should be positioned at ninety degrees to the pins during soldering. See Adafruit MPRLS Ported Pressure Breakout for a similar soldering example.

Power Supply

The sensor boards are designed for use with a 5V supply. The CPX board has a VOUT pad which for USB powering is connected to the USB 5V line. This looks ideal but the heaters on gas sensors draw more current than logic circuits and this complicates powering the sensors as it can lead to voltage drops. As an example, the CPX VOUT (rated at maximum 500mA) connected to a desktop computer measures:

  • Desktop USB = 4.93V
  • CPX VOUT  = 4.79V (unloaded)
  • CPX VOUT = 4.58V (loaded with two sensors at 134mA)

A voltage 8% below the recommended 5.0V will also reduce the current. Power is the product of voltage and current and is therefore reduced by more, in this case by 15.4%. The heater's resistance will change a little with power variation due to change in temperature making an accurate calculation a little more complicated.

A decrease in voltage would normally decrease the voltage from a potential divider based output proportionally. However, in this case the lower temperature from the heater appears to have a greater effect and observably increases the analogue output in clean air at 4.6V supply voltage.

The power options are:

  • USB / CPX VOUT - easy to use, limited to 500mA, likely to suffer from considerable voltage drop and will struggle with more high current sensors like MQ ones.
  • Switch-mode power supply - cheap ones may add considerable high frequency noise which could add noise to analogue input (including via ground line).
  • Linear power supply - noise (ripple) will be low frequency and easy to compensate for. 
  • Batteries - very low noise but voltage will decrease a little as batteries discharge.

For more detail, see Power Supplies.

Connecting everything

The connectivity is fairly simple. The breadboard needs 5V power, the two gas sensor modules have an analogue output which benefits from being reduced to keep it below the CPX 3.3V maximum input. This can be achieved with a potential divider. For both these gas sensor boards, this is already implemented on-board with a "load resistor" (Rl). This on-board resistor can be supplemented with an external resistor connected to ground which is effectively in parallel and will reduce the effective resistance.

  • MiCS-5524 - add 10k resistor from analogue output to ground.
  • MQ-3 - add 1k resistor from analogue output to ground. Two 470 ohm resistors in series or two 2k2 resistors in parallel would be appropriate substitutes if a 1k is not available.
cpx-breadboard-gas-sensors-battery-nomosfet_bb.png
Circuit Playground Express connected to MiCS-5524 and MQ-3 boards. If four batteries are used they MUST be rechargeable to produce correct voltage.
If four batteries are used then they MUST be rechargeable (NiMH) ones to produce 5V rather than 6V produced by non-rechargeable batteries.

For gas testing a fully-charged set of four NiMH AA batteries was used in a battery pack. The battery pack's connector was adapted for breadboard use with two header pins.

The breadboard used was a slight variant with a break in the power lines half way along - the diagram shows two wires connecting this break which can provide a convenient place to measure the current. These wires would be redundant on the more typical 830 breadboard.

The MQ sensor boards often differ particularly with pin ordering - always check pin labels.

Enable line

The astute reader will spot an extra component in the photo not present in the diagram. An IRLB8721 (MOSFET) transistor has been added to allow the power to be controlled for the MQ-3. The implementation creates an enable line to allow the sensor to be turned on and off by a logic signal and is intended for further investigation of MQ sensors.

This is similar to the Adafruit MiCS-5524 breakout board although that differs in having a NOT enable line - this is indicated by the line above the En - the board is enabled when the pin is connected to ground (or left disconnected).

This guide was first published on Oct 28, 2018. It was last updated on Oct 28, 2018. This page (Connect the Sensor Boards) was last updated on Jul 17, 2019.