Bidirectional Counter Project
I was attempting to make a counter that can indicate total number of rotations that a motor driven spool makes. The spool can turn both clockwise and counter clockwise. The spool holds a cord and each rotation equals +/- one foot of cord that has been played out. I initially thought I could do it using a mechanical approach where two microswitches (facing each other) would be activated by flexible lever that is moved by a post on the spool in either the forward or reverse direction. I thought I could just send these momentary signals to a totalizer counter that could add or subtract from the count displayed on a digital display.
(https://www.amazon.com/-/he/Hilitandpb68xgfw9i/dp/B0BR8DBBR2)
But I realized this was a very rudimentary and restrictive approach when I stumbled onto "bidirectional people counter" Arduino projects.
So, I am going to get a basic Arduino book for beginners (recommendations appreciated). However, I thought I’d join this forum and see if I can get some preliminary input that may make my exploratory journey more efficient.
According to most of the “bidirectional people counters” that I reviewed, the basic plan involves two IR sensor modules, which input into an Arduino Uno and then outputs to a digital display. Renu Robotics is an example of a typical project.
The main components are the following:
- Arduino Uno
- 16/2 display
- infrared sensors x 2
- Breadboard Arduino Data Cable
- 9 volt power supply
Source Code & Circuit Diagram : GitHub - Renukanand1308/Bi-Directional-Visitor-Counter
Details of My Project:
Each rotation will roughly equal one foot of line out or in and will be tabulated on the display. This unit is contained in limited confines so I need fairly small components. Mainly the two paired sensors need to be the smallest possible and would be fixed on the stationary hub and interact with a post on the rotating spool that will pass in front of them and register with each turn, clockwise or counter clockwise, thus indicating a total length of line out.
Because the space available is limiting, I am hoping that only the sensors themselves need to be mounted in the hub and the three wire leads can be brought outside the case to the sensor board connections. I would like to use the smallest sensors, perhaps these.
Miniature Reflective Infrared Optical Sensors
I would like to consider using a TFT display in place of the 16/2 display. The count will not exceed three digits.
The display will be near the actual Arduino Uno circuit board and the IR sensors would be on the spool’s hub, be about 12 feet away. I don’t know if the leads from the sensors could be extended using a three-lead wire to the sensor board which could then be located next to the Arduino Uno unit. Would the long wire create either a resistance factor or electrical interference that would degrade the data transfer? Alternatively, could the sensors be connected to the sensor board with short leads and have the data transmitted through a simple, small wireless transmitter to a receiver connected to the Arduino Uno unit, thereby obviating the need for a hardwire connection from the IR sensors and the Arduino Uno. Since I have no idea how the data is transferred, I don’t know what the transmission options are.
Main Questions Needing Answers:
- Can the IR sensors be separated from the sensor board using a wired link?
- Can the wired link extend 12-15 feet to the board situated next to the Arduino unit? If not possible, can the wired link from the sensor board to the Arduino be extended to cover the 12-15 feet distance?
- Can the IR sensors on the board be replaced by the smaller sensor units I found?
- Can the link from the Arduino to a TFT display be replaced by a wireless link to an android phone?
- Is the use of the paired IR sensors the best way to design the system? Could the use of a rotary encoder be a better alternative? If so, how is this done? I saw this thread that described using a rotary counter rather than IR sensors to get a more accurate count. rotation counter - #7 by gfvalvo
- I need example of the program I can use
Picture of project layout (I posted this because I couldn't upload a picture)