Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

4

A signal is just a varying voltage. A wire is just a (very long) small resistor. The device reading the signal is just a current sink. That's three terms there: voltage, resistance, and current. Three terms you should know are related by Ohm's Law. Also, some simple rules: The thinner the wire the bigger the resistance The longer the wire the bigger the ...


4

First things first; please INDENT YOUR CODE. The code you posted is a mess and I took at least double the time to fix that. First, you have an extra closing curly bracket at line 17 and the if (Fire == High); should be changed to if (Fire == High){ Fixed code: int Led = 4; int Buzz = 7; int Sensor = 11; int Fire = HIGH; void setup() { Serial.begin(9600)...


2

If the sensor does provide two defined voltage levels, you do not need a pullup or pulldown resistor, but if it's only a switch: either (closed) connected to Vcc or GND, or (open) not connected, you need a pullup or pulldown resistor to get a defined voltage level in case there's "nothing else" (except the wire to the switch catching noise out of the air) ...


2

I realize that power is flowing the entire time the switch is open, which may (or may not) drain the battery. No, it doesn't. You get a small spike as the switch is opened or closed, as the gate capacitance is charged or discharged, but other than that there is negligible current draw by a pin, which remains static regardless of the direction of the biasing ...


2

The input current does not depend on the pin level. Have a look at this discussion from avrfreaks. The input impedance of a digital pin is extremely high. The leakage current of the Atmega328P (here as example chip) is mentioned to be 1uA for both pin states. So this current is both unavoidable and neglectable from a normal view. But the input impedance of ...


2

The 9V wall adapter is in most cases a switched power regulator with a high frequency. That's like a radio transmitter direct beside the wire. So there is nothing mystical, when the smooth USB Voltage does not show problems but the "radio transmitter" does. There are two ways the power supply can impact: over radio wave or as ripples over the regulated ...


2

If the provided source is cut down to the lines that have to do with the temperature, it is just this. If you try this sketch it should behave equally "wrong": const int sensor = A5; int tempc; float vout; void setup() { vout = analogRead(sensor); pinMode(sensor, INPUT); } void loop() { lcd.print(tempc); tempc = (vout * 500) / 1023; } In ...


1

Code seems to lack a repeating update of tempc via vout =analogRead(sensor); An alternative might be changing the line for setting tempc to be tempc=(int) (analogRead(sensor) * 500.0f/1023.0f);


1

I have two of those sensors in a long term setup and I know those spikes very well. I once put lots of effort in debugging and I personally gave up on the ccs811 and use a different sensor now. Back then I have already tried what Jaromanda suggests in his comment. Both of my sensos showed the same behaviour while the spikes on both sensors did not correlate ...


Only top voted, non community-wiki answers of a minimum length are eligible