Pulsein voltage limits whats my upper limit?

Hey all, I need a second brain to double check my work. I want to easily check to see if a ramps board is set to PWM for the heatbed. Some are set to high/low, others are set to PWM to control the temperature. The problem is, you have to look inside the firmware of the arduino mega to figure it out. What I'd like to do is use the pulsein control to fashion myself something that reads 2 pins, and reports if it's pwm or if its just high/low.

So, essentially, just write something that handles pulse in and if it detects pwm, glow red, otherwise glow green for high/low.

My only question is, how would I handle high voltage. For instance, my board has a 15V connection pin. How would I test that without using a voltage regulator and potentially burning out my arduino?

Thanks for the guidance.


To connect the high voltage you have a couple of options. A resistor voltage divider is simple and will work fine. A 10K/33K network will give you 3.5V from 15V and that will feed into an arduino input with no particular fuss. Depending on what the 15V signal coming from a "ramps board" is like -- and if it could have spikes or negative voltages -- you might want an additional zener diode for clamping and reverse blocking diode.

ummm. Not to rain on your parade, but technically, either approach is PWM, the later is just slower (in seconds), instead of PWM at high frequency.

Hook a resistor and speaker between the pin and ground. If you hear a 400 to 900 Hz tone then it is using fast PWM. Otherwise it is using slow PWM.

I take it you need to know if your heat bed should use a MOSFET (fast) or relay (slow).

I would connect an LED and resistor up through a seriese capacitor. Then it will only light with PWM and not high and low. With high and low it will just give a single flash. Maybe have another LED and resistor connected directly for an indication if it is just on.

Put ground and the signal wire side by side on your tongue. If it's got a lemony zing to it, it's pwm. If it's more a key lime pie effect then it's just high.