Microchip logo
  • All
  • Products
  • Documents
  • Applications Notes

PIC16F1788 Wireless DC/DC LED Driver (Proof of Concept)

Design Highlights:

  • DC/DC Buck/Boost Power Supply
  • ~80% Efficiency
  • 9-24V DC Input
  • 500mA Regulated Output
  • PIC16F1788 Controlled Topology
  • Core Independent Peripheral Integration
  • Programmable Switch Mode Controller (PSMC)
    • High Performance 16-bit PWM
  • 10/12-bit ADC
  • High Performance Comparators
  • 8-bit DAC
  • Opamps
  • Current Mode Control
  • Software PI Control
  • Variable Frequency: 400kHz – 700kHz
  • MCP1416 FET Driver
  • MCP16301 Voltage Regulator
  • Wireless Communications
  • MRF24J40MA MiWi™ Wireless Networking Protocol Module
  • Dimming Support
  • 0-10V Manual (PID) Control
  • MiWi™ Wireless Networking Protocol Radio Control

WiFi® to MiWi™ Wireless Lighting Topology

To create the lowest cost wireless solution, both WiFi and MiWi are implemented into an integrated network via a translation gateway. All the luminaires employ the low cost MiWi™ wireless networking protocol and communicate to the gateway to interface to the outside world via WiFi.

MiWi™ Development Environment is Microchip’s proprietary wireless solution which provides low cost development and reduced the time to market.

MiWi™ P2P – Simple Peer to Peer Star Network, light weight stack
MiWi™ PRO – Supports Mesh network topology, Up to 8000 nodes and 64 hops

The MiWi™ Development Environment is optimized for low-power, low data rate, cost sensitive applications. It also offers a smaller foot-print relative to the open standard based ZigBee® compliant protocol stack.

Theory of Operation

This LED driver proof of concept design is a peak current mode SEPIC power supply with MiWi Peer to Peer wireless control.

  1. When the voltage is high enough the PIC16F1788 initializes the PSMC, ADC, DAC, Op-Amps and comparators as shown in the system diagram.
  2. The SPI is setup to communicate with the selected MiWi radio. (MRF24J40; 2.4 GHz)
  3. MiWi radio is configured for operation. Required IEEE 802.15.4 storage variables are created, and then loaded with previous setup values when available. Otherwise the device uses supplied defaults.
  4. Peripheral Timer is configured to handle LED control. Timer 2 is used in this demo and is configured to generate interrupts for LED voltage level control.
  5. Peripheral Timer is configured for MiWi communication. Timer 0 is used in this demo MiWi communications.
  6. Required IEEE variables such as PANID, CHANNEL, ADDRESS, Etc. are saved to the PICs “Flash Program Memory” for non-volatile usage. This demo uses program flash memory for storage.
  7. MiWi protocol type is selected and configured for operation. This demonstration uses the Peer-to-Peer (P2P) protocol.
  8. After operation setup normal operation occurs. If the input voltage is too low then the LED is configured to be off.
  9. In addition a feedback loop is created at the LED output using a voltage divider supplied to the ADC to prevent over-voltage load. This prevents damage to hardware in case the LED becomes disconnected from the driver circuit.
  10. The demonstration hardware supplies the capability to do manual dimming (PID control) using the 0-10V input control. This voltage is divided into a usable voltage and supplied to the ADC, this new value for use by the DAC which is used by the PSMC for the LED driver. This feature is firmware dependent.
  11. Using the “MRF24J40 MA MiWi Wireless networking protocol module” LED brightness/dimming control is handled in firmware with values supplied by the “MiWi Wireless Networking Procol to Wi-Fi Gateway Demo Kit (DM182018)”.
  12. The supplied MiWi command/packet is handled within the firmware. Based on the information received the DAC output value is modified. The new DAC value effects the PID value for the PSMC which results in varying LED brightness levels.
  13. Default MiWi values are:
  • Protocol Used: MiWi P2P; Conforms to 802.15.4 IEEE standard
  • Channel: 12
  • PANID: 0x2222
  • Address: [8] Bytes. Device dependent.

Regulation Algorithms

The simplest regulation for this design is to use the +0 – 10 V manual (PID) control input. This has been designed to accommodate a simple potentiometer; value selection is dependent upon desired resolution. A voltage divider circuit breaks the voltage down into a usable range. In addition a diode is used to prevent voltage over +3.3 V protecting the PIC from damage.

Currently all LED regulation control is being done within firmware, based upon pre defined PID values suitable for a wide range of input power supply options. The MiWi-to-WiFi Gateway supplies the values for modification.

When dimming below 10% a cycle skipping algorithm may be required to minimize flicker while transferring the very low power levels into the LED's. An advanced algorithm can be created to also determine the input voltage being used to help improved PID value selection. This can correct flickering issues when working with different supplied voltages.

Contact your local sales representative to see a working demonstration of the Wireless DC/DC LED Driver.

For comments or suggestions on Microchip's Lighting Solutions - please email us at lighting@microchip.com

The WiFi® MRF Module connects to hundreds of PIC® microcontrollers via a 4-wire SPI interface and interrupt and is an ideal solution for lower-power, low data-rate Wi-Fi® sensor networks, home automation, building automation and consumer applications. The combination of the module and a PIC® MCU running the TCP/IP stack results in support for IEEE Standard 802.11 and IP services. This allows for the immediate implementation of a wireless web server.

Learn more about Microchip’s wireless solutions at www.microchip.com/wireless.