Arduino as Pulse Divider

The UNO chip's input capture feature may work for you - https://www.youtube.com/watch?v=gMrvXoOV92c

will the Tiny85 handle it?
will this board (blue usb) work?

https://a.aliexpress.com/_EHDK671

Shouldn't be a problem. My TINY85 is dividing down a 1.8432MHz clock so it should have no problems with your 11.5kHz signal.

That board might work. There's extra components on it. For the TINY85, you just need the actual 8-pin DIL chip itself, and a 100n decoupling capacitor. There's a few extra components if you want to program the chip without removing it.

However I would stay away from the variant of that board that exposes 4 copper strips so it can be plugged directly into a USB socket. It may expose the board power on one of those pins and it's a lot easier to accidentally short it out.

There are other TINY designs out there, like this one for example:

This is the ATTINY95 board variant i was reffering to:
image

does this handle a higher frequency compared to the 328p Arduino pro mini which i have at home?
My pro mini is the 5V / 16Mhz variant.

If you have a Pro Mini, then you can use that instead. The 328P (either at 5V/16MHz or 3.3V/8MHz) will easily handle the 11.5KHz signal you want to divide down.

You can likely use Timer1 to do the work so that you get to keep Timer0 for the delay() and millis() functions. Timer1 should also be able to output the divided frequency using just the hardware features without any further software intervention.

thank you, any example code for pro mini to devide by 6 with hardware only? thats exactly what im looking for.

You are unlikely to come across code that does exactly what you need. Your best friend here is the actual ATMEGA328P datasheet. It can seem overwhelming if you've not seen one before - my 328P datasheet runs to 662 pages - but that covers all the features of the chip.

You are only interested in using Timer1 clocked from an external clock source (your turbine), setting the compare match count to 3 and then toggling the pin - meaning that for every 6 pulses in, the output toggles twice.

gcjr's code seems to run nicely on my pro mini at the above frequencies.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.