AC Signal...


Closed Thread
Results 1 to 19 of 19

Thread: AC Signal...

Hybrid View

  1. #1
    Tear's Avatar
    Tear Guest

    Default AC Signal...

    Today I am looking at starting a new "simple" project to continue playing with the PIC16F84. What I would like to do is use an AC Power Source as an input and then have the microcontroller turn on a LED for an output.

    I am assuming that I need to use the PIC16F84 on chip A/D converter, but I am not sure if this is true as I am new to the microcontroller world and have not played with this.

    Any help concerning how to use an AC source as input to a microcontroller would be very helpful.

    Thank you,
    Michael Schmidt

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You obviously have a death wish.

    The 16F84 has no A/D... and even if it did, it wouldn't help you.

    The attached schematic might increase your life expenctancy (or that of your PICs). C1 is a 10nF 1kV Disc Ceramic (good for 110-240vAC). It's there to limit the current going through IC1 which is an opto isolator like Cosmo's K1010. D1 a 1N4007 is there to stop the reverse-bias voltage killing the opto's LED emitter. The PIC's pin needs a pull-up to +Vdd, or use one of the weak-pull-up's on PortB. Add your own Fuses (if required and as appropriate to your application) on the AC Input line. 50mA is more than adequate.

    The PIC will see a pulse at the frequency of your AC supply. Check for it using COUNT or PULSIN or whatever method you prefer. No Pulse, No AC. I use this method (or variations of it) to detect AC Supply Phase Failure, Fuses Blown etc etc.
    Attached Images Attached Images  

  3. #3
    Tear's Avatar
    Tear Guest


    Did you find this post helpful? Yes | No

    Default

    After posting this morning I was looking at the data sheet for the PIC16F84 and came to the same conclusion that the PIC16F84 doesn't have an A/D converter. However, even if I went to a pic that did have a A/D converter that still wouldn't do anything for me then? I am not sure how the A/D converter works and I am going to look into this this afternoon.

    I am also having a little bit of trouble understanding your circuit schematic. From what I understand it looks like the diode goes across terminals 1 (L) and 2 (N) of the IC1. (L) I am guessing is the AC Voltage coming in through the capacitor and then into terminal 1 of the IC1. Pin 4 goes to the input pin of the microcontroller, and pin 3 goes to ground. What is the (N) or what I am guessing is pin 2 to IC1?

    Thanks for the help and sorry for the confusion on my part.

    Michael
    Last edited by Tear; - 6th July 2005 at 21:55.

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Tear,

    before we continue our guessing session,
    would you tell us a bit more in detail what you are actually trying to achive?

    (At least to me t is not really clear)

    Your initial posting on this thread sounds a bit like you would like AC to supply your PIC.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The L and N are Live and Neutral from your high-voltage AC Supply Input.

  6. #6
    Warrier's Avatar
    Warrier Guest


    Did you find this post helpful? Yes | No

    Default AC signal

    Ms. Newman,
    don't you think you need to provide a DC path for the LEDs in the opto coupler to conduct? - even a 100k would be sufficeint as the voltage across the diodes is clamped to about +/-1.7volts.

    I think Mr. Schmidt should be warned of potential shock hazards! If he is aware of it then he could even use a series resistor (1Meg or more) to any input as the internal clamping diodes will limit this to Gnd and Vdd.

    But then Ralph's question is also valid... Is Mr. Schmidt trying to use an AC power source? Hope not since he has used the title "AC Signal" and refers to internal ADC for the F84!

    -warrier

  7. #7
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Warrier
    ...a 100k would be sufficeint as the voltage across the diodes is clamped to about +/-1.7volts.
    Well, in general this is correct, but:
    lets's assume the Opto's LED current is as low as 10mA,
    even at that low current at a voltage of 120 or 240 V the resistor would have to be quite large (in size) and dissipate a lot of heat,
    would you really like this?
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



Similar Threads

  1. Measuring p-p of a 1.5v to 12v ac signal?
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th October 2009, 16:22
  2. Decoding an incoming infrared signal: need advice
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 9th May 2008, 16:28
  3. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. Rc signal help
    By geckogrotto in forum mel PIC BASIC Pro
    Replies: 42
    Last Post: - 27th August 2006, 00:10

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts