117 Hall Effect Sensor Using the SS49E Hall Effect Sensor 0-1.es/117 Sensor GND Out VCC 104 J100 +5V Analog signal A Hall effect sensosr are a transducesr that vary their output voltage in response to a magnetic field. The output voltage is set by the supply voltage and varies linearly in proportion to the strength of the magnetic field. They are used for proximity switching, positioning or speed detection. Don't forget to connect all the ground wires together! 100nF SS49E VCC Out GND ABC Basic Connections 2018.indd 201 23/11/2017 18:04
118 Spectrum Analyzer Using the MSGEQ7 Equalizer 0-1.es/118 CKIN RESET GND IN OUT VSSA VDDA STROBE MSGEQ7 AUDIO IN 1nF200kΩ +5V Analog signal STROBE MSGEQ7 0442 103337 MSGEQ7 0442 103337 2 3 1 RESET 33pF 100nF 10nF 103 J100 33 1O4 Don't forget to connect all the ground wires together! ABC Basic Connections 2018.indd 202 23/11/2017 18:04
119 Flex Sensor Basic Connections 0-1.es/119 +5V Analog signal This flex sensor is a variable resistor whose resistance increases as the body of the component bends. Sensors like these were used in the Nintendo Power Glove and are patented technology of Spectra Symbol. Please be careful not to bend them too much, especially at the base of the device, as they can get damaged. Don't forget to connect all the ground wires together! 10kΩ ABC Basic Connections 2018.indd 203 23/11/2017 18:04
120 Piezo Sensor Basic Connections 0-1.es/120 Analog signal A K 5V1 1MΩ Piezoelectric sensors use the piezoelectric effect to measure changes in pressure, vibration, temperature, strain, or force and converted into a voltage. The piezoelectric effect is generally reversible and sensors can work also as output devices. If you open a piezo buzzer you can hack it into a piezo sensor. Don't forget to connect all the ground wires together! ABC Basic Connections 2018.indd 204 23/11/2017 18:04
121 Op-Amp Threshold Switch Using the LM358 Op-Amp 0-1.es/121 The LM358 op-amp acts as a voltage comparator so you have to adjust the 10kΩ potentiometer for your desired activation treshold. You could replace the photoresistor with any other resistive sensor! THRESHOLD 10kΩ 100nF +5V 103 J100 10kΩ LOW Don't forget to connect all the ground wires together! Pin goes when LDR is receiving light VDD OUT2 IN-2 IN+2 IN+1 IN-1 OUT1 GND LM358 LM358P 112DVSH 3 2 1 ABC Basic Connections 2018.indd 205 23/11/2017 18:04
122 DAC Using the MCP4921 12-Bit DAC 0-1.es/122 VOUT GND VREF LDAC SCK CS VDD SDI MCP4921 MCP1541 VIN VOUT VSS 100nF 10µF 16V +5V 10kΩ 3 MOSI 2 SCK 1 OUT 100kΩ OUT 103 J100 Up to 25 mA! 100Ω Don't forget to connect all the ground wires together! MCP1541 VSS VIN VOUT E/P PY0 MCP4921 1239 e3 E/P PY0 MCP4921 1239 e3 +- 10µF 25V ABC Basic Connections 2018.indd 206 23/11/2017 18:04
123 H-Bridge Using the L293D 0-1.es/123 The L293D is a quadruple high-current half-H driver. It is designed to provide bidirectional drive currents of up to 600mA at voltages from 4.5V to 36V and it is able to drive inductive loads such as relays, solenoids, DC and bipolar stepper motors. Motors power supply! Maximum 600mA per channel! 104 J100 2 DIR01 1 3 DIR10 DIR01 4 DIR10 5 6 +5V 100nF 100µF 50V +4.5���36V +- 50V 100µF ABC Basic Connections 2018.indd 207 23/11/2017 18:04
!4 5 6 123 LD293D Pinout 0-1.es/123 3,4EN VCC1 4A 4Y GND GND 3Y 3A VCC2 2A 2Y 1Y 1A 1,2EN GND GND L293DL293D MALAYSIA/ W991Z0145 Heatsink & ground Heatsink & ground PWM Speed DIR01 DIR10 PWM Speed DIR01 DIR10 DIR01 DIR10 Function Table ABC Basic Connections 2018.indd 208 23/11/2017 18:04
124 Unipolar Stepper Motor Using the ULN2803 Darlington Transistor Array 0-1.es/124 ULN2803A Stepper power supply! PINK BLUE ORANGE YELLOW RED +5V 1 A 2 B 3 C 4 D 100µF 16V Maximum 500mA per I/O pin Don't forget to connect all the ground wires together! +- 16V 100µF ABC Basic Connections 2018.indd 209 23/11/2017 18:04
4F124 Stepper Motor Basic Concepts 0-1.es/124 There exist two main types of stepper motors: unipolar and bipolar. In essence, they both work in the same way: electromagnets are turned on sequentially, causing the central motor shaft to turn. One difference between the two types is their voltage levels. Unipolar stepper motors operate only with positive voltages applied to the electromagnetic coils, e.g., 5V HIGH and 0V LOW. Bipolar stepper motors have two polarities: positive and negative, so their HIGH and LOW voltages would be, for instance, 2.5V and -2.5V respectively. This configuration requires H-bridge circuitry to reverse the current flow through the phases, producing the two polarities of the magnetic field. By energizing the phases with alternating the polarity, all the coils can be put to work turning the motor. Bipolar stepper motors have more torque because current flows through the entire coil, producing a stronger magnetic field to induce the shaft to rotate to the appropriate angle. Unipolar stepper motor Bipolar stepper motor ABC Basic Connections 2018.indd 210 23/11/2017 18:04
125 Bipolar Stepper Motor Using the L293D Motor Driver 0-1.es/125 Stepper power supply! Maximum 600mA per channel! 104 J100 1 A 2 B C 3 D 4 +5V 100nF 100µF 50V +4.5���36V Don't forget to connect all the ground wires together! +- 50V 100µF ABC Basic Connections 2018.indd 211 23/11/2017 18:04
3 4 125 Bipolar Stepper Motor Step Sequence 0-1.es/125 Step Angle Stepper motors can be driven in two different patterns or sequences: full step sequence and half step sequence. In the full step sequence, two coils are energized at the same time and the motor shaft rotates. The order in which coils have to be energized is given in the table. In the half step sequence, the motor step angle is reduced in half, therefore the number of steps and the angular resolution are doubled. Half step mode is usually preffered over full step mode. The table shows the energizing pattern of the coils. Step Full Step 1 2 3 4 A B C D HIGH LOW Half Step Step 1 2 3 4 5 A B C D 6 7 8 HIGH LOW The step angle of a stepper motor is defined as the angle traversed by the stepper motor in one step. To calculate step angle simply divide 360 by the number of steps that it takes the stepper motor to complete one revolution. In half step mode, the number of steps per revolution doubles. ABC Basic Connections 2018.indd 212 23/11/2017 18:04
126 Stepper Motor Phases 0-1.es/126 It's easy to identify which color corresponds to each phase inside the stepper motor, as well as the co��on terminals (A and B). We assume that each coil has a resistance of 30Ω. Use a multimeter and set it to the 200Ω range. Place the positive (+) terminal of the tester on a wire (e.g., blue) and with the negative terminal of the tester (-) begin measuring the resistance on all remaining wires. Blue-Green Blue-Red A+ A- B+ B30Ω 30Ω 60Ω Ω Ω ABC Basic Connections 2018.indd 213 23/11/2017 18:04
126 Stepper Motor Phases 0-1.es/126 Measuring the resistance with the rest of wire combinations, we will obtain a table with all measured values: From these measurements it can be deduced that the connections are of this type: A+ B+ A- B- A B Blue-Black Ω Blue-White Ω Blue-Yellow Ω ABC Basic Connections 2018.indd 214 23/11/2017 18:04
B1 PCINT PC6 RESET 14 1 SDA SCL 3V3 IOREF 5V Vin GND NC GND PCINT PC0 ADC0 8 23 PCINT PC1 ADC1 9 24 PCINT PC2 ADC2 10 25 PCINT PC3 ADC3 11 26 ADC4 PCINT12 PC4 27 PCINT PC5 ADC5 13 28 +7V���+12V 2.1�� Vin GND 1 ICSP Pinout PCINT PC6 14 RESET 1 GND 5V PB5 PCINT 19 5 SCK PB4 PCINT 18 4 MISO PB3 PCINT 17 3 OC2A MOSI Vin IOREF Logic reference voltage for shields Connected to the 5V bus Input voltage to the board when it's using an external power supply. Not USB bus voltage! UNO Pinout 0-1.es/B1 19 A5 18 A4 17 A3 16 A2 15 A1 14 A0 ABC Basic Connections 2018.indd 215
PWM Pin Port power group INT0 INT1 PC5 PCINT 28 13 ADC5 SCL PC4 PCINT 27 12 ADC4 SDA PB5 PCINT 19 5 SCK PD1 PCINT17 PD0 PCINT 2 16 RXD 3 TXD PD2 PCINT 4 18 PD3 PCINT19 PB4 PCINT 18 4 MISO PB1 PCINT1 15 OC1A PD7 PCINT23 13 PD5 PCINT21 11 T1 PB2 PCINT 16 2 OC1B SS 21 AREF GND PB0 PCINT 14 0 CLKO SCK ICP1 PD6 PCINT 12 22 OC0A SCK PD4 PCINT 6 20 SCK T0 OC2B OC0B 5 XCK AIN1 AIN0 GND 1 16U2 ICSP Pinout 5V RESET PB2 PCINT 16 2 PDI MOSI PB3 PCINT 2 3 PD0 MISO PB1 PCINT 3 1 SCK Absolute MAX per pin 40mA, 20mA reco��ended Absolute MAX 200mA for the entire package The total current of each port power group should not exceed 100mA PB3 PCINT 17 3 OC2A MOSI Connected to the ATmega and used for USB progra��ing and comunicating with it Power GND Physical PIN Port PIN Analog PIN Serial PIN PIN Function Interrupt PIN Control PIN IDE 0 1 2 3 4 5 6 7 8 9 10 11 12 13 18 A4 19 A5 23/11/2017 18:04
B2 LEONARDO Pinout 0-1.es/B2 RESET 13 TDI TDO 3V3 IOREF 5V Vin GND NC GND ADC7 PF7 36 TMS ADC6 PF6 37 TCK ADC5 PF5 38 ADC4 PF4 39 ADC1 PF1 40 ADC0 PF0 41 +7V���+12V 2.1�� Vin GND Vin IOREF Logic reference voltage for shields Connected to the 5V bus Input voltage to the board when it's using an external power supply. Not USB bus voltage! ON LTXRX16.00 2 ICSP Pinout 1 GND RESET 23 A5 22 A4 21 A3 20 A2 19 A1 18 A0 ABC Basic Connections 2018.indd 216
Power GND Physical PIN Port PIN Analog PIN Serial PIN PIN Function Interrupt PIN Control PIN IDE PWM Pin Port power group INT1 INT2 INT3 INT0 19 PD3 20 PD2 RXD1 TXD1 SDA SCL RTS 21 PD1 PD1 INT1 SDA 19 PD0 26 PD6 PB5 PCINT 29 5 OC1A OC4B 1 PE6 31 PC6 OC3A OC4A PB6 PCINT 30 6 OC1B OC4B 42 AREF GND PB4 PCINT 28 4 27 PD7 OC4D SCK INT.6 T0 T1 OC4D ICP3 OC4A CLK0 25 PD4 ADC8 ADC10 ADC11 ADC12 ADC13 ADC9 OC0A OC0B PD0 OC0B INT0 SCL 18 ICPI AIN0 Absolute MAX per pin 40mA, 20mA reco��ended Absolute MAX 200mA for the entire package The total current of each port power group should not exceed 100mA PB7 PCINT7 12 OC1C RESET ICSP 32 PC7 18 1 5V PB1 PCINT 19 1 SCLK PB3 PCINT3 PDO MISO PDI 11 PB2 PCINT 10 2 MOSI USB Connector Micro Type B 2 2 1 3 3 5 7 0 6 A7 4 A6 8 A8 11 13 9 A9 10 A10 12 A11 23/11/2017 18:04
0-1.es/B3 GND 6V - 20V UM6V - 20V 2.1�� microSD AP RESET Vin IOREF Logic reference voltage for shields Connected to the 5V bus Input voltage to the board when it's using an external power supply. Not USB bus voltage! 3V3 IOREF 5V VIN GND NC GND PCINT PA5 ADC5 5 32 ADC4 PCINT4 PA4 33 PCINT PA3 ADC3 3 34 PCINT PA2 ADC2 2 35 PCINT PA1 ADC1 1 36 PCINT PA0 ADC0 0 37 1 ICSP Pinout GND 5V PB7 PCINT 3 15 SCK PB6 PCINT 2 14 MISO PB5 PCINT 1 13 MOSI The maximum reccomended current you can draw is 750mA for 3.3V and 750mA for 5V RESET RESET 31 A0 30 A1 29 A2 28 A3 27 A4 26 A5 B3 FLUO WiFi Pinout ABC Basic Connections 2018.indd 217
USB Connector Micro Type B RESET Touch test Absolute MAX per pin 40mA, 20mA reco��ended GPIO pins rated at 5V Absolute MAX 200mA for the entire package PC0 PCINT 19 16 SCL PC1 PCINT 20 17 SDA GND AREF PB1 PCINT 41 9 T1 PB0 PCINT 40 8 T0 PD7 PCINT31 16 OC2A PB4 PCINT 44 12 OC0B SS SS PB2 PCINT 42 10 INT2 SCK CLKO XCK0 AIN0 PB3 PCINT 43 11 OC0A AIN1 GND 1 16U2 ICSP Pinout 5V PB2 PCINT 16 2 PDI MOSI PB3 PCINT 2 3 PD0 MISO PB1 PCINT 3 1 SCK INT0 OC1B PD1 PCINT25 PD0 PCINT 9 24 10 PD2 PCINT26 11 PD4 PCINT28 PC6 PCINT 25 23 PD5 PCINT29 14 OC1A PD6 PCINT 15 30 SCK ICP1 PD3 PCINT27 12 XCK1 RXD0 TXD0 RXD1 TXD1 13 INT1 TOSC1 OC2B Connected to the ATmega and used for USB progra��ing and comunicating with it ESP-32 Gateway PC4 PCINT 23 20 TDO TX5 PA7 PCINT 30 7 ADC7 ATMEGINT PC5 PCINT 24 21 TDI RX5 PWM Pin RESET Power GND Physical PIN Port PIN Analog PIN Serial PIN PIN Function Interrupt PIN Control PIN IDE 8 9 10 12 11 13 14 22 2 15 4 3 0 1 17 16 23/11/2017 18:04
0-1.es/B4 USB ConnMini Ty1 ICSP Pinout PCINT PC6 14 1 GND 1 PCINT PD1 TXD 17 31 0 PCINT PD0 RXD 16 30 GND PCINT14 PC6 29 2 PCINT PD2 INT0 18 32 3 OC2B PCINT PD3 19 INT1 1 5 T1 PCINT PD5 OC0B 21 9 6 OC0A PCINT PD6 AIN0 22 10 9 PCINT PB1 OC1A 1 13 4 T0 XCK PCINT20 PD4 2 8 ICP1 CLKO PCINT20 PB0 12 7 PCINT PD7 11 AIN1 23 11 MOSI PCINT PB3 OC2 3 15 12 MISO PCINT4 PB4 16 10 PCINT PB2 OC1B 2 SS 14 5V PB3 PCINT 17 3 OC2A MOSI PB5 PCINT 19 5 SCK PB4 PCINT 18 4 MISO RESET RESET B4 Nano Pinout ABC Basic Connections 2018.indd 218
nector ype B GND VIN 5V 3V3 PC6 PCINT 29 14 21 AREF 19 ADC6 A6 PC5 PCINT 28 13 ADC5 SCL 19 A5 PC4 PCINT 27 12 ADC4 SDA 18 A4 PC3 PCINT 26 11 ADC3 17 A3 PC2 PCINT 25 10 ADC2 16 A2 17 PB5 PCINT 13 5 SCK PC1 PCINT 24 9 ADC1 15 A1 PC0 PCINT 23 8 ADC0 14 A0 22 ADC7 A7 VIN Input voltage to the board when it's using an external power supply. Not USB bus voltage! Absolute MAX per pin 40mA, 20mA reco��ended Absolute MAX 200mA for the entire package The total current of each port power group should not exceed 100mA Exclusively analog Power GND Physical PIN Port PIN Analog PIN Serial PIN PIN Function Interrupt PIN Control PIN IDE PWM Pin Port power group RESET 23/11/2017 18:04
0-1.es/B5 GND 3V3 GND Vin A0 TOUT ADC 2 IO10 12 IO9 11 MOSI CS MISO IO8 13 IO11 IO7 IO6 EN 1 RESET 3 RESERVED RESERVED SDD3 SDD2 SDD1 SDD1 SDCMD CLK SDCLK Vin USB bus voltage Also known as CHPD USB Connector Micro Type B RESET FLASH 9 10 14 B5 NodeMCU Pinout ABC Basic Connections 2018.indd 219
Power GND Physical PIN Port PIN Analog PIN Serial PIN PIN Function Interrupt PIN Control PIN PWM Pin 3V3 GND 3V3 GND 21 IO3 RXD0 9 16 IO15 HSPI TXD2 RTS0 8 CS HSPI CTS0 HMOSI D 7 IO13 RXD2 7 HSPIQ 6 IO12 HMISO 6 HSPICLK 5 IO14 CLK 5 17 IO2 TXD1 4 18 IO0 CS2 3 19 IO4 2 20 IO5 1 4 IO16 WAKE 0 LOW �� firmware flashing HIGH �� normal boot 22 IO1 TXD0 CS1 10 23/11/2017 18:04
0-1.es/B6 ESP-W3.3V GND GND CHIPPU 9 SENS IO36 ADCPA RTCIO VP 5 0 ADC1_0 SENS IO39 ADCPA RTCIO VN 8 3 ADC1_3 RTCIO VDET1 IO34 10 4 ADC1_6 VDET IO35 2 RTCIO 11 5 ADC1_7 TOUCH IO32 9 RTCIO 12 9 XTAL32 ADC1_4 XTAL32 TOUCH IO33 8 RTCIO 13 8 ADC1_5 DAC_1 RTCIO6 ADC2_8 EMACRXD0 IO25 14 DAC_2 RTCIO IO26 15 7 ADC2_9 EMACRXD1 TOUCH7 RTCIO IO27 16 17 ADC2_7 EMACRXDV TOUCH5 RTCIO IO12 18 15 ADC2_5 EMAC MTDI TXD3 HSPIQ SDDATA2 HS2DATA2 TOUCH4 RTCIO IO13 20 14 ADC2_4 EMAC MTCK RXER HSPIID SDDATA3 HS2DATA3 SPIHD U1RXD SDDATA2 HS1DATA2 IO9 28 SPIWP U1TXD SDDATA3 HS1DATA3 IO10 29 SPICS0 U1RTS SDCMD HS1CMD IO11 30 TOUCH6 RTCIO IO14 17 16 ADC2_6 EMAC MTMS TXD2 HSPICLK SDCLK HS2CLK Abso12mAB6 ESP-WROOM-32 Pinout Chip Enable. High: (High: ON, Low: OFF - minimum power) Never leave CHIPPU floating! ABC Basic Connections 2018.indd 220
Power GND Physical PIN Port PIN Analog PIN Touch Pin DAC Pin Serial PIN PIN Function Interrupt PIN Control PIN IDE PWM Pin NC IO4 ADC2_0 ADC2_1 24 25 IO16 27 IO17 IO5 VSPID HS1STROBE HS1DATA7 CLKOUT3 IO23 U0RTS VSPIWP VSPIHD EMACTXD1 U0TXD EMACTXD2 EMACTXEN VSPIQ VSPICLK HS1DATA6 HS1DATA5 HS1DATA4 HSPIHD SDDATA1 HS2DATA1 CLKOUT1 VSPICS0 U2TDX U2RDX RTCIO10 RTCIO11 EMACTXD0 EMACRXCLK EMACCO180 EMACCLKOUT EMACTXER 22 IO2 ADC2_2 SDDATA1 SDDATA0 SDCLK RTCIO12 HSPIWP 23 GND IO0 EMACTXCLK 21 IO15 ADC2_3 HSPICS0 SDCMD HS2 RTCIO13 CMD SPID SPIQ SPICLK EMACRXD3 33 GND IO8 IO22 34 31 IO6 IO7 HS1DATA0 HS1DATA1 HS1CLK U2RTS U2CTS U1CTS MTD0 32 35 IO18 38 IO19 40 IO3 IO1 CLKOUT2 U0RXD U0CTS 42 IO21 41 39 36 GND WROOM-32 TOUCH0 TOUCH1 TOUCH2 TOUCH3 lute MAX per pin , 6mA reco��ended Progra��ing Port 23/11/2017 18:04
DIY Microcontroller Board Basic Connections B7 0-1.es/B7 ICSP Connections MISO SCK 1 MOSI +5V RST D13 D12 D11 RESET Use the ICSP port to burn the bootloader Use the FTDI port to upload the sketch Absolute MAX per pin 40mA, 20mA reco��ended Absolute MAX per pin 200mA for the entire package The total current of each port power group should not exceed 100mA ABC Basic Connections 2018.indd 221
D8 D7 D6 D4 D3 D2 D1 TX AN5 AN4 AN3 AN2 AN1 AN0 AGND AREF AVCC D13 D12 D11 D10 D9 D0 RX RST VCC CTS GND RX TX RTS 100nF 100nF 100nF 104 J100 16MHz A K 220Ω 100nF +5V 10kΩ Don't forget to connect all the ground wires together! Reset D5 22pF 22 A K 23/11/2017 18:04
tDIY Microcontroller Board Breadboard B7 0-1.es/B7 Step 1 of 2 ABC Basic Connections 2018.indd 222
Step 2 of 2 RTS RX TX 23/11/2017 18:04
Stepper Motor Winding Configurations B8 0-1.es/B8 6-Lead Unipolar 6-Lead Bipolar (Series) 4-Lead Bipolar 5-Lead Unipolar A B A B A B A B ABC Basic Connections 2018.indd 223
8-Lead Unipolar 8-Lead Bipolar (Series) 8-Lead Bipolar (Parallel) A B A B A B Not all manufacturers use the color schemes represented here, please check the datasheet CHCH23/11/2017 18:04
BB9 0-1.es/B9 L298N ENABLE B INPUT 3 LOGIC SUPPLY VOLTAGE VSS GND INPUT 2 ENABLE A INPUT 1 SUPPLY VOLTAGE VS OUTPUT 2 OUTPUT 1 CURRENT SENSING A CURRENT SENSING B OUTPUT 4 OUTPUT 3 INPUT 4 101N4001 A K A K A K A K A K A K A K A K OUT1 OUT2 OUT3 OUT4 100µF 50V CH1 CH2 Dt+- 50V 100µF ABC Basic Connections 2018.indd 224
L298N Motor Driver Basic Connections 1 IN1 2 IN2 3 ENAA IN3 4 IN4 5 ENAB 6 +5���+46V +5V 0nF 100nF 104 J100 0.47٠0.47٠1W Don't forget to connect all the ground wires together! 23/11/2017 18:04