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

Afternoon,

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: www.jamiemaloway.com/projects/bluetooth-thermometer

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?

No?

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"

delayMs(5000)

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

delayMS(5000)

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...