Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
4

You have two issues going on - noise pickup, and a potentiometer with imprecise stops at one or both ends. The pot is the easiest to fix: What are the lowest low reading and highest high reading you can reliably get when you turn it to its stops? Use those in place of '0' and '1023' in your map() function. Improving the noise is only slightly more involved....


2

Your problem is that you are doing integer maths. mr = (130-20)/(1023-205) reduces to: mr = 110/818 Which normally equates to: mr = 0.135 But since all those numbers are integers the result is an integer, and is truncated at the decimal point, which means that mr is assigned: mr = 0 You can force floating point maths by either including a decimal ...


2

The voltage Vo is not the over the termistor it over R1! Change place on termistor and R1. /Mikael


2

There are many ways to remove noise, below are some ways: Only change the value when it differs enough. Assume the range is 0-1023. Than only change the value if the input value differs more than a constant value (like 5 or 10, experiment with this to find a good value for your pot meter). Another way is to use the average of the last x readings, You can ...


2

Implementing hysteresis turns out to be quite straight-forward: float pressure = read_pressure(); if (pressure < x) turn_relay_on(); else if (pressure >= y) turn_relay_off();


1

IMHO it is possible to connect more than one server PWM control inputs to a Arduino output pin. The Servo input is something like a comparator with an very high resistance. So the servos should not influence each other in any way, nor will the output pin be overloaded. Because of the input capacities of the servos, there might be a limit of the count of ...


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