Bluetooth Wireless Voltage Meter using PIC12F683 microcontroller

Bluetooth Wireless Voltage Meter using Wiimote + Pic Chip + AutoIt

In this tutorial I’m going to be showing you how you can send voltage values to your pc using a Pic chip, Wiimote, and Autoit3 scripting language. The process works by wiring a pic chip to the button pads of a wiimote. Then using the pic chips Analog to Digital Converter, we obtain a 10bit binary value. We will then send that value to Autoit in the form of button presses using the wiimote as a data interface.  On the PC side we will use a library I wrote to receive the data from the wiimote. The library is basically just a port to Wiiuse by Michael Laforest set up in a way to make scripting with the wiimote very easy.

Analog to Digital Converter

Most pic chips are equiped with multiple Analog to Digital channels. This lets us monitor multiple voltages values if we want to. The total amount of channels sampled will depend on different factors like how many channels the chip has. Channels are sampled one at a time so the more voltages you monitor, the less samples per second you get.

How the Analog to Digital Converter works
The pic chip A/D Converter works by comparing the voltage you’re measuring to a known voltage. In our case the known voltage is the voltage supply 5v. The 10bit value measured is a ratio of the pic chips known voltage 10bit value. So for example a sample thats 10bit value is 387, the voltage value would be V = (5v/1024) * 387    which equals 1.89v

Step 1

Experience, Tools and Parts Needed

Experience:
• Basic understanding of electronics. (Ohms law for example..)
• How to use a bread board and voltage meter.
• How to solder.
• A little knowledge of pic chips will help, but is not really required since all the pic chip code for the examples is already written.

Tools:
• Voltmeter
• Triwing Screwdriver for wimote. ($2 on ebay)
• Soldering Iron, solder
• Breadboard and Jumper wires
• Pic Chip Programmer (Im using the “Enhanced PICKit 2”)
• PC with Bluetooth

Parts: ($20 + $1 + $1 + $5 + $7) = $34
• Wiimote –  note that while generic wiimotes will work, a genuine wiimote has best compatibility.     (< $20)
• Transistors 2N3904 or any General Purpose NPN  Qt: 11  ($1)
• Resistor values 470K (390K to 560K will work):  Qt: 11  ($1)
• Pic Chips (any of these will work since I have included multiple examples)
– PIC12F683-I/P or PIC12F675-I/P – 2 examples    ($1.25)x2
– PIC16F616-I/P  –  – 2 examples –    ($1.10)x2
– shipping for all 4 pic chips   ($7)
• 5v supply for the Pic Chip

Step 2

Software

Download and install the following software: (click links to download)

• AutoIt3

• Scite4AutoIt3

• HI-TECH C Compiler for PIC10/12/16 MCUs (Free Lite Version. Registration is required)
• Wiimote ADC.zip (Note: The html link is just an easy way for me to share, update, and track downloads. Open the .html file and a download dialog will display.)

The Wiimote_ADC.zip contains the following:
• WiimoteMT.au3 – Autoit Library used for communicating with the wiimote.
• Wii Pair.exe –  used to pair the wiimote to your pc.
• ScitePIC Startup.exe – A custom standalone Scite Editor that I set up just for working with the pic chips. It has options to compile and program the pic chip for you. I will get into how to use those options later.
• 6 AutoIt script examples along with the Pic chip code that goes with each example.
• 4 Pic chip Hi-Tech C example programs. (2 supporting 12F683 and 12F675, 2 supporting 16f616.

Step 3

Pairing the Wiimote

To pair the wiimote to your pc you have two choices. You can either do a temporary pair, or you can do a permanent authenticated pair. The difference between temporary and permanent pairing is that if you power off, or disconnect  the wiimote from your pc and the wiimote is not authenticated, the next time you want to connect you will have to do the pairing procedure again. If it is authenticated, your pc will remember the wiimote, and the wiimote will remember your pc. Needless to say i recommend doing a permanent pair.

Permanent Pair:
-Launch Wii Pair.exe (located in Wiimote_ADC.zip)
-Press the sync button on the wiimote located under the battery cover. The leds on wiimote will begin flashing.
-Press Easy Pair button.
– When the wiimote has been successfully paired you will see the address of your wiimote in the list and Connected, Remembered and Authenticated will all say true. Once it has verified that the wiimote is authenticated it will launch a wiimote example.
– NOTE: IF at any time during the pairing process the wiimotes leds stop flashing, PRESS THE SYNC BUTTON AGAIN.

Temporary Pair:
-Go into your bluetooth panel and select “add a new device”. Press the sync button. When it asks you about the pairing code, select the option to pair without using a code.

For more detail: Bluetooth Wireless Voltage Meter using PIC12F683 microcontroller

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation and engineering. My writing style is clear and simple, and I am skilled in using infographics and diagrams. I am a great researcher and am able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter