Файл: Interfacing with C plus plus-programing communication with microcontrolers (K. Bentley, 2006).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 14.06.2025

Просмотров: 3604

Скачиваний: 1

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

452

APPENDIX A - HARDWARE

74HC245

4046

PINS

74HC245

+5V PINS

ADC0804

ULN2803A

4093

74HC157

LM358

LM358

DAC Cct

DAC Buffer Cct

DAC0800

LM358

Figure A-17 DAC & DAC Buffer Circuit – component positions.

Figure A-18 DAC & DAC Buffer Circuit – components fitted.


APPENDIX A - HARDWARE 453

Motor Control Circuitry

Assembly

Fit and solder all the components listed in Table A-6 into their position as marked on the pcb overlay and as shown in Figure A-20 and Figure A-21.

Table A-6 Motor Control Circuitry - Bill of Materials.

Lead Spacing

Quantity

Component Description

or Footprint

Designator

4

4K7 resistor

¼ W

R34, 35, 51, 53

12

10K resistor

¼ W

R18-21, 24, 25,

45-50

8

1N4004 diode

D5-8, 11-14

4

24V zener diode

1W

ZD1, 2, 4, 5

4

BC547 npn transistor

TO-92

Q1, 2, 13, 14

4

BD649 npn darlington

transistor

TO-220

Q5, 6, 15, 16

(or equivalent)

4

BD650 pnp darlington

transistor

TO-220

Q8, 10, 17, 18

(or equivalent)

4

2 way terminal block

5mm pitch

J7, 8, 12, 13

2

4 way terminal block

5 mm pitch

J6, 11

8

Heatsink 20θC/W

HS5-12

8

Pcb pin, 0.9 – 1.0 mm diameter

8M3 screw 6-10 mm long (or equivalent)

8

M3 nut

8

M3 locking washer

Testing

Figure A-19 shows the schematic diagram for the motor control circuitry, comprising two H-bridge circuits used for driving DC and stepper motors. Ensure wire links are fitted across each two-way terminal block before testing the circuitry. Connect an external DC power supply (less than 30V) capable of powering the motor(s) (or the +12V DC 1A power pack if suitable) to the four-way terminal block connections: Power Supply +ve connects to Vm1 and Vm2, Power Supply –ve connects to Vm1 GND and Vm2 GND.


454 APPENDIX A - HARDWARE

Figure A-19 Motor Control Circuit - schematic diagram.

APPENDIX A - HARDWARE 455

The appropriate voltage from the motor power supply should be present at each of the respective two-way terminal blocks. If not, check:

Powerpack or external power supply wiring/operation, and wire links are fitted across two-way terminal blocks.

The four ‘transistor switches’ used in each H-bridge operate independently - each ‘closes’ when its logic input is taken to a high level. Each H-bridge circuit uses two types of transistor:

1.Two identical lower transistor switch circuits, each using a npn darlington transistor (e.g. Q5).

2.Two identical upper transistor switch circuits, each using a npn transistor (e.g. Q2) driving a pnp darlington transistor (e.g. Q8). Without the npn transistor, the logic input signal could not drive the pnp darlington transistor, since this darlington configuration needs to be controlled by an input voltage capable of rising close to the motor supply voltage (Vm1) to turn off the transistor. The npn transistor ‘inverts’ the logic input signal and can switch off at voltages up to Vm1. The ‘inverted’ signal then drives the pnp darlington transistor.

Test each of the transistor switches in the two H-bridge circuits in-turn. Fit a resistor, say 1K: (1000 :) as a light load in place of an actual motor across the four way terminal block contacts marked M1 and M2.

One lower npn darlington transistor and its diagonally opposing upper pnp darlington transistor circuitry will be tested at a time, all other logic inputs must not be connected. For example, logic input C and logic input B will be switched as follows:

When logic input C is wired to +5V (Q5 ON) and logic input B is wired to +5V (Q10 ON), the voltage at the four way terminal block contact, M1 should be equal to approximately 1V and M2 should be equal to approximately Vm1 minus 1V.

Repeat this test for the opposite transistor circuits in the H-bridge controlled by logic inputs A and D. This circuit test will give opposite voltages at terminal block contacts M1 (Vm1 minus approximately 1V) and M2 (approximately 1V). Should any of these tests fail, check:

Power supply operation, poor lead connections, missing wire links, shortcircuits, open-circuits, faulty soldering of components, components having incorrect value or incorrect orientation, and faulty components.

Note that the BD649 and BD650 darlington transistors used in the H-bridge (shown on the schematic with two arrows) are capable of switching currents up to 8A. Other darlington transistors with similar current capacity and matching pin configuration can be used. A 24V zener diode in series with a regular diode is connected across the BD650 darlington transistors to absorb spikes of back-emf generated during switching. The diodes across the BD649 darlington transistors limit negative voltages across the transistor to one forward-biased diode drop approximately (0.7V).


456 APPENDIX A - HARDWARE

74HC245

4046

74HC245

ADC0804

ULN2803A

4093

74HC157

LM358

LM358

DAC0800

LM358

Figure A-20 Motor Driver Circuit – component positions.

Figure A-21 Motor Driver Circuit – components fitted.


APPENDIX A - HARDWARE 457

Voltage-Controlled Oscillator Circuitry

The VCO circuit uses the Thermistor circuit for several projects within the main text. Therefore, assembling and testing the Thermistor circuit has been included with the VCO material.

Assembly

Fit and solder all the components listed in Table A-7 into their position as marked on the pcb overlay and as shown in Figure A-23 and Figure A-24.

Table A-7 Voltage-Controlled Oscillator - Bill of Materials.

Lead Spacing

Quantity

Component Description

or Footprint

Designator

VCO cct:

1

1ΠF ceramic monolithic capacitor

0.2 inch

C18

1

100K resistor

¼ W

R11

1

1M resistor

¼ W

R13

1

4046 CMOS IC

DIL16

U4

1

IC socket

16 pin

U4

2

Pcb pin, 0.9 - 1.0 mm diameter

U4

Thermistor cct:

1

0.1ΠF ceramic monolithic capacitor

0.2 inch

C9

1

100K - 470K resistor (suit thermistor

R31

- see main text Chapter 10)

1

Thermistor

RT1

Testing the VCO Circuit

Figure A-22 shows the circuit diagram for the voltage-controlled oscillator (part of the phase lock-loop IC) and the thermistor circuitry. The VCO circuit outputs a digital signal having a square waveform at a frequency proportional to the voltage applied to its input pin.

The voltage at the power supply pin of the Phase-Lock Loop IC (U4, pin 16) should be equal to approximately +5V, the same as that output by the +5V voltage regulator. If not, check:

Incorrect IC orientation, short-circuits, open-circuits, faulty IC socket connections, faulty 4046 IC, and the +5V power supply.