MM Defender Controller

From PalOMoney
Revision as of 05:42, 14 July 2013 by Dev (talk | contribs)
Jump to navigation Jump to search

The Mosquito Magnet Defender Controller is a small PCB assembly that controls the Mosquito Magnet Defender 1/2 acre corded trap. This model is explained elsewhere on the web. This topic discusses what it is and how it works, but based only on observation of the PCB, its components, and signals, as of the revision date.

Accordingly, this information is quite incomplete, is likely to be wrong in many aspects, and is intended to be revised by the community. Check back from time to time to see any updates. Interested parties are encouraged to register and edit and these pages or create new ones.

For some background, see the Mosquito Magnet Project.

Schematic Revision 1

The schematic is titled: Defender Controller Circuit Board Assembly Plus External Assemblies MMDefender PCB ExtAssy Schem r2.png

Readers are encouraged to fill in missing information or correct any errors.

MMDefender PCB ExtAssy Schem r1.png

Revision 2 corrects inaccurate timings and voltage annotations, pin and net T0CKI was TOckl, and the pin numbers on J1/P201 were reversed (pin 1 is the square pad)

Circuit Description

The heart of the system is the MicroChip PIC16C58B 18 pin SOIC micro-controller (uC) chip. This inexpensive, low end chip is one-time-programmable (OTP), and its firmware was programmed at the factory.

Along with the controller PCB, the Defender uses 6 other assemblies: an AC power connector, a power switch and LED indicator, a propane valve solenoid, an igniter, a fan, and a thermistor. These assemblies consist of the named component plus lead wires and female connectors that connect to mating connectors on the PCB.

The PCB contains 2 rectifiers to rectify the incoming 20 volt pp AC low voltage power source, supplied by an external transformer and a long low voltage cord. High current rectifier D2 powers the ignitor circuit directly, without any filter capacitors. The resulting full wave rectified AC waveform reduces the effective voltage somewhat for the 12 volt ignitor. D1, the lower current bridge rectifier, powers the internal rails (power supplies). U2 implements a regulated +12v supply to power the fan, propane solenoid, and the +5 volt power supply. It could also be (but isn't) used as the Vpp programming voltage. U3 implements the +5v supply.

The front panel switch does not switch the power, but rather simply goes to the uC RA0 input. R1 and C1 form an RC network to support the PIC internal RC clock circuit. The components result in a nominal 3 mHz clock frequency. An unknown and unused input on unpopulated J4 is connected to RA3.

The uC's main outputs drive the fan, ignitor, and the solenoid, in that order. Each external device is driven by a transistor, which in turn is driven by the associated uC output pins RB1, RB0, and RB2. These pins are actuated in a programmed sequence to power the associated devices.

The uC is powered from +5v, and will shut down if the power supply drops too low, which occurs when the trap loses power. Otherwise, the uC gets its information from the thermistor assembly, which measures the temperature in the combustion chamber after the catalytic converter. The idea is that the temperature should not be too low, or too high. If these conditions are not met, the uC shuts the propane valve, runs the fan for a few minutes, and blinks the LED to indicate a fault.

The thermistor is configured with 4 resistors (R4, R5, R6, and R9) and 1 capacitor C4 to form a dynamic charging and timing circuit that measures the temperature. This circuit is used to measure a wide range of temperatures without using an A/D converter or comparator, inputs common on other controller chips but not on this low-end device.

The uC T0CKI input is intended for use of an external clock with arbitrary (slow) rise times. The input has a Schmitt trigger to implement a ~3.5v comparator with hysteresis. C4 is alternatively (1 each per second) charged via R5 (20k), and then via TH201 (200k thermistor) in parallel with R6 (162k).

RB5 goes high when the switch LED first goes out, powering R5 (20k) to fast charge C4 in about 2.5ms to about 3.6v, which triggers T0CKI and ends the charge. RB6 & RB4 go high when the LED goes on. TH201 (200k @ 25C thermistor) slow charges C4 in about 14 ms at room temperature. As the temperature rises, the thermistor resistance decreases and charges C4 more quickly. With thermistor TH201 disconnected or open, 162k charges C4 in about 23 ms. The uC sets all pulses low when T0CKI is triggered. The ratio of fast to slow charge times gives the approximate temperature measure. When hot, the "slow" pulse decreases to <1ms. The LED flashes error at >6ms during run.

Micro Controller Functions

All in all, this is a fairly clever circuit that uses one thermistor as a sensor to detect every fault.

  • If the propane runs out or the gas valve solenoid fails, the combustion will cease, the thermistor temperature will fall, and the unit will shut off.
  • If the fan completely fails, the combustion will cease for lack of oxygen.
  • If the fan partially fails, the uC will fault for too high combustion chamber temperature (just speculation here). (After some documentation with a running system, the combustion temperature rises to reduce the "slow" pulse to 0.8 ms or 800 us. It might be that this measurement is a lower limit, and that the unit cannot reliably measure hotter temperatures, unless it gets even more clever with the additional resistors and pulse outputs).
  • If the power fails momentarily, then the solenoid will release and the valve will close, and the uC will reset when power is restored.
  • When the power is restored, the unit will try to restart if the switch is in the Run position.
    • First, the uC resets then slowly flashes (1/sec) the LED signaling the start state, and cools the system to derive the baseline thermistor resistance. The unit runs the fan for 2:55 (just under 3 minutes) to do this.
    • The uC activates the ignitor for 5 seconds and tests something (but what?).
      • It doesn't seem likely that the thermistor can react in this short time period, but it might because the unit can move to fault status after only 5 seconds of ignition.
    • The uC pulse width modulates the fan signal to 1/4 (10ms/40ms), which reduces the fan speed, and actuates the valve solenoid to apply propane to the combustion chamber and igniter.
    • After about 15 seconds, the uC returns the fan to full speed.
    • After a few (?) minutes, the uC observes normal operating temperature, drives the LED solid ON signaling the run state.
    • If there is a fault detected, the uC drives the LED with a fast flashing signal (error state), and turns off the fan after another 3 (?) minutes.

Commentary

The Mosquito Magnet is great at controlling mosquitoes when it works, but too hard to fix when it doesn't. Evidently, there was not enough program memory available to be able to display blink error codes that could be read by users and interpreted in a user's guide or online forum. Instead, the support system worked off a canned script that included purging the system with expensive CO2 cartridges, then doing this and that before recommending sending the unit back for repair at great time and expense. Of course, most users will have to rely on outside service to keep their unit running.

It is not just a matter of being self-reliant or just plain cheap. During the time the trap is not catching as many mosquitoes as are flying around, they are biting and reproducing. Two to three weeks out of service in the beginning or middle of the season adds up to many bites.

Replace Your Nozzle

It is too easy to skip the expensive periodic maintenance using those too expensive CO2 cartridges. Their expense, plus the incorrect instructions that say to let the cartridge discharge for 15 seconds, when it is very clearly gone in one brief *whoosh*, add up to users just skipping that step until they notice problems starting the unit, at which time they will try (at the instructions of telephone support) several cartridges, resulting in a trap that now barely runs, and perhaps is much less effective catching mosquitoes than would be if the maintenance were done periodically.

In this case, replacing the nozzle with a new one in the combustion chamber resulted in the old trap catching hundreds and hundreds of mosquitoes each day, like when it was new. The $5 nozzle and $3 tube of high temperature gasket sealer are insignificant compared to the ordinary operating and maintenance costs of running the trap. It is cheaper than using the CO2 cartridges, although it is a pain to separate the combustion chamber halves.

Stop when Moving?

It is frequently advisable to move the trap from one location to another as the daily catch drops off. The manufacturer directs that when this is done, the trap must be properly shut down and restarted. However, it is possible to move the Defender gently from one location to another with the power on. You must move it nearly *every day* to avoid a dead spot on the lawn. Just don't bump it around, and set it down gently. You can free up the cord, then carry the tank in one hand and head in another, dragging the cord into place, the rearrange the cord to suit.

Can anyone explain exactly what bad thing could happen if you move or bump a Defender or other Mosquito Magnet when it is running?

What Went Wrong Last Time (June 2013)?

During this documentation project, the controller board suddenly started working. It didn't work after cleaning and thoroughly drying the board. It didn't work after repeatedly removing and reinserting the various connectors. It did work after a few more days inside and then replacing the thermistor into the cavity using a new screw (broken when removing the thermistor assembly for inspection much earlier in this process). Also, 'scope probe ground clips were attached to the 1000uF power supply filter cap, bending the cap a bit. The leads from the caps previously had been noted to contain traces of rust looking material (rust?) on the PCB underside, however, probing the supply voltages at that time indicated no excessive ripple as might be expected from a disconnected power supply filter capacitor. The last occurrence was manipulation of the thermistor assembly wires when connecting and disconnecting the thermistor to measure the resulting timing pulse widths under different circumstances. But the pulse widths did not change during this fiddling except as expected. Because the unexpected return to functionality has not been explained, the system is now classified intermittent, now working. Amazingly, the new nozzle plus cleaning plus 2 weeks of inactivity has resulted in a very large catch over the few days it has been running. Since this is starting to resemble Voodoo electronics, my faith is now in new nozzles is growing.

What Went Wrong This Time (July 7, 2013)?

After running like new for a propane tankful and catching more than 3000 mosquitoes, the unit ran out of propane. No operator was checking the unit, and then it rained. When the tank was replaced, the trap did not start. Subsequent efforts to start the trap failed. The "intermittent" had struck, this time as a hard failure.

After some troubleshooting, the thermistor circuit did not measure the same as previously documented. The thermistor pulse could never charge C4 high enough. The cause was a spurious fluctuating 100 kOhm resistance to ground. The cause was apparently residual flux under C4 conducting whenever the humidity was not very low (as would be when hot operating, or after being left out to bake in the sun for a day or so). The cap was unsoldered, the PCB cleaned, and the spurious resistance eliminated. After re-installation, the circuit performed normally, and was documented (below) with a propane source. For a blow by blow description, see MM Defender 2013_07_07

High impedance circuits cannot tolerate leakage currents on the circuit board. These are caused by contamination and typically aggravated by moisture. When unsoldering components and cleaning the circuit board with isopropyl alcohol, a very thin conformal coating was observed. This coating initially presented as a very glossy finish, similar to an untreated PCB. The alcohol attacked the coating, and moderate brushing removes it. Because this coating was present from date of manufacture until this investigation, the contamination must have been present during the manufacturing process. The coating was perhaps too thin in a spot to protect the contamination from moisture. This circuit needs conformal coating to protect against contamination in the field, so we expect the unit to eventually fail again in the future, and will clean then apply the coating at that time.

The contamination under C4


Timing and Thermistor Circuit Pulse Widths

-30 secs plug in AC power
0 switch on 13.5 ms -- room temperature
2:57 low speed solenoid on
3:10 first change 13ms
4:02 8 ms
4:40 5.5 ms
5:00 2.4 ms
7:00 0.8 ms
7:50 Turn gas off
9:56 1.0 ms
11:06 2.4 ms == to short pulse
12:00 4.0 ms
12:45 flashing Led 6.0 ms
13:26 8.0 ms
14:06 10 ms
14:55 12 ms


Upgrading

Although the PIC16C58B firmware is unknown, it is unlikely that the designers would have provided for field updating the firmware, because that would require ample additional unused and unprogrammed program space memory, and would require an in-circuit programmer access to the Vpp, ICSPD, and ICSPD pins. There is no connector for these pins, and Vpp is permanently wired to +5v (Vdd), so the pin can never be raised to the programming voltage (without desoldering it from the PCB and inserting a 1k or so resistor in series to isolate the pin from +5v).

The PIC16C58B is a one time programming (OTP) micro-controller, which is an obstacle to experimentation and optimization. Replacing the chip could open the door to a wifi interface and more. Any project to upgrade this unit will requiring replacing the factory PIC16C58B with a more capable chip, which fortunately could occupy the same footprint, plus installing a programming connector, isolating Vpp from +5v (via 1k), and making the pin available for application of the programming voltage, all of this via a new 5 or 6 pin mini connector.

By adding some additional wires and traces, the controller could measure the signals to or current in the solenoid, ignitor, or fan. The fan extra lead could be monitored and analyzed to check the fan speed.

Suggested LED Blink Error Codes

For now, just some LED blink error codes might help. What might they be? Because the only sensor is the thermistor, only a few error codes can be defined.

  • Keep the existing slow blink for starting and the solid LED for running.
    • Temperature unaffected by propane would indicate that actuation of the propane valve caused no temperature change. Perhaps the propane is out.
    • No Temperature rise after ignitor might mean that the heat from the ignitor was not detected after a few seconds (but more than 5), and a failed ignitor circuit.
    • Temperature decrease by propane might indicate that the ignitor is not working but the propane was flowing, cooling the thermistor. Ignitor failed.
    • Insufficient temperature increase after propane might indicate the nozzle is clogged or airflow obstructed.
    • Excessive temperature would indicate that the trap got too hot. Fan failure or clog?


More on this topic later.