Evolution of a Blog

This blog has evolved as I have as a maker. It starts at the beginning of my journey where I began to re-tread my tires in the useful lore of micro electronics and the open-source software that can drive them. While building solutions around micro-electronics are still an occasional topic my more recent focus has been on the 3D Printing side of making.

Tuesday, July 15, 2014

Heat and Gas Monitor / Switch

This device was originally designed to monitor a 3D printer for temperature or gas (e.g. smoke) above a certain threshold at which point the printer would be powered down.   The circuit consists of an Arduino Nano connected to a temperature sensor and a gas sensor.   Two LEDs and a buzzer provide feedback.  The circuit drives a relay that can close the PS_ON circuit of an ATX type power supply (or a relay that is part of the power supply circuit for the printer).

There are two different boards with one being 50x50mm that would have the relay mounted off the board as shown in the picture to the right.   The two sensors are also mounted off the board as is the buzzer (upper right of photo).

The other board configuration is 50x100mm and has room for the relay on the PCB.  The relay could be part of a power supply circuit (DC or even AC) but the PCB is really designed to be part of an PS_ON circuit of an ATX power supply as it has an bypass switch that can be used to close that circuit.

Both of the boards are available in a kit form as there are a wide variety of ways that they could be mounted and as many ways to connect the board to sensors.

The PCB also has a connection point for the serial port of the Arduino for diagnostic information output by the sketch that drives the monitor.

As stated above, the monitor was designed for a 3D Printer but it could be used to monitor just about anything for heat and gas where a relay needs to be triggered.  I used the MQ-2 sensor looking for smoke but other MQ sensors could be used for other gas types.

Below is a documentation index for the Heat and Gas Monitor / Switch PCB:

Part 1 - Introduction
Part 2 - Hardware Configuration Options
Part 3 - Operation
Part 4 - Software Configuration
Part 5 - Assembly

Monday, July 14, 2014

3D Printer (RepRap) Monitor - Part 5 - Assembly

Choosing the Right Board

The larger board allows for a relay to be mounted on the board itself.   This is the configuration that works best for a power supply, such as an ATX, that has a "PS_ON" (or switch on) circuit.   The larger board could also be used for a single relay, of sufficient amperage, that provides power via a single bus.   However, DO NOT wire the "PS_ON" connection on the PCB to anything but a PS_ON circuit!

Choosing the Mounting Location

Two examples of mounting are shown here though others are certainly possible.  The major question will be one of where the two sensors need to be located relative to where the PCB can be mounted.   If the PCB can be mounted where the sensors need to be located then the sensors can be surface mounted on the PCB.   If not then leads will be required to connect the sensors to the PCB.   Likewise the monitors LEDs, reset, and bypass switch can all be surface mounted on the PCB or run remotely depending on placement of the PCB.

Surface Mount or Headers

Two strips of breakable headers can be used to provide mounts for most of the components and connection points on the PCB.   This can allow for easy removal of the Arduino Nano as one example. 

Extensibility

There are solder points on the PCB that expose a number of available pins (including power) on the Arduino Nano.   These could be used for a variety of purposes such as connecting additional sensors and/or relays. 

Assembly

Actual assembly is straightforward.   Either solder the components (or leads) to the board in the places marked or solder on the appropriate headers!  Header strips can be easy broken into the proper lengths using a small wire cutter positioned on top of the pin where a cut needs to be made.  A pin is lost with each cut.  Edges can be sanded to make a smooth end to the header.

Polarity and/or Pin Positioning

The short lead on the LED is the ground.   The PCB shows how the Nano should be mounted as it does for all of the components and connections.  The reset button should be mounted as shown by the picture to the right.

The larger PCB provides a place where a relay can be mounted.   Small cable ties are provided for this purpose.   The larger PCB also allows for a bypass switch that mechanically closes the "PS_ON" circuit assuming that circuit is connected to the PCB.   Do NOT connect anything but a PS_ON circuit to the PCB.

Documentation Index

Below is a documentation index for the Heat and Gas Monitor / Switch PCB:

Part 1 - Introduction
Part 2 - Hardware Configuration Options
Part 3 - Operation
Part 4 - Software Configuration
Part 5 - Assembly


Wednesday, July 9, 2014

3D Printer (RepRap) Monitor - Part 4 - SW Configuration

At the top of the RepRapMonitor sketch there are a number of constants that need to be set for your environment.   They are as follows: 

  • WARMUP_DELAY - Delay in seconds for warmup of gas sensor (default is 60)
  • TEMP_ERRORS - Number of consecutive temperature errors we tolerate (default is 5)
  • TRIGGER_TEMP - Temperature at which we trigger the printer off (default is 40)
  • WARNING_TEMP - Temperature at which we start flashing a warning (default is 35)
  • TRIGGER_GAS - Gas threshold at which we trigger the printer off (default is 750)
  • WARNING_GAS - Gas threshold at which we start flashing a warning (default is 650)
  • STDDEV_GAS - Gas readings StdDev that justifies a sensor error (default is 10)
  • STDDEV_GAS_CHECK - Number of readings for above test (default is 30)
  • DELAY - Time between observations (default is 1000)

The temperature and gas trigger thresholds are the most critical of these settings.   While the sketch is running diagnostic messages will be written to the serial port.   These can be viewed using the Arduino IDE console or by connecting a terminal to the serial port on the RepRapMonitor PCB.  View this stream when setting your thresholds.

Software for the monitor is available on GitHub.

Monday, July 7, 2014

3D Printer (RepRap) Monitor - Part 3 - Operation

The two indicator LEDs provide feedback in regards to the operational status of the RepRap Monitor.

The gas sensor requires a warmup period.   When the monitor is first powered up, or reset, it will first flash a series of fast red / green LED, then alternating red / green LED flashes each second of the warmup period, and finally, somewhat faster alternating red / green LED flashes each second of the gas sensor check.

When the monitor is running normally the green LED will be on and solid.   If the monitor is running in standby the green LED will be flashing three times at 100ms every second.
    If the monitor has detected an error the green LED will be extinguished and the red LED will flash for 200ms from 1 to 4 times every second with the frequency indicating the nature of the problem encountered:
    • 1 time = Gas threshold exceeded
    • 2 times = Gas sensor error
    • 3 times = Temperature threshold exceeded
    • 4 times = Temp sensor error
    Note that if the printer has been shut down the alarm buzzer will sound continuously.

    If the monitor needs to indicate a warning state then the red LED will flash at 100ms either two or four times every second with two indicating a gas warning and four indicating a temperature warning.   In either case the green LED will still be lit.  During a warning situation the alarm buzzer will sound with pulses every second, two in the case of a gas warning, and four in the case of a temperature warning.

    The gas and temperature levels for errors and warnings are coded as constants within the sketch that drives the RepRap Monitor.  It is the responsibility of the user to set those constants as they vary for every environment!   The source code for the monitor is available here.

    Note that the serial port is accessible on the PCB and can be used to monitor status in detail.   Power is also made available which allows connection of a bluetooth serial adapter.

    Software for the monitor is available on GitHub.

    More in Part IV