Can ATtiny45 be used for this application?

DVDdoug:
I'm going to say... probably... :smiley:

But, if you are using a Duemillanove (or Uno), what's the ATtiny45 for?

One of my friends said it might have some problems with "interrupt" or something. I am not really so keen on microcontrolers.

Probably right...

A microprocessor/microcontroller can only do one thing at a time.* So in your case, it needs to switch between timing the wheel rotations and updating a display (or sending out PWM, or whatever).

If it's updating the display when the wheel sensor gets triggered, you need to interrupt the display process (for perhaps several microseconds) and "grab" the time before too much time goes by and the timing/speed gets fouled-up.

The idea is to mount several magnets...

I think it's "traditional' to trigger once per revolution. The more magnets you use, the more chance there is for a problem. Maybe go with two if you want to keep the wheel perfectly balanced. If you have 10 magnets, and one gets knocked out of position or fails for some reason, you'll be off 10% and you may never know... More readings isn't going to make it more accurate. It's just going to give you more data/readings. How many times per wheel revolution can you read the speed display? :smiley: For the microprocessor & firmware, it's no problem... Several triggers per revolution is s-l-o-w for the processor.

...for a Schmidt trigger on the rear hub.

You're going to need a hall-effect sensor too. :wink:

  • Your computer is multitasking all of the time, even when you're only running one application. It's constantly updating the display and monitoring/updating the mouse, and a bunch of other stuff, etc. But, (assuming a single core) it's really only doing one thing at a time, rapidly switching between tasks and handling interrupts.

The precision is more for the turning/not turning than the actual value of the speed. So I think the hall effect sensor(forgot to mention) and Schmidt trigger would do the job.

So PWM is probably not a good idea right? should I maybe use ATtiny2313 with Rx/Tx to communicate with the arduino?