Nano help...

Joined
Jul 4, 2017
Messages
221
I want to get two Nano's to talk to the same LCD. Plan to use U8GLIB with 128x64 LCD with ST7290.

Need bothto output 5 analogRead() to same LCD. I want to read the voltages from a 10S pack and display it on the same page of the same LCD. Is it possible? Do I have to make the Nanos talk in serial/slave/ master or just plug up the pins of the LCDs. Aquick search turned up nothing. I have not tried to wire & code it yet, figured I would ask to see if it's doable BEFOREHAND, so I didn't loose any more hair...I know there are some pros around and I thank you in advance for the assistance.
 
Inverted18650 said:
I want to get two Nano's to talk to the same LCD. Plan to use U8GLIB with 128x64 LCD with ST7290.

Need bothto output 5 analogRead() to same LCD. I want to read the voltages from a 10S pack and display it on the same page of the same LCD. Is it possible? Do I have to make the Nanos talk in serial/slave/ master or just plug up the pins of the LCDs. Aquick search turned up nothing. I have not tried to wire & code it yet, figured I would ask to see if it's doable BEFOREHAND, so I didn't loose any more hair...I know there are some pros around and I thank you in advance for the assistance.

Only one can write to the LCD. You will need to use this slave master code, so one can talk to the other.https://www.arduino.cc/en/Tutorial/MasterWriter

So the Slave will have to talk to the Master, then only the Master can write to the LCD. I don't believe there would be any other way.
 
I would create a uC that takes care of the LCD and then the "slaves" if you want to call it like that talks to that one and prints out to the LCD. Many protocols out there that will handle it just fine. Heck you could even use serial protocol straight out and have different timings and retransmit. :)
 
wim said:

Eaiser to do master slave code. Even if you need 3 nanos. Thats how I planned my weather station. Still a work in progress. 2 receivers one master


daromer said:
I would create a uC that takes care of the LCD and then the "slaves" if you want to call it like that talks to that one and prints out to the LCD. Many protocols out there that will handle it just fine. Heck you could even use serial protocol straight out and have different timings and retransmit. :)

Excellent idea. Never thought of that. But Arduino has such limited recorces. I just cheat. Nanos are so cheap.
 
@Geek, I'll try it and thanks for the link as well.

@Daromer: I'll also check out the uC method, thank you. Sounds like it would take me a bit longer and I don't have/ want to invest that much time into getting this up and running right now though, so it will be a future lesson for me.

@Wim, I only have a couple I2C boards and they are being used. No time to wait for new ones to arrive.

Thanks everyone, hopefully Geeks plan is fast and easy so I can move forward with my BMS project videos
 
Personally, I would just pick a processor with enough IO to handle the requirements in a single device and make it easier for myself. Maybe an Arduino Mega or similar.
But if I had to use two nanos, I would make one the master to read its 5 inputs and display them, and also enable the serial port to receive the other 5 data values from the slave.
The slave could send the data to the master pre-formatted as text strings, with the channel number prepended and the master just updates the relevant LCD section.
One question I have though, how are you isolating the 5 voltage for each processor, so it can measure them with reference to it's own ground?
 
Inverted18650 said:
...the pack under test also powers the Nanos so common ground is fine

But doesn't that mean that the 10th cell is going to befeedingup to 42Vinto the processors analogue input pin?
 
I put a buck converter on the pack brotha...and use a CC/CV PsU to power the Nanos. I wired one of my D3806 to the battery and it's output powers the Nanos and LCD


Here it is.
image_tgcyje.jpg
 
I understood the supply voltage part.
It was analogue reading connections that I was curious about. Unless I misunderstood, then assuming you have 10 cells in series each at 4.2V, then:

analogue input 1 will see 4.2V (fine),
analogue input 2 will see 8.4V,
analogue input 3 will see 12.6V,
etc all the way up to 42V.

The microprocessors will treat you to some magic white smoke at that voltage?
 
Sorry, i think I see what you mean, am I using two inputs per cell to measure the voltages? If so how do I plan to do that with just two Nanos?


I was planning to do a voltage divider network but now I'm not sure it will work, you've got me thinking here, I should have some time this afternoon to sit and try it. Maybe the voltage divider won't work...we shall see.

What ideas you got if it fails?
 
Inverted18650 said:
Sorry, i think I see what you mean, am I using two inputs per cell to measure the voltages? If so how do I plan to do that with just two Nanos?


I was planning to do a voltage divider network but now I'm not sure it will work, you've got me thinking here, I should have some time this afternoon to sit and try it. Maybe the voltage divider won't work...we shall see.

What ideas you got if it fails?



Optocoupler? Never used one, but common place in power supplies, to separate voltage and monitor.

Mike has a thread about this topic.
 
Voltage divider work but as i understand it the more you divide the less resolution you will get to spare and you need to tune the division alot. I was doing that in beginning and i only got it jumping all over the place and ended up with 1 nano per 2-3 cells and those talk over optocoupled serial link.
It works fine for first 3-4-5 cells and so forth but when closing to 14th it was not very accurate. And i tried using up to 20bit AD

Optocouplers i looked at as well but for those that are linear they got expensive so it was cheaper to buy a set of nanos to do the job.
If you find any that do work that would be awesome!
 
daromer said:
Voltage divider work but as i understand it the more you divide the less resolution you will get to spare and you need to tune the division alot. I was doing that in beginning and i only got it jumping all over the place and ended up with 1 nano per 2-3 cells and those talk over optocoupled serial link.
It works fine for first 3-4-5 cells and so forth but when closing to 14th it was not very accurate. And i tried using up to 20bit AD

Optocouplers i looked at as well but for those that are linear they got expensive so it was cheaper to buy a set of nanos to do the job.
If you find any that do work that would be awesome!

Sweet. 1 nano per 1s. Then you have all the eeprom you need for data logging. Cheaper than anything else. Never thoug of it that way. Could easy get the master to alert uo of cell imbalance.
 
Inverted18650 said:
What ideas you got if it fails?

As you and the others said, voltage dividing is probably not going to be accurate enough since, taking the 10th cell as example, if you divided 42V down to say 4.2V, then the working voltage range for that cell at the analogue input will be 4.08 to 4.2 (assuming 3 to 4.2V range for the cell itself)

So assuming the A/D is 10-bit and its range is 0-5V (haven't checked the datasheet though) then 4.08V will convert to 834 and 4.2V will convert to 859.

In other words you only have about 25 steps to represent the entire working voltage range of the cell.

Now, if you could invent a voltage subtracter that would be awesome!

So yes, having one nano per cell is probably the way to go. Although you still need to figure out a way to get the data out of them all and into a master of some kind.

You could send serial data out from each, via an opto coupler, but then you have 10 separate serial signals, and no Arduinos have that many ports.

So if I were doing it I would probably daisy chain the nanos (again via opto coupler). So the first nano sends its reading to the second, Then second nano repeats it and add it's own and so on.

Then the final nano will output all 10 samples to be read by the master and used, displayed, whatever.
 
Daisy chain or just use protocol where the master calls for the slaves or a serial that works with multiple slaves like I2C or other?
 
Yeah, I though about I2C, but it would be more complex to implement in this scenario because the lines have to be bidirectional and operate in a tri-state way, which is non-trivial when you have to have opto couplers in line. Also each nano will have to have a unique I2C address, so you would either have to put different code in each or add a dipswitch on each to set its address.
The nice thing with the daisy chain method is that they are self addressing, so you cannot have a discrepancy between their address and the order in which you physically connect them.
 
True.
 
Back
Top