Hi i'm new in the arduino world and i'm trying to build a custom module for my 2 stroke bike, originally it had a module that detects rpm and at 8200 rpm it opens an electronic valve in the engine, unfortunately these modules are old and get easily broken and are not repairable because they are fully dipped in epoxy. i need an hand knowing how i can build something to detect the rpm of the engine and program the arduino so it opens this valve at 8200 rpm and closes it when it goes down the 8200 rpm. i include all the schematics of the circuits of the bike, i dont understand how i can get the rpm signal into the arduino, maybe i can use the original pickup.. idk im getting frustrated because no one in thw whole web has done a "replica module" that works like this.. i hope someone can help and sorry for the not so good english but im italian.
Reference manual page n. 259 Rev counter circuit
Reference manual page n. 255 power circuit
Reference manual page n. 253 ignition system
maybe these pages can help someone find the way to read the rpm. thx
There are three wires coming from the sensor, which makes me think it's an Hall sensor. (= magnetic field sensor) Positive (+), Negative (-) and signal (either 0 and 1 or analog signal depending on changes in the magnetic field)
yes its for an Aprilia RS125 but it is from 1996, not 06 to 10.. the pickup sensor its magnetic i think because it only has 2 wires and it reacts on a magnetic piece on the flywheel.. how can i make this happen? im trying to detect the rpm.. how can i make the arduino know the rpm with only a sensor that opens and closes?
It might be easier to tap into the rev counter signal, which detects the grounding of the coil (i think)
Or the original pickup which as far as i can tell is responding to the magnetic changes in the flywheel.
Either way, using an MCU in an automotive environment always means that you have to provide it with a really stable power supply and opto-isolate any input signal.
Well the flywheel is a magnet in itself i guess.
You count the times it opens (or closes) . You get an interrupt routine to do that. Then you divide that value by elapsed time.
If 100 ticks per second, that equals 6000RPM
so i have to see what the rev counter signal is, maybe using a tester? the original pickup detects a small magnet on the outside of the flywheel, the inside of the flywheel has another ring of magnets but thats for the stator in the charging circuit. for the power supply i would use a dc-dc converter to get 5v constantly.. idk what is an opto-isolator but i think that is the minor of the problems for now (?). and i have to understand what an interrupt routine is... im getting so crazy out of my mind with this project because its my first time doing something like this or using an arduino because as i already said i never used one, i even have to learn how to program it, maybe i can pay someone to write the code.. idk im getting frustrated bc it's the hearth of this beautiful bike and without a solution i cant enjoy it
it could use the ac voltage from the regulator/flywheel but i cant measure it with a tester.. bc it's only one wire that goes from the regulator to the rave control unit.. obv i need 2 wires to measure ac voltage with a tester.. im starting to get an headache
Just in case hook up a oscilloscope and see how clean that 5v is with the engine running.
An opto-isolator or opto-coupler is basically a LED that is directed towards a photo-transistor. The LED lights up, the transistor opens. It is not a minor thing though, you will need to keep the MCU isolated from the power system of the bike with all it's noise from the alternator and ignition.
An interrupt routine is a function which is called by the MCU whenever a certain condition occurs, say a change of state of a GPIO pin or a timer trigger. check The reference
Well it is not quite a beginner project.
What shall i say. Chill.
You could connect it to an Opto-coupler and connect it to an interrupt pin on the other side and see when there is a voltage in 1 direction and let that be the trigger. What you are looking for is not so much the voltage but the frequency, An osciloscope would probably be helpful.
What about GND ? isn't that your 2nd wire ? Don't get yourself all worked up !
Actually its faster to measure the period between pulses than to count pulses for an interval. A tach uses an inductive pickup. If you tap into the ignition siganal be sure to solder. The timing pulse to the coil is also a good pickup point.
If you measure the period you can use it as an array index to lookup the rpm value directly. Since you have a specific RPM in mind, measure the period and if its < you're past limit. No math. Makes it very fast.
Hysteresis: You dont want to be flipping the valve at 8200 and then back at 8199. If you're on the hairy edge the valve will rapidly toggle. Now if you open at 8200 and close at, say 8100, you'll not have it be twitchy. So the period for 8200 and 8100 can be quickly resolved making the control responsive.
i dont have an oscilloscope, and it would be even difficult to use for me.. i could use the signal from the timing pulse to the coil or the pickup directly that is analog (open or closed). but my big question is pratically how can i connect the pickup to the arduino? (using an opto isolator) ((i would like to use the pickup because it's analog and easier)) and what code should i use to read this analog input and convert it to rpm or something useful to open and close the valve? the problem is i never coded in c++ and never discovered this type of electronics engineering.. its a big project for a noob like me, but u are being really helpful and i can only say thx! hoping we can buid something functional for me and for many other owners of this bike in italy bc its a frequent problem with this old modules
yeah i have a dmm (here its called tester thats why i called it like that lol) so i have to check the ac voltage at around 8200 rpm where it should open.. well the first work should be knowing how to connect these ac signal to the arduino without exploding it and then i would need the code to read the ac signal and then to open/close the valve..
thx for the help btw!!
No, just test how much voltage you get, this will indicate the sort of interface circuit you will need.
If you use an Arduino you cannot put more than 5V on any input, if your signal is higher than 5V you will need to make a circuit to reduce the voltage.
The frequency of the AC will give you the engine speed.
ok so i need to check how much voltage goes to that cable when the engine its at idle and when it is around 8k rpm and i come here again hoping i can find some more help.. thx for everything.. if someone has any more ideas to get this done (easy ways if u can) im more than happy to hear them..
i have a few more questions, how can convert the ac frequency in engine rpm?
it should output 40-80v ac if i remember right
im still confused about some stuff.. i will problably need to hire an electronic engineer , when i have some more free time i will try and measure the ac current on that wire. im still waiting for someone to find an alternative way to get the rpm signal, maybe from the wire that goes to the original tachometer? maybe it's easier.. idk, i would love to get the bike ready for the summer but i'm still halfway trough