Activity › Forums › Questions & Troubleshooting › Hardware › Wiring questions
-
Hello,
I have a project to manage several fish tanks using Controllino Mega and I have some troubles regarding wiring of some components.
I already plan to use Inputs A0 to A11 for sensors dedicated to water level, PH, oxygen ect..
I also plan to use Outputs D0 to D18 to manage pumps, lights, DC motors ect..
Now my problems is that I still need to connect 4 Ultrasonic sensor, 1 HMI and 1 motorized valve.
The 4 Ultrasonic sensors are the following :
https://wiki.dfrobot.com/A02YYUW%20Waterproof%20Ultrasonic%20Sensor%20SKU:%20SEN0311
With a classical Arduino Mega board I would have use digital inputs pins like for example 8 to 11 for RX and 35 – 41 for TX and use the following code to get my distance value:
#include <SoftwareSerial.h>
#include <SPI.h>
//Sensor
SoftwareSerial A (8, 35); // RX, TX
SoftwareSerial B (9, 37); // RX, TX
SoftwareSerial C (10, 39); // RX, TXSoftwareSerial D (11, 41); // RX, TX
For HMI wiring I also need RX and TX.
My issue is that Digital outputs with Arduino can’t be used as Input and I still need 10 inputs to be connected (8 for Ultrasonic & 2 for HMI)
I am wondering if I can use the remaining A12 to A15 / Input 16-17-18 / IN0 & IN1 / RS485 B & A to connect the 4 ultrasonic sensors and the HMI ?
Regarding the motorized valve, I need to invert the DC current to open it or close it. I can do it using 4 relais and create a H bridge but I was wondering if there is a simplest way to invert polarity using Controllino Mega.
Thank you for reading 😊
Tornado
-
Hello Tornado,
regarding the SoftwareSerial – you can use all unused digtal outputs/inputs for this purpose, but at the pinheaders, not the screw terminals.
Regarding the motor control – have you checked this tutorial?
Let us know!
Thanks,
Lukas
- This reply was modified 3 years, 10 months ago by Lukas.
Log in to reply.