Hello, more so a question about stability and also the fear of not blowing an Arduino, but If I am trying to use serial communication between two Arduinos one that controls 5 servo motors, and would be powered via 6v 2400maH power supply, and the other being an Arduino controlling an Adafruit ILI9341LCD display would there be any issues communicating. I've tested Serial communication between the LCD and a just an Arduino sending data (where the power was just the single Arduino power usb), but I am worried that if I try powering both with that single battery there will be issues or will two external power supplies (one for each Arduino) be a problem.
What Arduinos?
Why two? Are the motion controls complex, is the display busy, what's the rationale for splitting the load?
Your all over the map, concern wise.
How much data is being sent/received, 4 char commands once per second, or 4000 bytes per second of motion control/display data? It matters a lot.
Powering the two from two sources, one each, no problem, just make sure the power grounds all come to one common point(called Star grounding). Prevents ground loops, which can give you fits.
I will give you a breakdown and hopefully I can explain this well, I am creating a robotic hand I have a total of three Arduinos (2 nano's, one uno).
- The uno will be only controlling the screen .
- #1 nano will be hooked up to five flex sensors
- and the last #2 nano will be connected to five servos mg996r.
I have established wireless communication between the two nanos using nrf24l01 module but now at the base of hand (a simple stand) I want to implement a screen to display the values of each individual finger angle, instead of using another module as I do not have, although that would probably make things simpler I decided on serial communication.
Inside the base of hand there is also the #2 nano (receiver) controlling the servos so I decided I would get the data being received by the #2 nano and Serial.write() an integer array[5] (five fingers) to the uno and update the screen according to that. So in total there be five sets of data being sent out nano #2.
As for the display it is quite busy, there is three main functions of screen.
- To update the finger values and display them on screen.
- To tell the user if serial communication has been established / broken (currently working fine).
- To tell the user what mode they are on (also working fine).
What would be the best idea to send this data and as for the lcd & #2 nano will that battery I said before be enough for both.
Is the complcation of using 3 processors really worth it?
Is the reason for 3 processors the number of pins required? There are remedies for that that. Gor instance GPIO pin expanders like the I2C MCP23008 (8 bits), MCP23017 (16 bits), PCF8574 (8 bits) or SPI MCP23S08, MCP23S17. Or shift registers like the SPI 74HC595 (8 bits). For servos the I2C the PCA9685 to control up to 12 servos with 2 pins.
There are also lots of LCD displays that are interfaced with I2C.
There are libraries that make using those parts easier, too.
Using those parts can free you from the hassle and instability of communication between all those processors.
The servo power supply should be capable of delivering 10 Amperes at 4.8 to 6V, or you can expect servo stability problems.
Servos briefly draw the stall current (about 2.5 Amperes for the MG996R) every time they start moving.
I agree that using three processors is definitely inefficient but I would use two but since I am using wireless modules I cannot use the nano inside the hand to do both the LCD and servos because I also have nrf24l01 connected which uses SPI pins and so does the LCD.
Here is the link to battery i've been using.
It seems to be working just fine so far.
Although will definitely look into mcp23s17
What LCD? SPI is a bus. You should be able to connect more than one device to the SPI bus, all devices share SCK, MOSI, MISO and each has its own chip select pin. I have used a RF24 radio, a Nokia 5110 LCD and a SD reader module on the same SPI bus successfully.
Oh really, I did not know that what is it that differs them then? the CE & CSN pins? because I think I do have two extra pins on my board to make that work. Is there anything I should know about having multiple on the SPI bus or does it work the same as if there was only one connected to SPI.
Which LCD do you have?
There is nothing special. MOSI to MOSI, MISO to MISO, SCK to SCK and each CE (and CSN) for unique for each device,
Each device is identified by its chip select. The LCD library and radio library should take care of that though you will need to tell the library the chip select pin number (usually in the constructor).
adafruit ili9341 2.8" display. Keep in my mind I take up 5 pwm pins due to 5 servos and also I have the nrf24l01 connected.
Question that can solve this entire problem, I already have the Uno so at this point I might as well use it, especially since the other Nano available is currently cluttered with various wires. If I use another NRF24l01 module I am able to use ILI9341 and NRF24l01 simultaneously? Because in this case I would just simply order another. As long as I use the same address is the RF24 radio able to communicate to two boards (one transmitter, two receivers)?
Why are you using wireless modules at all? Is it impossible to run wiring between the various boards?
Are you using the Servo library? If so, then there is no restriction to using only PWM pins.
I am creating a Robotic hand that is capable of being controlled via glove, so that it mimics your movements. The wireless is just a feature I wanted to utilize while also hiding ugly mustard cables running from the hand to the controller and are sure about Servo library part and no restrictions I ran into some problems where the servo was very finicky when not using the PWM pins prior (with the library installed).
Could this be because of constant changing values? analogWrite()
Ah, ok, I didn't realize the flex sensors were separate from the robotic hand.
Without knowing more about the code, hard to tell why the servos would have been problematic. The Servo library used interrupts, so any other code that disables interrupts could caused problems.
all good just waiting for a response from this one fellow as main question was answered with the first response but I am just trying to learn more.
Servos do not need PWM pins. Any digital pin, including analog inputs, can be used to control a servo. See the Servo reference.
Servos don't use analogWrite().
I use rf24 radios with ST7735 TFT displays with no problems. I think the wiring is similar to ILI9341 displays.
Alright Ill give that a try thanks so much for your help.