Fox flasher MkII update 7/2019

Fox Flasher MkII and several follow on articles described an animal deterrent based on a Chinese 8051 architecture microcontroller, the STC15F104E.

This is an update after several years operation outside, and some in service modifications to improve performance.

ff201Above is the original basic schematic.

Above is the revised schematic. One only high current LED driver is shown, use as many as needed. The battery charger / protection module is based on TP4056 and DW01 chips and modules sell on eBay for $1 or so.

A new prototype has been constructed to test the changes.

The changes include:

  • PT333-3C photo transistor instead of the LDR;
  • filter capacitor across the LDR or PT to reduce noise and improve immunity to RFI;
  • 2500mAh 18560 LiIon battery;
  • LiIon charger / battery protection module from eBay;
  • firmware improvements;
  • ISP port;
  • high current LED driver for 1W LEDs;
  • PV array housed inside a clear box.

PT333-3C photo transistor instead of the LDR

The LDRs failed over time going lower and lower in resistance, possibly from water ingress despite attempts to seal them.

The PT333-3C works in the same circuit, and is encapsulated in a water clear 5mm or 3mm LED package so it likely to be more waterproof.

With the 100kΩ resistor from 4V, this prototype comes on at about 40lx, just into civil twilight on a clear Winter day at Bowral. It is working for most of the dawn and dusk (twilight) to deter animals that prowl during that time of day.

Filter capacitor across the LDR or PT to reduce noise and improve immunity to RFI

Initially a 1µF MLCC cap was connected across the LDR to reduce noise, trials with 0.1µF have been successful and is now the recommended value.

LiIon charger / battery protection module from eBay

The battery charger / protection module is based on TP4056 and DW01 chips and modules sell on eBay for $1 or so.

Firmware improvements

Several firmware fixes and improvements were implemented. The recommended clock rate is reduced slightly to the default 11.0592MHz which changes timing slightly.

Changes also increased exploitation of power saving features of the MCU.

ISP port

An ISP port was installed on the latest prototype. It uses ordinary 2.54mm pitch header pins and jumpers to isolate the LED drivers from the output pins during ISP. (You don’t want the high current LEDs driven by ISP signals.)

High current LED driver for 1W LEDs

A high current driver is implemented using a BC327 PNP transistor, 1kΩ base resistor, and appropriate current limiting resistor in series with the LED. With a 10Ω series resistor, red LED current is 180mA on the prototype with 4V battery.

This continues to use the MCU in inverting mode, ie an output pin is pulled low to turn the LED on.

PV array housed inside a clear box

The cheap Chinese PV arrays have proved a continuing problem. The epoxy covering degrades in the weather, so a trial will be conducted where the PV array is protected by an acrylic box (which itself will degrade over time). This is the challenge of Chinese Quality!

The prototype is built on a large piece of Veroboard. Ordinary self adhesive PCB standoffs are used to secure the PV array to the Veroboard.

Above, a view of the PVA side of the board.

Above, the component side of the Veroboard.

Above, the FoxFlasher assembly inside a waterproof acrylic housing from the hardware store.

A small bracket made from hoop iron allows attachment to a post, and adjustment of the elevation angle.

Revised battery calculations

Current is voltage sensitive, but at 4V, power down current is around 0.05mA and operating current is 1.0mA + LED current.

For the configured cycle (53ms on, 2500ms off (avg)), and 200mA LED current, average LED current is 200*53/2500=4.24mA. For 12 hours of daylight, total consumption during 24h is around 12*4.24+12*1.0=63mAh giving a battery endurance of 2500/63=40days (ignoring self discharge). Battery capacity is reduced at temperatures below freezing.

The PV array used charges at up to 80mA, so one hour of full sun is sufficient to replace one day’s consumption.

Above is a screen shot of the EEPROM contents for this 4 channel prototype, exposing the data structure. The screenshot is from HHD Hex Editor Neo Ultimate using its structure viewer.

Above is the STC programming tool with recommended settings.

The hex files and example EEPROM binary files are available for download: FoxFlasher2.