Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: obiwanjacobi on May 10, 2013, 04:00:28 AM

Title: Looking for counter IC
Post by: obiwanjacobi on May 10, 2013, 04:00:28 AM
I am building my first robot and its going great. It is a robot car kit  (https://iprototype.nl/products/robotics/platforms/robot-a4wd)with 4 cheap motors, a dual channel motor driver, an Arduino and a Ultrasonic sensor. I have the motors running and the wheel decoders are pulsing. I am now looking into interfacing with the sensor.

This sensor (http://www.dfrobot.com/wiki/index.php?title=URM37_V3.2_Ultrasonic_Sensor_(SKU:SEN0001)) emits a pulse train when you request a measurement. The length of the pulse train corresponds to the distance of the detected object. The max pulse train length is 50 milliseconds.

I could write an ISR in the arduino that reads this pulse train and do it all in software. I could also add some hardware to unload this boring task from my Arduino.

I have looked into counter IC's. But I would like something that counts the pulses and can be interface with some sort of bus standard (I2C/SPI/CAN -  as simple as possible). I have not found a chip that can do that yet. A simple circuit is also fine - doesn't have to be all in one chip.

Anybody has some suggestions?

Thanx.
Title: Re: Looking for counter IC
Post by: billhowl on May 10, 2013, 04:55:35 AM
The counter IC SN74LV8154N (http://www.ti.com/lit/ds/symlink/sn74lv8154.pdf) has two 16-bit counters (you can stack them if wanted) and a single 8-bit output port , requiring only one shift register like 74HC589 (http://www.onsemi.com/pub_link/Collateral/MC74HC589A-D.PDF) to read as serial with SPI, you need 3 pins for it and 4 pins to control the counter mux.  Through-hole or SMT are both available.

You could of course use a small processor like the ATtiny85 as a counter and get the data via SPI.
Title: Re: Looking for counter IC
Post by: obiwanjacobi on May 10, 2013, 08:52:52 AM
Ooh! That's a nice one! Thanx! Excellent < 1 dollar solution.  :P

Yes, I am also considering using ATtiny's (or similar) but I am just beginning with robotics and want to start of simple and want to build up to autonomous modules that talk to each other on a bus.
Title: Re: Looking for counter IC
Post by: jwatte on May 10, 2013, 11:42:20 AM
My suggestion is also to go with a Tiny85. It can talk SPI or I2C and it can count pulses and it can run with zero supporting circuitry (although a de-coupling capacitor doesn't hurt.)

Edit: I looked at the sensor specs, and that sensor has a TTL UART. Just speak serial to it!
Title: Re: Looking for counter IC
Post by: obiwanjacobi on May 10, 2013, 12:15:14 PM
Edit: I looked at the sensor specs, and that sensor has a TTL UART. Just speak serial to it!

 :-[ Oops

 ::) RTFM

I just looked at the sample code for mode 3...

Sorry, to waste your time guys. My bad.

Anyway, good to hear support for using ATtiny's...  ;D