DCC++ Reflective Sensors

Hi, Thanks in advance for any help with my problem.

I have loaded the DCC++ sketch on to my Mega and have a breadboard with some reflective iR sensors which are mapped to JRMI layout.

My issues is when I trigger some of the sensors they also trigger another for some reason.

So for example I have a sensor wired to GRD and DI Pin #3. Sensor #12 is not wired. When I trigger sensor #3 it also shows #12 has been activated as well! As far as I can see I have neither of them linked in JMRI. I have cleared the DCC++ sketch and reloaded it and still happens. Tried a earlier version of my JMRI set up and same thing happens.

Is there anyway the DIO pins could be linked somehow? Any suggestions as to what the problem could be please?

Not sure what other info I can give at this moment in time but if I need to provide any more info please let me know.

Thank you.

Is this cross talk between IR components ?
Can you post your sketch (DCC++ ? ) and a schematic diagram.

Your setup is probably suffering from floating inputs.

If an input pin on a Mega is not connected, it can pick up noise from the environment which can result in strange effects (usually readings changing between LOW and HIGH). Disable unused inputs in your software or tie them to ground or Vcc (whatever is suitable) using a 10k resistor.

Sorry forgot to mention I have the Arduino Shield on top of Mega.

So just deleted all sensors and wrote to EEPROM and then started to add one at a time. All ok until I
get to 11. Added DI 11 as Pin 11 and now when trigger it it shows #10 going active.
Circuit attached. So are you saying take a 10k resistor from unused ping to GRD for example as in attached on D11?
.

That 220 ohm pullup resistor ( labelled R2 ) looks remarkably strong in that application, especially in the case where multiple devices could be triggered simultaneously. What was the reason for this choice of value ?

From other circuit examples using the TCRT5000 reflective sensor. Sorry newbie to Arduino and basic electronics. What would you recommend to use instead?

FYI just put a 10k across DI 10 & GRD and with D11 connected to #3 circuit and 11 is not triggering 10 now and vice versa. So guess floating was the problem so thank you all for your help. Guess until I wire all my sensors up I need to use the 10k to GRD for each.

One last Q please. Using the attached circuit and resistor values will this circuit work with the analog inputs or do i need to change the resistor value again as read somewhere DI works slightly different to AI? Thank you again

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