En-tete ASCII arduino

De Les Fabriques du Ponant
Aller à : navigation, rechercher

Dans les programmes arduino il est parfois utile d'avoir le schéma de brochage

Voici de quoi intégrer au code des schéma.

Exemple : le petit Bot

////////////////////////////////
//         Programme          //
//         Petit Bot          //
//  Les petits débrouillards  //
////////////////////////////////
/*

                                _________________
                               /     D1 mini     \
                              |[ ]RST        TX[ ]|
                              |[ ]A0  -GPIO  RX[ ]|
                              |[ ]D0-16    5-D1[X]|----\
                              |[ ]D5-14    4-D2[X]|--\  \
                              |[ ]D6-12    0-D3[ ]|  |   |
                              |[ ]D7-13    2-D4[ ]|  |   |
                              |[ ]D8-15     GND[X]|  |   |
                              |[ ]3V3        5V[X]|  |   |
 _                            |       +---+       |  |   |
| |                           |_______|USB|_______|  |  /                           _
| |       _                                         /  /                  _        | |
| |     _| |_________                         _____/  /         _________| |_      | |
| |    |    ______   |_data D1______________/        |_data D2_|   ______    |     | |
| |  __|   | SG90 |  |_______________GND_______________________|  | SG90 |   |___  | |
| |_|      |Servo |  |_______________Vin_______________________|  |Servo |       |_| |
| |_|      |Gauche|  |                                         |  |Droit |       |_| |
| | |__    |______|  |                                         |  |______|    ___| | |
| |    |__   ________|                                         |_________   __|    | |
| |       |_|                                                            |_|       | |
| |                                                                                | |
|_|                                                                                |_|

 Matériel :
  - des fils dupont.
  - deux servomoteurs à rotation continue
  - un D1 mini
  - une batterie 5V (C'est quoi une "terie" ? demanda Robin, interloqué, à Batman.).

    ___
  / ___ \
 |_|   | | 
      /_/
      _   ___   _
     |_| |___|_| |_
          ___|_   _|
         |___| |_|
  Les petits Débrouillards 2024 - CC-By-Sa http://creativecommons.org/licenses/by-nc-sa/3.0/
*/

Présentations du programme

////////////////////////////////////
//         En-tête Type           //
//     Code Arduino/Wemos/ESP32   //
//     Les petits débrouillards   //
//   Mis à jour le 27 juil. 2024  //
////////////////////////////////////
/*
Ce programme blablabli...blablabla
*/

Caractère utiles pour fabriquer des trucs

/*



Ω
*/

Composants électroniques

/*
photorésistance
 -(w)-

résistance
 -W-

Condensateur
  _____
 ||    |
 ||1000|
 || µF |
 ||____|
  |   |
  -   +
LED
    __
  /    \
 |      |
 |______|
|_______|
   |  |
   |  |
   |  
   +  -
   

*/

Micro-controlleurs

/*

Arduino
                                          +-----+
             +----[PWR]-------------------| USB |--+
             |                            +-----+  |
             |         GND/RST2  [ ][ ]            |
             |       MOSI2/SCK2  [ ][ ]  A5/SCL[ ] |
             |          5V/MISO2 [ ][ ]  A4/SDA[ ] |
             |                             AREF[ ] |
             |                              GND[ ] |
             | [ ]N/C                    SCK/13[ ] |
             | [ ]IOREF                 MISO/12[ ] |
             | [ ]RST                   MOSI/11[ ]~|
             | [ ]3V3    +---+               10[ ]~|
             | [ ]5v    -| A |-               9[ ]~|
             | [ ]GND   -| R |-               8[ ] |
             | [ ]GND   -| D |-                    |
             | [ ]Vin   -| U |-               7[ ] |
             |          -| I |-               6[ ]~|
             | [ ]A0    -| N |-               5[ ]~|
             | [ ]A1    -| O |-               4[ ] |
             | [ ]A2     +---+           INT1/3[ ]~|
             | [ ]A3                     INT0/2[ ] |
             | [ ]A4/SDA  RST SCK MISO     TX>1[ ] |
             | [ ]A5/SCL  [ ] [ ] [ ]      RX<0[ ] |
             |            [ ] [ ] [ ]              |
             |  UNO_R3    GND MOSI 5V  ____________/
              \_______________________/

Arduino Pro-micro (Peut émuler un clavier comme Léonardo).
                      _________________
                     |    Pro   micro   |
                     |    ATmega32U4    |
                     |[ ]10-A10  A9-9[ ]|
                     |[ ]16-MOSI A8-8[ ]|
                     |[ ]14-MISO    7[ ]|
                     |[ ]15-SCLK A7-6[ ]|
                     |[ ]18-A0      5[ ]|
                     |[ ]19-A1   A6-4[ ]|
                     |[ ]20-A2  SCL-3[ ]|
                     |[ ]21-A3  SDA-2[ ]|
                     |[ ]VCC      GND[ ]|
                     |[ ]RST      GND[ ]|
                     |[ ]GND     RX-1[ ]|
                     |[ ]RAW     TX-0[ ]|
                     |       +---+      |
                     |_______|USB|______|

Arduino NANO
                    +-----+
         +----------| USB |----------+
         |          +-----+          |
         | [ ]D13/SCK    MISO/D12[ ] |
         | [ ]3.3V       MOSI/D11[ ]~|
         | [ ]V.ref    _   SS/D10[ ]~|
         | [ ]A0     / N \     D9[ ]~|
         | [ ]A1   /   A   \   D8[ ] |
         | [ ]A2   \   N   /   D7[ ] |
         | [ ]A3     \ 0 /     D6[ ]~|
         | [ ]A4/SDA           D5[ ]~|
         | [ ]A5/SCL           D4[ ] |
         | [ ]A6          INT1/D3[ ]~|
         | [ ]A7          INT0/D2[ ] |
         | [ ]5V              GND[ ] |
         | [ ]RST             RST[ ] |
         | [ ]GND 5V MOSI GND TX1[ ] |
         | [ ]Vin [ ] [ ] [ ] RX1[ ] |
         |        [ ] [ ] [ ]        |
         |        MISO SCK RST       |
         | NANO-V3                   |
         +---------------------------+

ESP32 à 36 broches
                    _______________________
                   |()   ESP32-devKitV1  ()|
                   |     WIFI-BLUETOOTH    |
                   |       36 broches      |
                   |[ ]EN         23-D23[ ]|-SPI MOSI
        input only-|[ ]VP-36      22-D22[ ]|-I2C SCL
        input only-|[ ]VN-39       1-TXo[ ]|
        input only-|[ ]D34-34      3-RXo[ ]|
        input only-|[ ]D35-35     21-D21[ ]|-I2C SDA
            Touch9-|[ ]D32-32     19-D19[ ]|-SPI MISO
            Touch8-|[ ]D33-33     18-D18[ ]|-SPI CLK
              DAC1-|[ ]D25-25       5-D5[ ]|-SPI CS0
              DAC2-|[ ]D26-26     17-TX2[ ]|
            Touch7-|[ ]D27-27     16-RX2[ ]|
            Touch6-|[ ]D14-14       4-D4[ ]|-Touch0
            Touch5-|[ ]D12-12       2-D2[ ]|-Touch2-LED_BUILTIN
            Touch4-|[ ]D13-13     15-D15[ ]|-Touch3
                  -|[ ]D9-9         0-D0[ ]|-Touch1
                  -|[ ]D10-10       8-D8[ ]|-
                  -|[ ]D11-11       7-D7[ ]|-
                   |[ ]GND          6-D6[ ]|
                   |[ ]VIN           3V3[ ]| /!\ uniquement sortie
                   |   EN            Boot  |
                   |() [o]   +---+   [o] ()|
                   |_________|USB|_________|

ESP32 à 30 broches
                    _______________________
                   |()  ESP32-devKit V1  ()|
                   |     WIFI-BLUETOOTH    |
                   |       30 broches      |
                   |[ ]EN         23-D23[ ]|-SPI MOSI
        input only-|[ ]VP-36      22-D22[ ]|-I2C SCL
        input only-|[ ]VN-39       1-TXo[ ]|
        input only-|[ ]D34-34      3-RXo[ ]|
        input only-|[ ]D35-35     21-D21[ ]|-I2C SDA
            Touch9-|[ ]D32-32     19-D19[ ]|-SPI MISO
            Touch8-|[ ]D33-33     18-D18[ ]|-SPI CLK
              DAC1-|[ ]D25-25       5-D5[ ]|-SPI CS0
              DAC2-|[ ]D26-26     17-TX2[ ]|
            Touch7-|[ ]D27-27     16-RX2[ ]|
            Touch6-|[ ]D14-14       4-D4[ ]|-Touch0
            Touch5-|[ ]D12-12       2-D2[ ]|-Touch2-LED_BUILTIN
            Touch4-|[ ]D13-13     15-D15[ ]|-Touch3
                   |[ ]GND           GND[ ]|
                   |[ ]VIN           3V3[ ]| /!\ uniquement sortie
                   |   EN            Boot  |
                   |() [o]   +---+   [o] ()|
                   |_________|USB|_________|

Le même
                    _______________________
                   |()   ESP32-devKitV1  ()|
                   |     WIFI-BLUETOOTH    |
                   |       30 broches      |
                   |[ ]EN         23-D23[ ]|-SPI MOSI
        input only-|[ ]VP-36      22-D22[ ]|-I2C SCL
        input only-|[ ]VN-39       1-TXo[ ]|
        input only-|[ ]D34-34      3-RXo[ ]|
        input only-|[ ]D35-35     21-D21[ ]|-I2C SDA
            Touch9-|[ ]D32-32     19-D19[ ]|-SPI MISO
            Touch8-|[ ]D33-33     18-D18[ ]|-SPI CLK
              DAC1-|[ ]D25-25       5-D5[ ]|-SPI CS0
              DAC2-|[ ]D26-26     17-TX2[ ]|
            Touch7-|[ ]D27-27     16-RX2[ ]|
            Touch6-|[ ]D14-14       4-D4[ ]|-Touch0
            Touch5-|[ ]D12-12       2-D2[ ]|-Touch2-LED_BUILTIN
            Touch4-|[ ]D13-13     15-D15[ ]|-Touch3
                   |[ ]GND           GND[ ]|
                   |[ ]VIN           3V3[ ]| /!\ uniquement sortie
                   |   EN            Boot  |
                   |() [o]   +---+   [o] ()|
                   |_________|USB|_________|


Lolin (Wemos) D1 mini
                                     
                                _________________
                               /     D1 mini     \
                              |[ ]RST        TX[ ]|
                              |[ ]A0  -GPIO  RX[ ]|
                              |[ ]D0-16    5-D1[ ]| SCL
                              |[ ]D5-14    4-D2[ ]| SDA
                              |[ ]D6-12    0-D3[ ]|
                              |[ ]D7-13    2-D4[ ]| LED_BUILTIN
                              |[ ]D8-15     GND[ ]|
                              |[ ]3V3 .      5V[ ]|
                              |       +---+       |
                              |_______|USB|_______|

   _______________
  | droit | gauche|
  |-------|-------|
  | RST   |  TX   |
  | A0    |  RX   |
  | D0 16 |  D1 5 |
  | D5 14 |  D2 4 |
  | D6 12 |  D3 0 |
  | D7 13 |  D4 2 |
  | D8 15 |  GND  |
  | 3V3   |  5V   |
  |-------|-------|
*/

capteurs

/*
Capteur Capacitif TTP223
  dos
    +------------+
    |[ ]GND      |
    |[ ]I/O    □ |
    |[ ]VCC      |  
    |____________| 

  face
    +-------------+
    |[ ]VCC /‾‾‾‾\|
    |[ ]I/O|      |
    |[ ]GND \____/|    
    |_____________| 


Bouton poussoir

   |___|
  |     |
  | ( ) |
  |_____|
   |   |

Bouton d'arcade
      ______
    /________\
     |------|
     |------|
     |------|
     |______|
       |  |

Gros bouton d'arcade lumineux
      _________________
    /                   \
   /         ()          \
  /_______________________\
          |------|
          |------|
          |------|
          |------|- LED+
          |______|- LED-
            |  |


Capteur de temérature DHT22
     ___
   /_____\
  |_|_|_|_|
  |_DHT22_|
  |_|_|_|_|
  |_|_|_|_|
  |_|_|_|_|
   | | | |

Capteur de pression Température BME280
   ______________
  |()  BME280    |
  |       VCC [ ]|
  |  _    GND [ ]|
  | |_|   SCL [ ]|
  |       SDA [ ]|
  |       CSB [ ]|
  |       SDO [ ]|
  |()____________|


Capteur de distance à Ultrasons - HC-SR04
  _________________________
  |   ___     (__)    ___   |
  | //   \\ HC-SR04 //   \\ |
  ||(     )|       |(     )||
  | \\___//         \\___// |
  |    VCC TRIG ECHO GND    |
  |------[ ][ ][ ][ ]-------|


Lecteur RFID_RC522
  _____________________________________
  |                           ()        |
  |  ()R         _-_                    |
  |    F      /  _-_  \           3V3[ ]|
  |    I    /  /  _  \  \         RST[ ]|
  |    D     /  /   \  \     _    GND[ ]|
  |    -          o         |_|   IRQ[ ]|
  |    R     \  \ _ /  /         MISO[ ]|
  |    C    \  \_ _ _/  /        MOSI[ ]|
  |    5      \ _   _ /           SCK[ ]|
  |    2          -               SDA[ ]|
  |  ()2                           ___  |
  |____________________________()_|___|_|

Capteur de CO2 Senseair S8
              ________________________
             |   |° ° ° ° ° °|    |   |
          G+ |[ ]| ° ° ° ° °/     |[ ]| DVCC_out
          G0 |[ ]|° ° ° ° °/      |[ ]| UART_RxD
    Alarm_OC |[ ]|_°_°_°_°|       |[ ]| UART_TxD
    PWM 1Khz |[ ]|                |[ ]| UART_R/T
             |   |  SenseAir® S8  |[ ]| bCAL_in/CAL
             |___|________________|___|


Gyroscope et accéléromètre GY-521 - MPU6050

    _________________
   |     MPU6050   ()|
   |[ ]VCC           |
   |[ ]GND         G |
   |[ ]SCL   ___   Y |
   |[ ]SDA  |   |  | |
   |[ ]XCA  |___|  5 |
   |[ ]XCL         2 |
   |[ ]ADO      Y  1 |
   |[ ]INT  ->X |    |
   |_______________()|


Capteur de couleur GY-31
           ___________________________
          | ()   [ ][ ][ ][ ][ ]   () |
          |     INT LED S0 S1 VCC     |
          |           GY-31           |
          |           _ - _           |
          |     ( ) /       \ ( )     |
          |        /    _    \        |
          |       (    |_|    )       |
          |        \         /        |
          |     ( )  \_ _ _/  ( )     |
          |                           |
          |     GND OUT S2 S3 VCC     |
          | ()   [ ][ ][ ][ ][ ]   () |
           ---------------------------

Capteur capacitif MPR121
          _________________
         |         L  11[ ]|
         |         E  10[ ]|
         |         D   9[ ]|
    3,3V-|[X]3,3V  /   8[ ]|
         |[ ]IRQ   e   7[ ]|
      A5-|[X]SCL   l   6[ ]|
      A4-|[X]SDA   e   5[ ]|
         |[ ]ADD   c   4[ ]|
     GND-|[X]GND   t   3[ ]|
         |         r   2[ ]|
         |         o   1[ ]|
         | MPR121  d   0[ ]|
         |_________e_______|

Encodeur rotatif
  A = broche A de l'encodeur
  B = broche B de l'encodeur
  G = GND
  SW = bouton poussoir de l'encodeur

    A G B
   _|_|_|_
  |   _   |
  | /   \ |
  | \ _ / |
  |_______|
    |   |
    G   SW


Horloge
     ______________________________
    |        POWER ////////        |
   -|[ ]32k       | RTC   |        |
   -|[ ]SQW       |DS3231 |  SCL[ ]|
   -|[ ]SCL       |       |  SDA[ ]|
   -|[ ]SDA        \\\\\\\\  VCC[ ]|
   -|[ ]VCC        ___       GND[ ]|
   -|[ ]GND       |___|            |
    |______________________________|

Lecteur de carte SD
    ______________________________
   |        SD CARD  _____________|
  -|[ ]GND   MODULE |         /
  -|[ ]3,3V  [XXX]  |       / |
  -|[ ]5       =    |     /   |
  -|[ ]CS      =    |    |    |
  -|[ ]MOSI    =    |    |    |
  -|[ ]SCK .   =    |     \   |
  -|[ ]MISO    =    |       \ |
  -|[ ]GND     =    |_________\___
   |______________________________|

*/

Actionneurs

/*
Ecran OLED
     GND 5V D5 D6
  ______|_|_|_|______
  |()    * * * *    ()|
  |  GND VCC SCL SDA  |
  |  _______________  |
  | |               | |
  | |               | |
  | |               | |
  | |_______________| |
  |()_______________()|

Servomoteur
    ___
   |_°_|
  |     |
  |  ^  |
  | | | |
  | (o) |
  |     |
  |_____|
   |_°_|
    |||
    || \___ data
    | \____ Vin
     \_____ GND
    ___
   |_°_|
  |  ^  |
  | | | |
  | | | |
  | (o) |
  |Servo|
  |_____|
   |_°_|
    |||
    || \___ data
    | \____ Vin
     \_____ GND
    ___
   |_°_|
  |    / |
  |   / /
  |  / /|
  | (o) |
  |Servo|
  |_____|
   |_°_|
    |||
    || \___ data
    | \____ Vin
     \_____ GND
    ___
   |_°_|
  |     |
  |     |
  |   __|___
  | (o)_____/
  |Servo|
  |_____|
   |_°_|
    |||
    || \___ data
    | \____ Vin
     \_____ GND
              _
    _________| |_
   |   ______    |
   |  |      |   |___
   |  |Servo |       |_
   |  |      |       |_|
   |  |______|    ___|
   |_________   __|
    |||      |_|
    || \___ data
    | \____ Vin
     \_____ GND


Matrice de LED 8X8 :
          ________________
      In | O O O O O O O O | Out
      -> | O O O O O O O O | ->
  VCC [ ]| O O O O O O O O |[ ] VCC
  GND [ ]| O O O O O O O O |[ ] GND
  DIn [ ]| O O O O O O O O |[ ] DOut
  CS  [ ]| O O O O O O O O |[ ] CS
  CLK [ ]| O O O O O O O O |[ ] CLK
         | O O O O O O O O |
          -----------------
Lecteur MP3
                               +-------\_/--------+
                           +5V |[X] MP3-TF-16P [ ]|
            resistance 1K - RX |[X]  DFPlayer  [ ]|
                            TX |[X] __________ [ ]|
                               |[ ]|          |[ ]|
                               |[ ]|   CARTE  |[ ]|
                  Haut-Parleur |[X]|    SD    |[ ]|
                           GND |[X]|          |[ ]|
                  Haut-Parleur |[X]|          |[ ]|
                               |___|__________|___|

Haut-Parleur

       /|
      / |
   _ /  |
 -| |   |
 -|_|   |
     \  | 
      \ |
       \|
  |\
  | \
  |  \ _
  |   | |-
  |   |_|-
  |  /
  | /
  |/

   Ampli son : MAX98357A
    ______________________
   |()      |o  o|      ()|
   |       -|____|+       |
   |  =   =  ____  =   =  |
   |  MAX   |    |  " "   |
   | 98357A |____|   =    |
   |I2C Amp               |
   |LRC   DIN     SD   VIN|
   |[ ][ ][ ][ ] [ ][ ][ ]|
   |__BCLK__GAIN____GND___|  

  Ruban de LED WS2812B - néopixel
         _________________________    ____________
  GND ->|=   __     =   __     = /   /  __     =  |-> GND
  Din ->|=  |__| '' =  |__| '' = \   \ |__| '' =  |-> Dout
  +5V ->|=__________=__________=_/   /________ =__|-> +5V

*/

Autres infos

/*
 Matériel :
  - des fils dupont.
  - une breadbord
  - Arduino
  - ...
  Schéma de l'Arduino en ASCII-ART CC-By http://busyducks.com/ascii-art-arduinos
  Sous licence CC-By-Sa (http://creativecommons.org/licenses/by-nc-sa/3.0/)
*/
/*
    ___
  / ___ \
 |_|   | | 
      /_/
      _   ___   _
     |_| |___|_| |_
          ___|_   _|
         |___| |_|
  Les petits Débrouillards 2024 - CC-By-Sa http://creativecommons.org/licenses/by-nc-sa/3.0/
*/

catégorie