12F683 Auto Light

Discussion in 'Embedded Systems and Microcontrollers' started by JDR04, Jul 24, 2014.

  1. JDR04

    Thread Starter Active Member

    May 5, 2011
    I'm using this project more to learn about Flowcode 5 and how to use a PIC (12F683) to detect darkness and then turn a LED on.

    I've done a Program with FLOWCODE 5 and it all worked great in simulation. However....the actual circuit itself is proving to be difficult for me.

    I have a phototransistor to detect the light/darkness. The buzzer will sound twice when turning the circuit on.

    My problem is I dont think I have wired the buzzer and the phototransistor to the PIC correctly as nothing works.

    I have attached the circuit and really would appreciate your guys help on this.

    Thanks a lot.JDR04
  2. MMcLaren

    Well-Known Member

    Feb 14, 2010
    Hi JDR04,

    I know nothing about FlowCode. Sorry. But I noticed you have the buzzer connected to pin 4 on the 12F683 and that's a pretty obvious mistake. Pin 4 is the RA3/MCLR/VPP pin which is an "input only" pin.

    Good luck on your project.

    Cheerful regards, Mike
    JDR04 likes this.
  3. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    R3 is a bit low in value at 10k. Depending on your light level, the phototransistor can have quite a high resistance.

    I would try a much higher value resistor for R3, maybe 47k or 100k?

    Also you should check the voltages on the ADC input pin3 with the circuit in light and in darkness. That will give you more info re the ADC result.
    JDR04 likes this.