Forum Members section DIY Ferduino controller Pin confusion

Pin confusion  [SOLVED]

Ask here about your controller made with pieces purchased in other shops.

Post Number:#1 Post Sat Oct 29, 2016 12:27 pm
Posts: 32
Topics: 13
Images: 3
Solve rating: 0
Joined: Wed Oct 01, 2014 3:53 pm
Topics: 13
Age: 39
Gender: None specified
National Flag:
Great Britain
Hello Fernando.

I am building a daughter-board type single sided PCB for all components.

When I come to decide which connectors and their position, PCF8575 is very confusing.

When I am using PCF8575, I de-comment line like so..
#define USE_PCF8575 // Descomente essa linha para usar um PCF8575

so now it is correct that anything between #ifdef USE_PCF8575 and #endif will be correct for wiring?

So this applies, and is easy to understand when it comes to making PCB..

// Do not change this part if you have not a PCF8575 installed.
// Não altere esta parte se você não tem um PCF8575 instalado.
#ifdef USE_PCF8575 // Do not change this line!
const byte ozonizadorPin = 0;       // P0       // Pino que liga o ozonizador
const byte reatorPin = 1;           // P1       // Pino que liga o CO2 do reator.
const byte bomba1Pin = 2;           // P2       // Bomba que tira água da quarentena.
const byte bomba2Pin = 3;           // P3       // Bomba que tira água do sump.
const byte bomba3Pin = 4;           // P4       // Bomba que coloca água no sump.
const byte temporizador1 = 5;       // P5       // Pino que liga o timer 1.
const byte temporizador2 = 6;       // P6       // Pino que liga o timer 2.
const byte temporizador3 = 7;       // P7       // Pino que liga o timer 3.
const byte temporizador4 = 8;       // P8       // Pino que liga o timer 4.
const byte temporizador5 = 9;       // P9       // Pino que liga o timer 5.
const byte solenoide1Pin = 10;      // P10      // Liga a reposicao de água doce.
const byte alimentadorPin = 11;     // P11      // Pino que controla o alimentador automático.
const byte skimmerPin = 12;         // P12      // Pino que controla o skimmer
#endif // Do not change this line!


So, where are pins 54-69 and 80-87?

I am very confused, do you have some diagram of wiring for all of these accessories?

I am trying to reverse the code to understand so I dont bother you, but it is very frustrating with comments like above where it says
"// Do not change this part if you have not a PCF8575 installed."
I think this should read "do not change if you DO have PCF8575 installed", as it clearly defines the pins P0-P12 and would make more sense.

So I have no idea where other pins are, what am I missing, is this the RFM module?

I am mostly interested in this

const byte sensor1 = 54;   // A0;      // Pino analógico que verifica se há tensão na bóia da quarentena.
const byte sensor2 = 55;   // A1;      // Pino analógico que verifica se há tensão na bóia inferior do sump.
const byte sensor3 = 56;   // A2;      // Pino analógico que verifica se há tensão na bóia superior do sump.
const byte sensor4 = 57;   // A3;      // Pino analógico que verifica se há tensão na bóia inferior do reservatório.
const byte sensor5 = 58;   // A4;      // Pino analógico que verifica o nível do reef.
const byte sensor6 = 59;   // A5;      // Pino analógico que verifica o nível do fish only.


I just need to understand pins 54-69 and 80-87 I believe... :-$ I don't know where they come from.. MEGA finishes at 53. so it must be on i/o expansion but which?

And finally to clear up, 58 reef and 59 fish only, make no sense? Willies code says:
58 automatic top off float
59 automatic top off reservoir float

I am sure asked many times but why is the comment saying and translating to fish only/reef, these are not making much sense at all when translating and trying to work this out without asking questions..

I dont want to pester you..

Thank you for any help


Jay.

-------------------------------- Last edited Sat Oct 29, 2016 1:26 pm --------------------------------

I have noticed also that pins P0 - P12 have pins not present on PCF8575, as PCF only has pins p00-07 and p10-17

So I am unsure how to wire it..

const byte temporizador4 = 8;       // P8       // Pino que liga o timer 4.
const byte temporizador5 = 9;       // P9       // Pino que liga o timer 5.


these are not present on PCF8575 silkscreen..

Here is what I have got so far, from the sparkfun PCF8575, I know it is discontinued, but plenty of sources in china..

Image

So I have here pins p0 to p7 correct I believe?

Post Number:#2 Post Sat Oct 29, 2016 2:26 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

This is your third topic with similar questions, please come back and check the answers.

viewtopic.php?f=8&t=309

viewtopic.php?f=8&t=308

Look for this lines:

#ifdef USE_PCF8575
#ifndef USE_PCF8575


Are NOT equal.

The first line is:

if defined USE_PCF8575


The second is:

if NOT defined USE_PCF8575


Q: When a variable is defined on code?
A: When the variable is uncommented like this:

#define USE_PCF8575


In others words, when there no // before.

Q: What happens with code between #ifndef and #endif when the variable is uncommented?
A: The code will be ignored during the compilation. In others words, it's useless.

I think this should read "do not change if you DO have PCF8575 installed", as it clearly defines the pins P0-P12 and would make more sense.


This is not completely right because if I want I can swap devices between PCF pins, like this:

const byte ozonizadorPin = 0;       // P0
const byte reatorPin = 1;           // P1


To:
const byte ozonizadorPin = 1;       // P1
const byte reatorPin = 0;           // P0



So, where are pins 54-69 and 80-87?


Pins 54 to 69 are analog pins A0 to A15, see the comments.

Pins 80 to 87 does NOT exist, so you can't use this devices without swap it with a free pin in your controller.

Example when using a TFT shield the pin 7 will be free so you can use something like this:

const byte temporizador1 = 80;


To:

const byte temporizador1 = 7;



I have noticed also that pins P0 - P12 have pins not present on PCF8575, as PCF only has pins p00-07 and p10-17



CODE  - SILKSCREEN

P0 - P0
P1 - P1
P2 - P2
P3 - P3
P4 - P4
P5 - P5
P6 - P6
P7 - P7

P8 - P10
P9 - P11
P10 - P12
P11 - P13
P12 - P14
P13 - P15
P14 - P16
P15 - P17


Image


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Fri Nov 04, 2016 5:27 pm
Posts: 32
Topics: 13
Images: 3
Solve rating: 0
Joined: Wed Oct 01, 2014 3:53 pm
Topics: 13
Age: 39
Gender: None specified
National Flag:
Great Britain
Thank you Fernando, sorry to reply so late.

After going back over those posts and everything you have said, I feel like I have a full understanding now, I understood ifdef and ifndef partially, I understood it was either true or false condition, but I didnt realise it would not compile, your code has changed much since I last had it up and running, it is very fast and responsive.

I also had a stupid mode, forgetting analog pins are addressable as digital and above 53, all has come to light now :)) I admire your patience with maintaining your forum when facing this questions too often.

I have a thorough understanding of the pins now and hope to not need to trouble you on the trivials again :)

I am nearly 80% of completing the 7" inch clean version which matches your current version, nothing else is modified, I paused to continue my interconnect PCB which will simply be one sided to link up all the modules.

I wonder what do you feel about the conditions of using the ISO-power module from atlas scientific now they have released it. It was obviously not available when you designed your original PCB. I have looked at the PDF and it suggests that conductivity will interfere with the other sensors, and that it must be separate to the isolated serial expander.

If you have not seen already, the PDF is here http://www.atlas-scientific.com/_files/ ... olator.pdf and I am referring to page 8 of that PDF, and the suggested setup.

I am considering of dropping the S0 and S1, 16+17, for other pins to reclaim that serial port, What do you think? Perhaps multiplex twice the stamps serial port, or use 16+17, humm, not too crucial, did you find any interference with your setups?

I would love your PCB, if only it was for an micro ATX size PC case. I have an awesome case which my fried will CNC machine for the 7" LCD.

There is no need for an Apex around here :)

Peace and thank you

Jay

Post Number:#4 Post Fri Nov 04, 2016 6:16 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Glad to hear.

Please, give a feedback to your old topics and mark as solved.

I didn't see this circuit when I did the first version of Ferduino Mega also had not any mention in stamp's datasheet.

Then I did this shield for Sueur Aurelien using one PWR-ISO from Atlas:

Image


But it's not enough when there an EC and Ph stamp together, so I did this shield with 4 independent isolations for Christopher Kindig.

Image


Image


Now I did a new version for DIY controllers:

Image


PS. This is only a 3D render

To be assembled in a enclosure like this:

Image


I didn't any sample for this board yet but if you are interested I can sell the PCB for you and give the part list to you buy from anywhere.

The price for 3 PCBs (MOQ) from OSH Park is $ 63.80 + Shipping + Paypal fee (7.5%). This value is without any profit to me.

The two PCBs remaining you can assemble and sell to someone.


I am considering of dropping the S0 and S1, 16+17, for other pins to reclaim that serial port, What do you think? Perhaps multiplex twice the stamps serial port, or use 16+17, humm, not too crucial, did you find any interference with your setups?


I don't see need to use any new serial device to this controller but if you are interested here the solution:

Image


It can work with until 8 serial devices.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Mon Nov 07, 2016 6:53 pm
Posts: 32
Topics: 13
Images: 3
Solve rating: 0
Joined: Wed Oct 01, 2014 3:53 pm
Topics: 13
Age: 39
Gender: None specified
National Flag:
Great Britain
Thank you for your reply, this expansion is exciting, but I prefer it to be all on one PCB, So far I have added CF into PWR-ISO ON Y3, then PH, PH2 and ORP connect in Y2, Y1 AND Y0, finally, RX and TX from 4way multiplex into PWR-ISO, then arduino.

So, CF isolated into multiplex
PH, PH2, ORP not isolated into multiplex
multiplex isolated into arduino.

2x isolators are used.

I am cheap :))




Return to DIY Ferduino controller





Who is online

Users viewing this topic: No registered users and 1 guest