Sunday, December 12, 2010

15 Minutes of Fame, Some Comics, and a pair of Headphones

'Morning everyone,

Just a quick update before I hit the books in preparation for my last week of exams.

Last week had it's trials and tribulations, but there certainly were highlights. I was down in the dumps after a less-than-stellar performance on a C programming final exam, but was soon back on cloud nine when a friend told me that my Bluetooth Thermometer project had been featured on Hack-a-Day. Very exciting!

Though it is not fairing nearly as well (yet), I created an Instructable that details the Arduino Bracket.

Though I have spent the majority of the weekend studying, I did manage to scrawl out a few new comics and post them here. As I was reviewing I came across a number of goofy little sketches and scribbles hiding amongst all the circuits and math notes. I went over them in black Sharpie, scanned them, and have posted them on my site for your enjoyment (or amusement). One quick look should make it blatantly obvious why I am in electronic engineering and not arts ;-).

Now - Some Electronics! Here are my current top electronics projects:

Project 1: ThermoPhones:
Like many people, I have the bad habit of turning the volume on my iPod down almost all the way and leaving the device running on a table so that it is good and dead the next time I want to listen to some tunes. The other night I was out for a walk and a plausible solution hit me - make the headphones heat-sensitive!

Figure 1.0: iPhone Headphones with Thermistor Epoxied

 It's not much, but it is a start. I wired the thermistor up to an Arduino for prototyping convenience, and was able to see a 10c difference between when the headphones were sitting on my desk and when they were in my ear. The idea is that when the microcontroller sees a temperature drop of, lets say 5c in less than one minute, it issues a "pause" command to the iPod. Since it is looking for a change in temperature, it shouldn't have too much trouble when the user goes outside, but this might require further investigation.

Ultimately, the controlling would be done by a tiny microcontroller such as a PIC10F200, and the entire thing should be able to leech enough power to operate from the iPhone/iPod. Hopefully I'll have a chance to get some work done on this project over the Christmas holidays.

Project 2: Auto Rear Window Defogger
Everyone knows that I hate all things manual, and that I consider something as trivial as pushing the button to turn on the rear window defogger in my car to be manual labor. It's not because I'm lazy, it's because the year is 2010. It really shouldn't be that difficult for the car to figure out if the window is frosty, and for it to take action if it is.

Figure 1.1: IR RX/TX pair on a Breadboard with an Arduino (and bracket!)

This project is also still in diapers, but really shouldn't be too difficult to get going. The basic idea is that it will bounce a beam of infrared light off the inside of the car window, and the amount of light received back by the phototransistor will change depending on how clear the window is. If the window is foggy/frosty, more light should be reflected, telling the microcontroller to turn the defogger on. Once the reflected light drops below a certain threshold, it means the window is clear, and defogger should be shut off.

The above circuit is just a rough draft, ultimately it will need some degree of filtering and other noise reduction measures, and of course a relay to control the actual heater. Once I get the voltage levels tweaked and the basic system operating I will port the code over to Hitech C and burn it onto a PIC microcontroller; most likely a PIC12F675. If all goes well the entire board should be less than 50mm x 50mm, which shouldn't be too noticeable in my back window.

That's all I've got for now - I don't know how much progress I'll make on either project this week, but over Christmas I should at least be able to get some of the code written and the hardware designed.

If I don't have a chance to post anything before then, Merry Christmas, Happy Haunakah, メリークリスマス, Joyeux Noel, Feliz Navidad, Geseënde Kersfees, Gun Tso Sun Tan'Gung Haw Sun,  and I'd like to extend the warm wishes to anyone I've missed :-).

Friday, November 26, 2010

Bluetooth Thermometer R3.0 - Up and Running

Happy Friday Everyone,

After another busy week at The OC it was time to kick back, relax, and do some hardware design. After several miserable lab periods spent debugging R2.0 hardware I discovered that for some reason the PIC16F628 was not willing to run off the 3.3V power supply on the board, even though the datasheet claims that supply voltages as low as 3.0V are fine.

Not wanting to waste any more time, I swapped the PIC16F628 out for the PIC12F675 used in the original design. It was such a substantial change that I ended up scrapping the old PCB file and starting from scratch, and after a quick three hours in Altium Designer I had my revised schematic and PCB layout.

Figure 1.0: A 3D Rendering of the New PCB

The design transferred perfectly to copper the first time, bringing the total fabrication time down to just over an hour. Right now I'm just waiting for the new Sure Bluetooth Module to arrive in the mail; in the mean time I have a few wires going from the PCB to a breadboard with the one lonely module I do have jammed into the side.

Figure 1.1: Completed PCB with Bluetooth Module on the Side

I spent a little more time hacking away at the firmware; unfortunately I won't be able to implement any of the configuration options I was hoping to due to the minute amount of memory in the PIC12F675.

That's all for now - With any luck I'll be able to post the firmware, schematics, gerbers, and PCB layout on my website. 

Saturday, November 20, 2010

Bluetooth Thermometer R2.0


It's been a fair while since I've posted anything - Things at school are starting to wind down (or up, depending on how you look at it) in preparation for the end of the semester, which is now a mere two weeks away.

The Bluetooth thermometer project I started a couple months back has recently been revived and will be making a cameo appearance as my final project for my Introduction to Electronics course. Since it is now a school project and I can actually justify investing time in it, I have decided to make quite a few changes, including a new microcontroller, a firmware overhaul, and finally a PCB.

Figure 1.0: R2.0 PCB Partially Populated

After playing Altium for four hours straight, I finally had a schematic and layout that I was happy with, and transferred it to copper. Top left is the ICSP port and the power connector sitting beside the PIC16F628 MCU. The power supply is in the top right, and in the bottom center you can see where the Bluetooth module will sit. At the moment there are wires carrying +3V3, GND, TX, and RX to a breadboard that has my old Bluetooth module in it. Once I know the layout is good I'll solder one of the new modules I've ordered straight onto the PCB, but at $15 a module that won't be happening until all the bugs are gone and the layout is finalized.

Unfortunately, things don't appear to be off to a great start: as things stand I can't even program the PIC. I'm not sure why, but the programmer isn't able to communicate with the board. I did manage to get it to work once, but that was it. Everything seems to check out okay, but I have a feeling there's a short hiding somewhere.

Schematics, Gerbers, Firmware, and the whole 8.226 meters will posted on my website:

Friday, November 5, 2010

Arduino Piano (No Floppy Drives Involved - I Promise!)

Sorry for the lack of updates - This past week was a busy one, with much time being spent with the ELEN Workgroup.

So - Circuits: This is a bit of an extension on a project for my Introduction to Electronics course. The original design was a simple, twelve-note Arduino-based polyphonic synthesizer that used an Altera FPGA demo board to MUX the inputs together into a four-bit number.

Along the bottom you can see a row of twelve SPDT momentary push button switches wired up as active-high inputs to the Freeduino board on the left. Switches one through six are wired up to the analog inputs; which can actually be used as digital inputs through the "digitalRead" command using the pin numbers 14-19. The remaining six switches are connected to digital inputs two through seven, with pins ten through thirteen constituting the "data bus" between the two Arduinos.

The Arduino on the left is running David's (my instructor) original synthesizer code. The software decodes the four-bit binary number it sees from the "keyboard" and plays the corresponding note through a DAC over the SPI bus. The pot dangling off the right side of the board is used to fine-tune the synthesizer pitch, and the speaker in the middle-right produces rich, high-fidelity audio comparable to the output of singing greeting cards and the score of most video games from the 1980s'.

I'm still hacking away at the firmware: I'm having trouble figuring out how to encode the number read from the keyboard as a binary number correctly. Perhaps it a solution will jump out at me tomorrow morning...

Oh - and one last thing:

"I ALWAYS have coffee when I watch radar. Everybody knows that!"

Friday, October 29, 2010

Arduino Floppy Drive Shield

Just when you thought it couldn't get any worse. Have you ever wanted to hook a 3.5" floppy drive up to an Arduino?


Well, I have...

Figure 1.0: Taking Something Horrible and Making It Worse

Don't worry - At the moment this is nothing more than a stupid picture and a hunk of protoboard jammed into the top of an unsuspecting Arduino. Implementing a floppy drive controller in software would be a bit of a challenge, however there is no reason it couldn't be done; though some(most) would argue it shouldn't.

For some reason floppy drives make me smile whenever I see them. I'm not sure whether it's their uselessly small data storage capacity or that satisfying "ka-chunck" sound when loading a diskette into a drive, but there's something there that you just can't get with USB flash drives.

Saturday, October 23, 2010

Up and Running (Sort of): SmartClock

Happy Saturday Everyone,

I spent this morning working on the SmartClock; however as it turns out there might be more to it than I originally thought. In case you've just tuned in, the idea was to outfit a standard clock radio with a miniature motion sensor (specifically a Panasonic NaPiOn sensor) and a PIC microcontroller to shut off the LED display whenever the room the clock was in was empty.

Figure 1: Prototype controller (center), Panasonic NaPiOn motion sensor (top left)

The four-pin connector is for the anodes of the LED display, the three-pin connector in the middle goes to the motion sensor, and the six-pin connector on the left side of the board is dual-purpose: when the board is in the radio it acts as a power supply input, and when it's on the bench it acts as a ICSP port for the PIC programmer. As I was wiring this up I was thinking to myself "There's no way in hell I can ever let anyone see this", but here it is - the worst rat's nest of wire wrap I've ever seen:

Figure 2: Ahhhh!!! (well, I guess it is October - It's a Halloween project)

The Rats' Nest
First off: Don't ever wire anything like. Ever. In the top left we have two ST Microelectronic D10F10 N-Channel MOSFETS that control the anodes of the clocks' LED display. They are driven by the Toshiba TLP191B photocoupler (beige) in the bottom-center. The PIC12F629 is on the left side of the board (on the top side), and in the top-right we have the LM1086-3.3 LDO regulator. 

The Verdict
The idea was that by switching off the LED display when the room was vacant it would be possible to save a considerable amount of power over the clocks' lifetime (ballpark figures are found in the original post). After wiring this thing up and plugging in the radio I was disappointed to find out that the radio's current draw actually increases by about 1mA when the display shuts off. As this defies logic I will have to look into this some more, however it is obvious that in it's current state we aren't achieving the goal of power savings. 

Room for Improvement
- Better firmware (slower clock speed, sleep timers, etc)
- Better hardware (more efficient power regulator, lower power PIC)
- Less wire wrap

Though the idea of starting with a working clock radio seemed like a good idea at the time; in retrospect it would have probably been a better idea to start from scratch and build an entire clock from the ground up with power conservation in mind. Since the clock I'm using probably wasn't designed to be overly power conservative there are likely unnecessary losses in the power supply and the rest of the circuity already present in the clock.

Tuesday, October 19, 2010

Arduino Isn't A Country...

A terrible thing happened today:

I was cooking up some spaghetti for dinner; nothing too special. I was pouring the pasta sauce onto the finished masterpiece when I happened to glace at the lid for the jar of pasta sauce sitting on the stove.

My first thought: "Huh - There's a map of Arduino on this stuff"


My second thought: "Wait! Arduino isn't a country! Italy is!"


My third thought: "I wonder if I can hook the Arduino up to the stove to cook spaghetti for me..."

Technology is good. Life is Wonderful. Everything is terrific.

Sunday, October 17, 2010

Bluetooth Thermometer - Update!

'Morning Everyone,

I finally invested the hour-and-a-half and threw together a version of the Bluetooth thermometer on a small (45mm x 45mm) proto-board. Believe it or not it worked first time, which is quite amazing when you consider how much wire-wrap is hidden on the bottom side of the board.

On top you can see the Sure Bluetooth module on it's adapter board. It is attached to the base board by way of a 2.54mm female header receptacle, so I can easily pop it out and use it for something else should the need arise. The TO-92 device sticking out the side is the DS1820 1-Wire thermometer. It is attached to angled header pins so it too can be removed and extended if needed.

Hiding under the Bluetooth module is the PIC, 8.000Mhz crystal, some loading caps for the crystal (22pF), and 4.7k pull-up resistors for the /MCLR and 1-Wire bus pins on the PIC12F675. I didn't include an ICSP port was included for a reason - The PIC needs +5V to be programmed, and since the Bluetooth module runs off +3.3V it would probably end up getting fried if accidentally left plugged in while the PIC was being programmed. On the bottom of the board is an LM1086-3.3V LDO regulator, rated at 1.5A it is comically over sized for this application, but it's all I had lying around in my big box of miscellaneous parts, so that's what I used.

The Future
- Adding configuration features to the firmware (boot menu / options)
- Reducing power consumption (lower clock speed / better power regulation)
- Solar power supply and super capacitor (maybe not with this Bluetooth module though)

I do have a National Semiconductor LMX9838 Bluetooth Serial Port Module kicking around that I am hoping to use in lieu of the Sure module for the next iteration of this project. This would not only save PCB space, but also allow better software control and power management.

That's all for now folks - If you're interested in the firmware or hardware send post a comment and I'll make a conscious effort to draft up some schematics and cut-and-paste the firmware into the blag.

Right now I'm off to Future Shop to pick up a clock radio...

Saturday, October 16, 2010

Every Milliwatt Counts...

While everyone else was out on the town getting hosed and having a grand old time I was hold-up in my apartment diddling around circuits - surprised? Anyway, for quite some time I've been toying with the idea of integrating a Panasonic NaPiOn PIR Motion Sensor into a radio alarm clock to blank the display when nobody is home.

Now I realize that using this particular sensor is a bit impractical at $40 a piece; I certainly wouldn't have one if I hadn't procured it in the midst of a dumpster-dive, but I do believe that the idea does have merit, as clock radios do actually suck up a fair bit of power needlessly.

Panasonic NaPiOn PIR Sensor with a PIC12F629 Microcontroller

The Circuit
The NaPiOn sensor runs off +3.3V and outputs a logical "1" whenever it senses motion. Since the output only stays high for a second or two, we need something to keep the display on for a useful amount of time, and to provide a little bit of hysteresis to prevent rapid cycling, which would be annoying. The cheapest, easiest, smallest way to do this is with a microcontroller.

Could you do this with discrete logic? Sure. Could you do this with discrete logic for $1.30 and fit it into one square centimeter of PCB space? Not a chance. The use of a microcontroller also gives us the ability to change any parameter we want (time on, time off, etc) with a few lines of code.

Some Numbers
When you consider that the sensor draws about 60uA in standby, and the PIC could probably be made to draw as little as 20uA if the firmware were optimized, it is plausible that the whole sensing circuit could end up drawing less than 200uA including the power supply.

Some rough, ball-park calculations:

13mA Per Segment * 7 Segments * 4 Digits = 364mA (13mA per diode is a rough guess)

200uA = 0.2mA (this one is right)

This would mean that you could theoretically save a fair bit of power (relatively speaking).

Take my clock radio as an example. It's a Sony Dream Machine, and it's power rating is 12W. When compared to your 4500W clothes dryer, 12W is not very much, however we have to remember that clock radios generally run twenty-four hours a day, 365.25 days a year. So in effect:

12W x 24h x 365.25 = 105.192kWh/Year

(12W = 0.012kW)

As you can see, 12W happening all the time really does add up to a substantial amount at the end of the year. When you consider that most homes have more than one clock radio, and that they are only being "looked at" maybe 2% of the time they're powered on for, the potential for savings over the lifetime of the appliance does exist.

Tomorrow morning I'm planning on hacking open a clock radio, patching this circuit and taking down some real numbers. Stay tuned...

Thursday, October 14, 2010

Proffessional Selling?

Every now and then you see something you just can't pass up; and this was such an example. While waiting for Math class today I noticed this poster tacked up on a bulletin board outside the classroom:

Now I don't know the first thing about marketing, however I do know the following:

- Professionals use spell-check
- Marketing involves getting a message across clearly
- Professionals also use grammar and punctuation

Whenever I happen to catch a gem like this one I can usually contain myself, however this time I just had to go too far. Here is a transcription of my text-message conversation with the "Proffessional" trying to sell their book:

Me: "Hello - Are you still selling the book?"

Them: "Proffessional selling?"

Me: "Oh - You're actually selling a book called "Professional Selling". Sorry, your poster was ambiguous..."

Them: "What book do you need?"

Me: "Oh I'm in electrical engineering; I just thought your poster was funny, especially because you spelled "Professional" wrong and didn't use any punctuation. Sorry..."

Them: "Lol okay. Thanks for dis'ing me anyways.? Maybe you should become an English teacher?"

Me: "Professionals use spell-check. Especially professionals that sell things..."

Them: "Jesus. Thanks for the heads up"

Me: "Oh no problem - Your poster made my day!"

Them: "Surprised you had the time of day to text me just to say that!"

Me: "Some things are worth making time for. Anyway - best of luck selling your book..."

Alright - I know I'm a bad person and a complete asshole, but sometime you just have to be!

We don't use typewriters anymore! Both my browser and my cell phone have spell-check; there is no excuse for misspelling things in this day and age. Since whoever created this poster probably didn't use a printing press to duplicate it, the lack of punctuation is absurd! You don't have to pay per character - go ahead a use a period or colon: I dare you!

Alright. I'm done now. That's my rant about spelling and punctuation. Not only does it make you look like an idiot, it's just downright "Unproffessional"...

Wednesday, October 13, 2010

Right-Angle Circuitry?

I just happened upon this site through a link on Randall Munroe's (XKCD) "blag" this morning and thought I would pass it along; it is quite fascinating:

Tuesday, October 12, 2010

DatAzul - Universal Bluetooth Datalogging Platform

Happy Thanksgiving Everyone!

After spending a fair bit of time on the Bluetooth thermometer and power meter projects it occurred to me how great it would be to have a universal Bluetooth data collection and logging platform that anyone could use quickly and with few or no modifications. Here is what I was thinking of:

- PIC or AVR-based
- 3-10 Channels of A2D with programmable scales
- Flexible power supply options (AC wall wart, battery, solar, etc.)
- Simple terminal-based "task" configuration
- Complete usability through any terminal program, NO software on the PC-side except for a terminal program and a Bluetooth stack. This means that it could be used on any OS (Windows, Mac, Linux, etc) and with smartphones that support the Bluetooth COM object.
- Onboard SD/MMC card slot to allow the caching of data should the connection to the host be lost.

Just a few thoughts that have been bouncing around inside my head for the past could weeks. Maybe this weekend I'll have a chance to piece something together and a do a bit of testing. The biggest thing is probably going to be the "boot menu" through which you set up the device; I'm not really sure exactly how I'm going to code that, so if anyone has any suggestions it would be a big help.

Wednesday, October 6, 2010

Hurray for Effective Communication!

Nothing exciting in terms of technology, but I did feel the need to share this one:

Today I came home to find a letter from Okanagan College (or "The OC" as I like to call it) sitting in my letterbox. When I went to open it, I realized that the envelope was assembled upside down. I guess they were having a rough day down at the envelope factory...

I had just finished giggling about the envelope when I examined the contents within. Inside was a cheque made out to me for $109 with the description field reading "Quick Refund" with no further explanation.

I'm still a little perplexed, but money is money, so I guess I should run off to the ATM to cash my "Quick Refund". I will have to put the cheque in an envelope; but hopefully their envelopes are put together the right way!

Tuesday, October 5, 2010

Yarrduino Power Meter

Alright - My first ever Arduino project up and running. Nothing too fancy; I just took an LCD I had lying around (HD44780 chipset) and patched it into the Freeduino board by way of a breadboard. The Arduino software is kind of neat; though it is written in Java (ughhhh), it runs like a hot damn and is well laid out.

I started off with the "Hello World" LCD example code and merged it with the "AnalogInSerial" A2D example code. The result printed out a reading in raw A2D values on the LCD, which, with just a little bit of black magic and some grade-school arithmetic was converted into a 0-5V DC voltage reading. This reading was then used to compute the current in amps (measured by the CT), which was then spit out onto the LCD.

The next step will be finding a way to measure the AC line voltage accurately and safely, and next in line comes the addition of data logging capabilities. At a glance, writing data to an SD/MMC card appears to be fairly straightforward as far as software is concerned, and from a hardware perspective it involves nothing more than a few resistors to eat up the difference between the +5V TTL on the Arduino and +2.7-3.3V the SD card operates on.

As always, comments and suggestions appreciated; source code and schematics free by request.

Also: I owe thanks to Limor and the Adafruit gang - I lifted the LCD connection schematic from her website:

Monday, October 4, 2010

We Get Signal! (from the thermometer)

I've finally managed to get the Bluetooth thermometer up and running; there are still a number of improvements to be made and features to be added but as it stands I can put power into the breadboard and get temperature readings out of RealTerm, so the basis of the system is operational.

Once it was up and running I took a few current measurements and was a little concerned; here's what I found:

Link connected but idling: ~20mA
Link connected and transmitting: ~22mA

Here's the kicker though - when power is first applied and the link is trying to connect to the PC the power consumption jumps back and forth between roughly 2mA and 50mA once a second. It seems like the "search" mode is the most power-intensive state, which could pose a bit of a problem. If the PC is waiting to accept the incoming connection the "search" routine will only take five seconds or so, after which the current draw drops down to the 20-22mA range. The danger is that if the PC is not ready to accept the connection (powered off, Bluetooth disabled, connection in use), the module will continue to "search" indefinitely, eating up the battery.

The Sure Bluetooth module doesn't have a #SHUTDOWN or similar pin, nor can it directly provide any direct link status indication, however it does have RTS and CTS pins, which we just might be able to make use of to see if the link is connected, and if it isn't, switch the power to the module off via a MOSFET for a predetermined amount of time, then try again.

Here are some of my other ideas:

Configurable "Sessions" - For the first thirty seconds after power-up, the PIC would look for any ASCII data coming in over the Bluetooth link. If anything was received, it would answer back with a "setup menu" that would allow you to change settings such as the initial sample count, sample frequency, etc. Once these values were set through the terminal, they would be saved in the EEPROM and the rig would start collection and transmitting data according to the parameters you entered.

This would be much more convenient, as right now the only way to change the behavior of the device is to modify the source code, compile it, and load it in with a PIC programmer. The "boot menu" concept lets you easily modify the settings without any hardware or software whatsoever (just your terminal program).

Some of the configurable values might include:

- Sample Frequency (currently fixed at one sample per second)
- Initial Sample Number (currently resets to "0" at power-up)
- "Search" timeout
- Temperature Scale (Centigrade or Centigrade - If you're using Fahrenheit you're not invited)
- Ideas?

That's about it in terms of news for the thermometer project; I'm going to have to work out a the details for the power supply next: I'm thinking something simple like a LP2950-3.3V should do the trick. I'm still trying to figure out how well all of this is going to run off the solar panel, the spikes at power-up can be counteracted with a supercapacitor, it's the continuous 20mA idle current that I'm wondering about...

In other news - my apologies to the folks at Neilsen-Kuljian: it is in fact my software that sucks, not their current transformers. I was having a discussion with one of my instructors at school today when it hit me: The PIC is running off of +3.3V, and therefore the A2D range will be dependent on the rail-to-rail difference of the PIC's power supply. In every project I've done in the past, I've powered the microcontroller off +5V, and had that been the case here my current measurements would have been correct, however, as the PIC's A2D in this situation tops out at +3.3V it makes perfect sense that a CT output voltage of 3.7V would give and answer of 10A!

Now that that's out of the way, I still need to find an accurate way to measure the AC line voltage and get a proportional 0-3.3V output voltage that I can cram into the PIC to compute power correctly.

I owe David (my instructor) thanks for providing feedback on my proposed measurement schemes; as things stand it seems we're still in limbo as to what would be the best way to go, I'll keep everyone posted.

Saturday, October 2, 2010

Bluetooth Power Monitor

All the recent talk of power conservation got me in the mood to adapt my power meter from a couple posts ago to be a little (just a little) more practical. With a little bit of re-working, I was able to recycle (eco-friendly) my code from the Bluetooth thermometer and use it to transmit measurements from the CT (Current Transformer) to a terminal program via the Bluetooth link.

Figure 1.0: Bluetooth Power Meter Hooked up to My Toaster Oven
With a little bit of hacking around in Proton (PICBasic Development Suite) I was able to get the thing working; at the moment it spits out a a reading every second in amps. I didn't want it to give an answer in watts since it isn't measuring the actual AC line voltage (yet), and therefore any power readings would be a sham if it used some arbitrary value like "120VAC" for the line voltage. The next step is to find a small transformer out of a clock radio or something (~6V secondary) and design a small circuit to give us a small DC voltage proportional to the AC line voltage that the PIC can then measure and use in power calculations.


-  I've run out of room in the PIC12F675 - It can only store one float variable. 

- The CT I'm using blows - The scale goes from 0-10A, but when I plug in my coffee maker that pulls 7.37A (900W/122V), the output voltage of the CT is around 4.75V, when in reality it should be about 3.7V

Figure 2.0: Terminal Output @ 9600 Baud over Bluetooth

As you can see it works as-is, if you'd like a copy of the source code give me a shout and it's all yours; just be warned that you'll need a PICBasic compiler to do anything with it. I could also send you a HEX file if you want to use it as-is. As with the thermometer, once I get something working that does more or less what I want it to do I'll draft up some schematics and maybe even a PCB. Stay tuned.

Sunday, September 26, 2010

Solar-Powered Bluetooth Thermometer (With Support for Laser-Beam Guitars)

This morning I decided that I wanted to know how warm it was outside, and I figured that since I might want the same information in the future it would be a good idea to build a thermometer. A wireless thermometer. A Bluetooth wireless thermometer. A solar-powered Bluetooth wireless thermometer. Yes, that's it!

Below is a photo of what I rigged up, it's not working yet (firmware) but it's a start. In the top-left you can see the Sure Bluetooth module that I picked up of eBay some time ago. With nothing more than +3.3V, this little champ emulates a Bluetooth serial port, which you can communicate with in more or less the same fashion as you would with a real RS-232 COM port. All of the pairing, PIN, and security nonsense is taken care of by the Bluetooth stack on your PC. The big gotcha with this module is that it is fixed at 9600 baud, making it too slow for many applications. My plan was to read the temperature every fifteen minutes and fire it into my PC through the "make believe" COM port; 9600 baud is MORE than ample for what I need.

The actual temperature measurement and A2D conversion is done by a Dallas Semiconductor DS1820B 1-Wire Digital Thermometer. This device sends the temperature data to the 8-pin PIC12F675 microcontroller that takes care of getting the data from the thermometer and sending it on its merry way to my PC through the Bluetooth link.

That pretty much sums it up; coming in from stage right we have +3.3V(ish) from an LM317 based power supply.

Once I get a working version together I'll draft up some schematics and post them here along with the PIC firmware. My eventual plan is to have a small (40mm x 40mm) PCB that includes everything onboard. The Bluetooth module will then plug into a female 10-pin 2.54mm header socket at the back to make a "double-decker" assembly.

Other Considerations:

- Crystals are temperature dependent; will this cause a problem for this circuit?
- How much power does the Bluetooth link consume in standby?
- How big will the solar cell need to be?
- How big will the battery/supercap need to be?

Saturday, September 25, 2010

Wattching Power Consumption

A few photos of the little rig I cooked up to monitor "Vampire" power usage in my apartment. Unfortunately, the CT (current transformer) I have can only measure currents down about 1A, so it doesn't look like this will give me the information I'm after...

How it Works:
Current transformers measure the magnetic field generated by an alternating current passing through a wire and output a proportional DC voltage. The chuck of plywood has an electrical box on it with a plain-old outlet, and a cord from an old microwave. The hot wire from the cord takes a detour out of the electrical box, through the CT, and then back into the box to the outlet. The two red and black wires carry the 0-5VDC output signal from the CT to my DMM (Fluke 89).

The Neilsen-Kuljian A100-1 CT that I have has three scales, and when set to the 0-10A scale outputs a DC voltage from 0-5V (i.e. 5A AC = 2.5VDC).

Knowing the current drawn by a particular appliance, we can then take this reading (for the toaster oven ~9A) and multiply it by the AC line voltage (I measured it to be 122VAC RMS), and this will give us the power consumption in Watts.

Toaster Oven Math:

Voltage Reading from the CT: 4.53V DC

Which works out to: 4.83V / 5.00V (range of the CT) = 0.966 = 96.6% of 10A = 9.66A

Being ELEN students, we know that P = IV, so therefore:

9.66A * 122VAC = 11078.52W

So there you have it folks; if you ever cared how much power I use to cook my toast in the morning there's your answer.

***CORRECTION: As Brad pointed out, it was in fact not George Ohm who came up with the relationship P = IV. I have not looked into this formula's history too deeply, however I would assume that James Watt came up with some variant of it that was then adapted. My apologies for misleading anyone on this. So in summary: The science is right, the names are wrong.

Thursday, September 16, 2010

Breadmaker Hero - For Black & Decker

Just a concept I'm working on. If Microsoft can have Xbox Live I don't see why I can't have BreadBox live. Just think: competing against other lazy chefs to see who can make the best peach flower cake, or the best pizza dough...

Wednesday, September 15, 2010

The Rutland Special

In addition to the world's first (soon to be) Ethernet-enabled bread maker, I am also now the proud owner of the world's most ghetto netbook. I picked this puppy up on Castanet (Kelowna's version of Craigslist) for a whopping $80, which is more that I should have paid, but I must point out that when I bought it, it was still in one piece. After I got it home I found out that the DC power jack was busted, and wrapping the cord around the machine wouldn't do the trick. Not worried about losing points for style, I busted it open, hacked the end off the power adapter, and hardwired the adapter right into the laptop. The battery is toast anyway it will always need AC, and since this thing is just supposed to act as a gateway between mine and my landlord's network I wasn't worried about portability. In summary, don't ask me to fix your laptop.

Monday, September 13, 2010


Here's an idea I've been kicking around with for quite some time now: A small, custom USB keyboard with pre-defined functions for doing math on your PC. The buttons would allow easy input of things like radicals, sums, exponents, fractions, and other miscellaneous formulae. The box would also have a three-position toggle switch to let you effortlessly select between normal, super, and sub-script input. Other buttons might include hard-to-find logical operators like "not equal", "greater-than or equal to", etc.

Anyways, I've managed to get the hardware more or less hacked together (on paper at least) but I'm kind of stuck for the software. My idea was to base it around the PIC18F4455 because it has USB on board and supports a whole whack of HID-related classes out of the box. I'm not sure what kind of software would be required on the PC side; the actual characters ("Not Equal To") should just have ASCII codes that can be fired into the keyboard buffer, but I'm not sure how you'd carry out functions such as selecting super- or sub-script.

If anyone has any ideas or input I'd be interested in hearing from you. Though this was meant to be sort of a personal project there are lots of scientists, engineers, and math teachers out there who have computers and like to do math on them, and they might be interested in an alternative to entering ASCII codes directly...


Oh - and in other news: I wasn't paying attention this morning and I accidentally blew up the WizNet Webserver for the bread maker, so the internet connectivity portion is on hold for a while. The PIC firmware still needs a lot of work (i.e. it doesn't even run yet) so that and school should keep me busy in the mean time...


A quick photo of the BreadBox development setup. In the top right is my "jail broken" Kitchen Aide bread maker, in front of it is my tablet PC hooked up to the breadboard (no pun intended) on the left hand side with a USB-Serial converter. On the board I have a PIC16F627A microcontroller that will be running the bread maker through a few transistors (at the moment I'm controlling the motor and heater through a pair of TIP31c's, however the final version will likely use a MOSFET of some variety). The too-short serial cable is tying the USB-Serial adapter to the PIC via a small board I etched containing an ADM202J (same as a MAX232) in an SO16 package. The first step will be reverse-engineering the recipes that are already loaded into the bread maker and storing them in text files. Stay tuned...

Friday, September 10, 2010

Bloggin' in the Okanagan: Yeah - I like that!

Nothing new to report on my end; I managed to get a little bit of work done this on BreadBox (the Ethernet-enabled bread maker), but it's still a long way off. Right now I'm in Vancouver visiting the folks; when I get home on Sunday I'll try and throw a few pics up, in addition to a more complete description of the scope of the project.

Tuesday, September 7, 2010

We have blag!

Alright everyone! We have blag! And by that I mean I have a blog. If I'm boring, please stop reading. If I'm interesting, you probably have nothing better going on and might as well keep reading.

For those of you who just tuned in, my name is Jamie and at the moment I live in Kelowna, British Columbia, Canada.

I threw (am in the process of throwing) this blog together to share some of the projects I've been cooking up in my spare time. Not really true blog material, but it's sure as hell easier than making a real website, and this is about all the effort you can really expect out of a guy from Cloverdale.