NodeMCU GPIO pin Still Has Power? - arduino

So I have a NodeMCU board and I am trying to create a garage door opener. Which I was partially successful with. To explain, I was able to control the garage door using the NodeMCU board and open and close it successfully. However, the issue I am running into is the second I connect the garage door openers pins into my breadboard I cannot open and close the garage with the regular garage door opener button on the wall. From what I understand, it seems as the GPIO pin even in the LOW state (which the led is turned off) has power. My question is, is there any way to completely turn off the GPIO without having to use a relay? Thank you to everyone in advance!
This is the code I am using to turn on and off the GPIO feel free to let me know if I am doing something incorrectly.
digitalWrite(outputD5, LOW);
digitalWrite(outputD5, HIGH);
delay(1000);
digitalWrite(outputD5, LOW);

The answer will be No !
If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW.
Make sure you are using appropriate resistor in your schematics and try probing the output pin.

The solution for this question would be to switch both pins to input that way no signal is sent out, as an added safety measure set both pins to low. When you want to toggle them change the pins to output and high and then revert them to the original after a delay or what not.

Related

Switch connected to an Arduino not working in Tinkercad Circuits

See image: after terminating it rotates to 180 and back to 0 while staying rotating between 0 and 90. And nothing happen if I turn the switch. Don't know what I'm doing wrong. Oh, it could also be the program.
Please Connect a resistor at pin 2 to ground so by default when switch is in off state low voltage is present at pin 2 and else condition is able to work.
Resistor value = 1 Kohm if you are having power rails in range of 0 - 5.5 Volts,
You can add a resistor from digital pin 2 to ground and have the other switch terminal connected to 5V, but the more elegant way would be to activate the internal pull-up resistor and connect the switch to the ground. This way you won't need any resistors. You can check Arduino's online tutorial by searching Arduino internal pullup on Google.
Hope it helps you.

Arduino + GSM shield V2 // How to use buzzer signal

I have a GSM shield V2 for Arduino, and I want some buzzer to make some noise when there is an incoming call. At this link http://www.thaieasyelec.net/archives/Manual/M10_HD_V1.00.pdf page 44 I found that by connecting a simple transistor and a buzzer to the actual "buzzer" pin I should be able to produce sound. I tried and that does not work as expected, all I get is noise from the GND of the shield, that typical GSM noise that everyone know of.
I also tried to connect another arduino as to analog read the buzzer signal, but I get nothing that look like a ringing tone.
Has anyone any idea? Did I forget to setup some things software wise? So far it seems that the buzzer behaviour is completely unrelated to anything code wise, there is just that "buzzer" pin, and that's it, nothing more to set up.
Any help would be much appreciated !
Cheers
Here's a great beeper/alarm part I've used in a couple of recent projects. It is loud but can be muffled. It's self-driving, so all you have to do it supply it enough current at its rated voltage, like through a transistor or Darlington. It has a wide voltage range, and runs great from 3.3V up to 20, So it's ideal for microcontroller projects at 3.3V or 5V. No need to fiddle with timers or PWM to make it beep. Try out this great part.. Drive it from any output pin to a small-signal transistor with a beta of 50 or better and you'll be good to go. Turn output pin on, it starts. Turn output pin off, it stops. I made mine "chirp" like the alarm on a car security system. Easiest thing in the world.

Sim 900 GPRS shield pinout

I'm currently working on a project involving a GPRS Shield based on Sim 900 Chip
I was wondering if anyone would know which ones are the VIN Pin and the RING pin ?
It doesn't say on the board itself and all other searches have lead me to a dead end.
Also if you have a detailed pin layout it would be much appreciated.
Thank you
The GPRS shield is the one in the link below
http://imgur.com/a/1a2gx
Ring Pin
If you have a Multimeter with continuity testing, check where the RI pin (#4) on the Sim 900 chip is broken out to. Here is an overview of the pins:
If it isn't (some shields don't have them broken out) you could solder a wire to the RI pin with an LED and resistor to Ground, something like this:
[RI Pin]--------[wire]--------[LED]--------[Resistor (330Ohms?)]--------[Ground]
The ring indicator is HIGH by default and LOW when there is an incoming call. So, when there is no call the LED is on and off when there is an incoming call.
VIN
When the position of the switch (middle left in the image below) is set to "extern" (right), you have to supply power to the barrel connector. When you set the switch to the left position, the module takes power from the 5V pin of the arduino OR (dont attach both!) an external power supply you attach to that pin.
Hope it helps :)
PS: These SIM modules can have current peaks up to 2 Amps. I recommend you to use an external power source that can provide minimum 2A at 5V.
Edit:
This might be helpful:
http://wiki.seeed.cc/GPRS_Shield_v1.0/. I think its the same module as yours. Have a look at the "GPRS Shield v1.4 Schematic" at the bottom of the page.
Edit 2:
Comparing the board from the link and yours, i'm very certain that the ring pin is the one marked in red in the image above. Checking with a multimeter doesnt hurt though. You can add the same circuit i described above to that pin to add an LED indicator.

On NodeMCU or Arduino, what is the best rest state for a GPIO pin?

If a pin is unused, what should be its rest state?
I'm thinking gpio.INPUT makes sense, or maybe gpio.OUT set to gpio.LO, grounding the pin.
Is there a customary or preferred setting for unused pins?
For unconnected pins INPUT_PULLUP or OUTPUT. Using Pull-Up is better if there is any possibility that board layout will chance and someone connects this pin to ground/Vcc directly. It's better to sink small current to ground than short output pin to different logic level.
For connected pins INPUT (connection should be connected to LOW or HIGH level)

How to control a motor with two inputs using arduino

I am using an arduino uno and I am trying to control a motor with two inputs which I found in a small car I used to have as a child.
I connected the first pin of the motor to the arduino ground and the second one to the VCC and the motor started turning.
However, when I write the following code the motor doesn't work.
void setup() {
pinMode(8,OUTPUT);
digitalWrite(8,HIGH);
}
void loop() {
}
(I have connected the first pin of the motor to the ground and the second one to pin 8 of arduino).
Does anybody know why that happens?
You can only get a certain amount of current from an Arduino output pin. In general, you can light an LED with a direct connection to an output pin, but motors require more current. A detailed discussion is here.
To control a device such as a motor which needs more current than the output pin can provide directly, you can use an external transistor. You can buy circuits that implement this idea, such as this Motor Shield for Arduino.
This is not how Arduino is supposed to work with power consuming stuff (like mhopeng said, you may use LED in such a scheme, but not something more consuming): a motor should be between GND and 5V and if you want to control it, you have to use a transistor connected to an output pin.
I had a similar question once, it may be of help, too. Also, it may be a good idea to ask further questions at arduino.SE.

Resources