Archive for the ‘PIC’ Category

Quick Bling

Thursday, June 12th, 2008

So two Saturdays ago I tried to make a some simple LED “bling” as fast as I could (from scratch). All told it took about 4hrs from start to finish (including firmware and soldering). The result is 3 LEDs (red, green and yellow) controlled by a PIC12F675 and running from a 3V lithium coin cell (CR1620). The LEDs brightness follows a sine wave with a period of ~ 1 second, and with each LED offset from the other by 1/3 of a period. As a result the LEDs seem to chase each other, only with a much nicer effect then your normal on/off chase. Here as one fades out, another is fading in, and the third is at nearly full brightness.

The whole board runs for about 24hrs w/o issue. If I disabled the brown-out detector, I think it would run for more like 48hrs, though the last 12 might not be that great. With the brown-out detector enabled, the LEDs start to flicker. This is because the voltage drops under load, so the detector trips, reseting the PIC. This causes the load to become less, so the voltage rises, the brown-out detector release the PIC from reset and then the whole processes repeats.

The back of the board is covered in static-free bubble wrap. I have been starting to cover my boards in the bubble wrap every since I put a board down on a pair of metal pliers and shorted a bunch of traces, frying the board. I just use the static-free bubble wrap that parts I order come with. Its also a nice way to reuse the material (instead of recycling it).

 

You can download the source code for the firmware (also contains a compiled binary). It’s written for HI-TIDE and PICC-lite, both by HI-TECH.

 

Front of Bling Board

Back of Bling Board

Light and Temperature Logger

Thursday, June 12th, 2008

I made a simple light and temperature logger a few weekends ago. It’s simple (I have built em lots of times) but this is the first one I actually soldered up. It uses a PIC24FJ64GA002 (Microchip) as its controller, a TSL-14S (TAOS) for the light sensor, and a MCP9701A (Microchip) as the temperature sensor. The data is stored in a 24AA1025 (Microchip) 1024Mbit I2C EEPROM. The firmware supports up to 3 more (4 total) 24AA1025s for expanded capacity. Just connect the EEPROMs to the I2C bus and tell the firmware about the expanded capacity and away you go.

All communications with the Logger are done using UART at 38400bps. The firmware provides a VT100-compatible terminal for easy data download and reconfiguration. There is an LED on the board that shows the current ambient light level (the brighter the room, the dimmer the LED), and another to show the memory status. The board will run for about 48hrs on 4 AAA, and records data once every 30 seconds (though that is easily changed in the code). The board also keeps track of up to 16 runs of data. Each time the board is reset, it starts a new run.

You can find a few photos below. And you can download the code (for Microchip C30 compiler), MPLAB project files and a complied binary.

Paper and Glue Microcontrollers

Sunday, April 6th, 2008

Last night I made a simple LED PWM circuit using the conductive glue from the other day. It uses the super cheap and robust PIC12F675 to do two channels of software pulse width modulation (PWM). The PIC runs at 4MHz and uses Timer0 for the PWM and Timer1 to move in new “frames”. The “video” is stored in EEPROM. You can download the source code as well as HI-TIDE PICC project files and compiled binaries: Paper Circuit 2 Source (1631). Below you will find some pictures of the circuit through out the construction process, as well as some video of its final operation at 3.0V with no wires and at 4.5V with wires added.