Light and Temperature Logger

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.

Tags: , , , , , , , ,

3 Responses to “Light and Temperature Logger”

  1. Giacomo says:

    Can anybody help me?
    I can’t use UART on my pic24Fj64ga002!!!
    Tx pin on rp3 work correctly…but Rx on rp2 can’t work! It only works if I set the loopback mode… it seems to have con connection on multiplexed pins!
    Configuration words are ok.
    and also electronics connections…it’s only a wire! I’ve also tried to short circuit Rx and Tx, but it can’t hear!
    I have no other modules enabled, only UART1, and an I/O driving a LED.

    …please help me! I’m becoming mad!

    I forgot…well good! a nice project!!!

  2. ned says:

    Hi Giacomo,

    There are a two potential problems assuming your UART module is enabled properly and all your interrupt priorities are correct (if you are using interrupts):

    Your re-mappable pins aren’t assigned right. They should be RPINR18bits.U1RXR = 2; RPOR1bits.RP3R = 3; assuming you are using UART1 and RX = RP2, TX = RP3.

    You didn’t disable the ADC on those ports (they are enabled by default). AD1PCFG = 0xFFFF; will disable them all. This one is a very common gotcha, all digital I/O reads will fail unless the port has its ADC channel disabled.

    Let me know if that solves it for you. If not post your UART module init code and I’ll take a look.

  3. Giacomo says:

    Hi Ned,
    fortunately I solved the problem some mounth ago…It was the ADC!!!
    Thank you for your interesting!!!

Leave a Reply