Connect with us

Using a REED SWITCH with uC Question

Discussion in 'General Electronics Discussion' started by JimL86, Nov 13, 2017.

Scroll to continue with content
  1. JimL86


    Nov 13, 2017

    I am using a REED SWITCH with on one side that is connected to a battery and on the other side to a GPIO on micro-controller (ATTINY814)

    Does the circuit consume current when the reed switch is on or off? Even when the microcontroller is in idle state (Sleep Mode)? If so, how much current you assume?

    Is it possible to make a configuration in which the microcontroller is in sleep mode and no current is being drawn unless the microcontroller awakes? (even when the reed switch is on)..

    * FYI provided a drawing of the circuit.

    Attached Files:

  2. BobK


    Jan 5, 2010
    Before worrying about the current drawn, you need a circuit that works. With the circuit you show, the input is floating when the the switch is open. If the micro has pulldown you can enable, and you enable them, the circuit would work, otherwise, it needs a pulldown resistor (from the GPIO to ground) in order to work correctly.

    Anyway, there is obviously no current in your circuit when the switch is open. When it is closed, it would be the leakage current of the input, which should be in the datasheets. With pullups, there is a current through the pullup as well when the switch is closed.

  3. kellys_eye


    Jun 25, 2010
    Pull up resistors are the most commonly used method and some μcontrollers have them built into their I/O ports - check the datasheet to see if your particular port offers this.
  4. hevans1944

    hevans1944 Hop - AC8NS

    Jun 21, 2012
    Have you read, and do you understand, all 598 pages of the Atmel datasheet for your ATtiny814?

    What is the purpose of the reed switch? How do you awaken the processor from "sleep mode"? Which sleep mode will you be using?

    No. If the reed switch is closed, connecting the CR2032 coin-cell to a GPIO input, some current will flow regardless of whether the microcontroller is awake or asleep.

    Please tell us what you are trying to DO, instead of proposing and asking questions about how you think it should or could be done.
    Harald Kapp likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day