Hello, I'm new coding and I have project that has been in the projects. I have an arduino nano and I'm new to coding. Does anyone know how to tell arduino to send a pulsing 5v signal at a specific rpm signal for example 5k rpm? I'm making a shift light btw. I only know if and else and digital and analog coding.
Yes.
I'm a little confused by your post. RPM stands for Revolutions Per Minute but you don't say that you are driving a motor of any kind. In order to send a 5 RPM signal, you would need to know what kind of motor you are trying to drive at 5,000 RPM.
Or do you mean you want to read a pulsed input and turn on a light when the RPMs get to 5000?
How revolting. ![]()
// Output 5000 Hz square wave on Pin 2
void setup()
{
pinMode(2, OUTPUT);
tone(2, 5000);
}
void loop() {}
Damn autocorrect!!!
That a 5000 Hz output. Not 5000 RPM. That's why I'm so confused by the question. The OP also says they're trying to implement a shift light. Which means you have to READ the RPMs, not output them.
That's 5000 RPM at 60 PPR. The OP didn't specify how many pulses per revolution their tachometer signal is supposed to emulate. If, for example, the tachometer signal is 1 PPR, divide RPM by 60 to get Hz: 5000 RPM -> 83 Hz.
I think they want a test tachometer signal they can feed into their shift light for testing.
That is not what I got from the OP at all. But you could be right. If that was the case though, wouldn't you have to use something like a MOSFET to get a 12v signal that could be read by the tachometer?
It also seems like the PPR isn't a constant but varies based on the number of cylinders.
Start by learning how to measure the rpm, which requires a shaft encoder of some sort.
Post details of what you have done so far, and forum members can help.
Yes, thank you sir!!!
So far, I'm doing good at this part
If differs from every vehicle, mine only has one wire
Great! So consider adding something like this to your code:
if (rpm > 5000) send_signal();