Microchip Technology

user Occupation hasn't been added


  • PIC16F18345 Internet of Things (IoT) Sensor Badge

  • Created: Nov 21, 2016

    • view92
    • comment0
    • bookmark0
    • fork0


No description available.


The Internet of Things (IoT) is a system in which everyday objects have network connectivity that allows them to communicate with each other. The number of connected applications is growing rapidly, along with the need to handle multiple functions and reduce power consumption. Offering an array of Core Independent Peripherals (CIPs), Microchip's 8-bit PIC microcontroller, PIC16F18345, provides the capabilities to handle multiple functions without the core for low-power consumption. The PIC16F18345 operates in 32MHz speed. It has 14KB program memory, 256B EEPROM, and 1KB RAM. The PIC16F18345 features 17 channel 10-bit ADC, 5-bit DAC, two comparators, two 10-bit PWMs, complementary waveform generator, EUSART, two (I2C/SPI), etc.

This reference design shows the schematic diagram of PIC16F18345 Internet of Things (IoT) Sensor Badge. This badge demonstrates how the PIC16F18345 handles multiple tasks and communicates to another device. The PIC16F18345 interfaces with a MCP9701 temperature sensor, BMA222E accelerometer, WS2812B RGB LED, PS1240P02CT3 audio piezo transducer, and RN4020 Bluetooth module. The MCP9701 temperature sensor provides an analog output that the PIC16F18345 internal ADC measures through its RA6 pin, while the BMA222E accelerometer communicates with the PIC16F18345 through I2C interface. The WS2812B RGB LEDs are cascaded so that the PIC16F18345 can control them with a single pin (RC3) by data serialization. The PIC16F18345 controls the PS1240P02CT3 audio piezo transducer through its internal complementary waveform generator. The RN4020 Bluetooth module, which enables the PIC16F18345 to communicate with other devices, communicates with the microcontroller through serial communication. A single AAA battery powers the whole circuit. The MCP16252 switching regulator boosts efficiently the AAA battery voltage to 3.3V to meet the voltage supply requirement of the whole circuit.

The badge operates in four modes. In first mode, PIC16F18345 is used with 3-axis accelerometer and RGB LEDs. The RGB LEDs light up based on the accelerometer data. The LEDs on the axis with the most measure force will light up. The center LEDs turns off when the badge is tilted beyond 45 degrees. In second mode, PIC16F18345 is used with RGB LEDs. The RGB LEDs will light up based on a predetermined pattern with color dimming. In third mode, PIC16F18345 is used with 3-axis accelerometer, RGB LEDs, and audio piezo transducer. The audio piezo transducer and LEDs are driven based on the magnitude of the force sensed by the accelerometer. The higher the force, the higher the pitch of sound and the longer the LEDs light up. In the fourth and the last mode, PIC16F18345 is used with 3-axis accelerometer, RGB LEDs and audio piezo transducer. Following a double tap on the badge, the audio piezo transducer sounds and the LEDs light up in a pattern. A smartphone or tablet, through an application, can connect to the RN4020 bluetooth module to view real time tilt angle of the badge, view real time status of each RGB LED, view real time temperature data, change operation mode of badge, and check battery voltage.