Haha, je ne me suis pas fait avoir avec l'édit ce coup-ci

.
Guttata a écrit :Merci pour ton aide précieuse Vincent. Je ne suis pas très familier avec tous ces composants électroniques

Mais ca va rentrer
Je pense que tu es plus familier que moi dans l'immédiat. Encore une fois, malheureusement, je n'ai pas cherché à théoriser tout ce qui a fonctionné, dans la mesure où quand j'ai affronté mes problèmes de relais il y a quelques mois, je ne les attendais pas, et ils n'étaient pas les bienvenus. Du coup, je n'avais pas pu "geeker" en amont pour tout comprendre.
J'ai peut-être fait des trucs superflus, mais je ne me plains pas vu que tout fonctionne désormais. Mais c'est effectivement pas très subtil.
Peux-tu m'éclairer sur le rôle de l'ULN2803a et du MCP23017 dans ta configuration ?
Je vais essayer.
ULN20803
- C'est un grid de transistors NPN, il permet d'inverser ton instruction pour la gestion du low active ?
- Exemple :Tu lui dis 1, il convertit en 0
Je pense que oui, vu que c'est le cas chez moi (ouais, empirique, pas théorique).
Par exemple, j'ai mis l'éclairage en "ouvert pas défaut", donc, éclairage éteint par défaut. Je dois mettre la pin de mon MCP à 1 (high) pour avoir le relais qui claque, et l'éclairage qui s'allume.
Cela me permet aussi d'avoir du 5V pour faire fonctionner la carte relais, qui est censé fonctionner avec 5V, et d'interfacer avec le 3V du Raspberry.
Ca va bien avec ça aussi
The ULN2003AN Darlington Transistor Array was selected because it is amiable in an easy to solder, relatively cheap, DIP package. Further advantages of using these transistors include inverting the logic so a high bit turns the relays on, and interfacing between the 3.3V port expanders and the 5V really boards. Darlington pairs are not strictly required for this circuit (see “How to wire a Raspberry Pi to a Sainsmart 5v Relay Board” in the references) however the ULN2003AN is a nice alternative to purchasing individual transistors and resistors. Unfortunately it only providers 7 transistor pairs per chip so three ULN2003AN’s are required to cover 16 channels.
Récupéré d'
ICI.
MCP23017 'ajoute des "GPIO" et mémorise leur état ?
Pour l'ajout des GPIO, oui. J'ai un MCP23017 pour les relais, et un autre "pour le reste". Pour les leds rgb, des gpio de rab, et un en input pour l'effet hall.
Pour les états, j'ai un gros doute désormais, car, je ne retrouve pas le lien que je voulais, je trouve même l'opposé. Donc, pour le moment, oublie l'histoire de la mémorisation, j'ai peut-être dit une ineptie.
Je me souviens bien de ces liens. J'avais envoyé un email au type, je vais le coller ici, à la fin du message.
Pour être au top de l'isolation et ne pas avoir à mettre en place d'autres composants entre le Pi et le module relai:
- Un module relay opto-isolé
- Une alim externe dédiée pour le module relay
- Ne pas mettre en commun les GRD Pi et module relay
En fait, j'ai ça, et trois composants en plus entre RPI et relais du coup.
Un avis concernant :
==> Question bête mais : est-ce que ça use plus vite le raspberry de mettre du 3,3V dans les GPIO à maintenir inactif ?
Merci

Aucune idée.
Pour l'email à Terry, j'avais notamment demandé 1) j'avais pas compris qu'il disait de relier la masse à la terre du bâtiment.
1) connecting the Arduino or RPi ground to building ground is to try to keep it from begin stopped by electrical interference caused by the loads going on and off. You do this seperately from the power connection for your DC supplies, you run a seperate wire, and connect it to building wiring ground. You can do this by using a replacement grounded mains plug and connecting to only the grounding terminal, or any other way that is convenient to connect to ground.
2) When you are using the relay board with the isolation jumper out, then there are three power supplies to think about.
One is the controller (RPi) power, it powers the RPi, and the trigger circuit through the optocoupler. The +3.3 has to go to the + side of the opto trigger circuit which is the "Vcc" pin on the relay board. Connect each control signal to its relay input (like IN1). When the control signal is an output set LOW, then the trigger circuit sees 3.3V at Vcc and ground at IN1, which turns it on. When your signal is high, both sides of the trigger circuit are 3.3V, so it is off. That is why there is no ground needed from the RPi to the relay board.
The second supply powers the relay coils when the trigger circuit is turned on by the RPi. This is your added +5 supply. It is on the "hot" side (the relay side) of the isolation, so it has no ground or power in common with the RPi, it is connected from JDVcc (where the jumper was) to the input GND pin. When the trigger circuit is turned on by the RPi, the relay coil is powered by this supply.
Then finally, when the relay coil is powered, the relay closes and switches on your "big" power load, with its power supply (maybe line voltage).
Effectivement, j'ai pas eu l'air de suivre sa partie deux avec l'ULN2803A du coup...
Quand tu auras tout compris, je veux bien que tu m'expliques

.