Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: Pin locations for Yosemitech Y510-B

Home Forums Mayfly Data Logger Pin locations for Yosemitech Y510-B Reply To: Pin locations for Yosemitech Y510-B

#16228
Sara Damiano
Moderator

AltSoftSerial only works on pins 5 and 6. That’s why there’s no place in the code to declare the Tx and Rx pins. It’s strictly limited to those two.

Is there a reason you have the two sensors on separate RS485 adapters and power supplies? I’m fairly certain that the two sensors operate on the same supply voltage. I’d suggest using the same power supply and RS485 adapter for both using terminal blocks or one of the 4 port Grove splitters to connect the lines. With only one RS485 adapter, you can connect it to the required 5&6 and use AltSoftSerial. If you really need to have different supplies and adapters, you’ll need to use NeoSWSerial or just regular SoftwareSerial for at least one of the sensors. Make sure all your various grounds are connected so you have a single common ground level.

Are you sure you have the right modbus addresses for each sensor? If you haven’t intentionally changed it, they come from the factory set as 0 or 1 – I don’t remember which. If the two sensors are in line on the same serial loop, at least one needs to be changed to a different address. If you separate them, they can have the same address. No matter how your do it, the code has to match what the sensors are set to or the sensors will just ignore the commands. Use the functions in the Yosemitech library or their Windows program to change the address.

During communication, if it’s wired right, the TX and Rx lights on your adapter should both flash extremely quickly. You should be able to tell they’re flickering, not steadily on.

What kind of adapter are you using? You should be using one with automatic flow control and powering the adapter itself at 3.3V. For every board I’ve seen, the Rx and Tx voltages will match with the Vcc voltage of the adapter. The Mayfly processor is running at 3.3V, giving it anything over 3.6 V risks frying it. So *don’t* power your adapter off the Mayfly 5V. If you have a 5V only adapter or one without flow control, just buy a new one. It’s near impossible to get the level shifting and flow timing perfect enough to communicate and it’s not worth the effort.