We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

1

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 ...


0

Why do you compute tempc only after you print out the value in serialOutputWhenBeatHappens`? You also forgot to read the temperature continuously. Here is how I would do it: void loop() { // read the sensor before it is printed on the LCD vout = analogRead( sensor ); // here I'm not sure what you are computing // you map the sensor voltage to ...


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);


0

Perhaps measuring works better if you give the servo more to do. Then the time there is for measuring is greater. And because you do not measure and print 360 times in the loop() the program will be faster. #include <Servo.h> #include <Wire.h> #include <Adafruit_INA219.h> Servo myServo; Adafruit_INA219 ina219; void setup() { uint32_t ...


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 ...


0

i didnt solder my light sensor and it had the same error, as it was just resting on the pins, try pushing it up so the sensor makes contacts with the male headers or just solder them :D


0

An Arduino UNO has a max current of 20 mA per IO Pin and a max current of 200 mA of all Pins together. If you intent to drive the senders with the pins then this is impossible. If you power the Arduino with USB, the VCC current is limited to 500 mA (thermo fuses). If you power it externally, it depends on the power supply. Using the voltage from the Vcc Pin ...


0

In addition to what Peter Paul Kiefer suggests, you will also want to place an RC low-pass filter, between the piezo transducer, and the analog input. You mention that you'll be sampling this value 100 times per second. So the cutoff frequency, for the filter, should be set to 50 Hz (the Nyquist frequency).


0

It depends on what kind of sensors you're using. If you use I2C based sensors, and you can configure each with a separate I2C address, you could theoretically drive up to 128 of them. I say theoretically since you might not be able to push the signal across an I2C bus with that many devices on it. You could certainly manage 15 of them however. The Mega 2560 ...


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 ...


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)...


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 ...


Top 50 recent answers are included