New answers tagged

1

This does not resolve the issue, but for now it is "fixed". On the I2C interface stepper driver is interfering with the microcontroller, and it must be some electrical interference, if I disconnect the stepper motor from the stepper driver then it works. (Just saying again... NOTHING is plugged into the Arduino from the stepper driver or the ...


1

In a word, no. Laptop or desktop computer usually have USB ports, which put out like 10 watts of power for a "high current" USB port. That is not enough to do much heating or cooling. You want a high power supply. The pelteir plates I've seen run on 12V DC. Get a 5A 12V supply, or even higher. You might be able to draw larger amounts of current ...


1

Many internet sources like this one claim the HC-SR501 requires less than 50uA (or 0.00005 Amps). Likely this is only in a quiet or quiescent state and current demand may increase initially when power is applied and when motion is detected. Regardless, this is an insignificant fraction of a 2 Amp power supply. Likely the Atmel 328p will require several ...


1

When it comes for amount of power from laptop, then this is not realy reasonable to expect even USB3, maybe some older laptops PCMCIA, or hardware docks. When it comes to Desk, They would have to be adjusted to get the ATX from PSU (it would have to be upgraded for purpose) We are still talking about a small Can or Yacult botle... Even then insulate, ...


0

No, shorting +5 to Gnd is not safe, although a brief short might not cause damage. If it persists, you could burn a trace, overheat the voltage regulator, or damage the computer USB if that is what powers your Arduino. Most computers will sense that short and disconnect power to that USB until the short goes away, but you don't want to count on it! If your ...


0

It all depends on how you are powering the board. If you're running it from USB then the computer should shut off the power to the USB port. If it doesn't then the Arduino has a small self-resetting fuse on the USB power which should shut the power off for you. However if you're powering through the barrel jack there's no protection. Worst case scenario: it ...


1

As explained by @chrisl in a comment, the issue is that pow() does not return an exact result, only an approximation. It works fine with compile-time constants because in this case it is evaluated at compile time, by the compiler, on you PC. Simple solution: replace the cast to int with round(): int multiplier = round(pow(10, argc - 1)); This works, but is ...


2

With some inspiration from timemage's comment, I decided in the long run to implement my own power function that takes two int arguments and returns an int. Rather than use the pow function in the <math.h> library which returns a double when I only need an int. int power(int x, int y) { return y == 0 ? 1 : x * power(x, y - 1); } Now the program ...


Top 50 recent answers are included