Introduction: A3 Instrument

ENGLISH

Simply :

A3 :

- Autonomous

- Autodidact

- Autotune

Goals :
- Capture sound with the microphone.

- Amplify filter and digitize the signal.

- Compute and display the FFT.

- Digitally modulate the signal.

- Amplify the signal and restitute it to a speaker.

Additional information:

All the objectives are not achieved.

Precisely, those :

- Display of the FFT on the LT24 screen (Indeed the FFT values are computed in the HPS, but the LT24 screen and the HPS are not in communication)

- Digital modulation of the signal

Bill of Materials :

- DE0-Nano-SoC Board.

- Terasic LT24 Screen

- Operational amplifier TL081CP *3

- Voltage Converter MAX660

- USB Port

- Ultrasonic Ranging Module HC-SR04

- Switch

- 10 kOhms Potentiometers

- 1000µF Condensator

- 1J63 Condensator *2

- 22nJ250 Condensator *2

- 1K63 Condensator *2

- 10nF Condensator

- 1µF Condensator

- 220µF Condensator

- 10µF Condensator *7

- 1 kOhms Resistor *3

- 39 kOhms Resistor

- 22 kOhms Resistor

- 3,3 kOhms Resistor

- 150 kOhms Resistor

- 10 Ohms Resistor *3

- 1 MOhms Resistor

- 150 Ohms Resistor

- 330 Ohms Resistor

- 6,8 kOhms Resistor

- 4,7 kOhms Resistor

- Diode Schottky

- Velleman ENERGY Battery

- Ribbon Cable

- WS2812 LEDs Strip

Tools :

- Quartus

- Altium

- PuTTY

- KissFFT

FRANCAIS

Simplement :

A3 :

- Autonome

- Autodidacte

- Autotune

Objectifs :

- Capturer le son avec un microphone

- Amplifier, filtrer, et numériser le signal.

- Calculer et afficher la FFT

- Moduler numériquement le signal.

- Amplifier le signal et le restituer avec un haut parleur

Informations complémentaires:

Tous les objectifs cités ne sont pas encore atteints.

On retrouve notamment dans ce cas :

- Affichage de la FFT sur l'écran (les valeurs de la fft sont belles et bien calculées côté HPS, il manque cependant la communication entre le HPS et l'écran)

- Modulation numérique du signal

Liste de Matériel :

- Carte DE0-Nano-SoC

- Ecran Terasic LT24

- Amplificateur opérationnel TL081CP *3

- Convertisseur de tension MAX660

- USB Port

- Capteur Ultrason HC-SR04

- Interrupteur.

- Potentiomètre 10 kOhms

- Condensateur de capacité 1000µF

- Condensateur 1J63 *2

- Condensateur 22nJ250 *2

- Condensateur 1K63 *2

- Condensateur de capacité 10 nF

- Condensateur de capacité 1 µF

- Condensateur de capacité 220 µF

- Condensateur de capacité 10 µF *7

- Résistance 1 kOhms *3

- Résistance 39 kOhms

- Résistance 22 kOhms

- Résistance 3,3 kOhms

- Résistance 150 kOhms

- Résistance 10 Ohms *3

- Résistance 1 MOhms

- Résistance 150 Ohms

- Résistance 330 Ohms

- Résistance 6,8 kOhms

- Résistance 4,7 kOhms

- Diode Schottky

- Batterie velleman ENERGY

- Câbles en nappe

- Ruban de LEDs WS2812

Outils :

- Quartus

- Altium

- PuTTY

- KissFFT

Step 1: Partie Analogique : Entrée // Analog Part : Entry

ENGLISH

First, you have to make the PCB of the entry part

This entry is divided in 3 stages :

- Microphone

- Preamplifier (TL081CP)

- Automatic Gain Control circuit (TL081CP)

- Voltage Converter circuit (MAX660)

FRANCAIS

Tout d'abord, il faut réaliser le PCB du schéma de l'entrée de la carte DE0 Nano SoC.

Cette entrée est composé des étage suivants:

- Microphone.

- Montage Préamplificateur. (TL081CP)

- Montage amplificateur à Contrôle Automatique de Gain (TL081CP)

- Montage inverseur de tension (MAX660)

Step 2: Partie Analogique : Sortie // Analog Part : Output

ENGLISH

Then, you have to make the PCB from the output of the DE0-Nano-SoC to the speaker.

Main stages :

- The DAC (MCP4821-E/P) which turn the digital signal from the DE0-Nano-SoC into an analog signal.

- The first order smoothing filter to smooth the signal drom the DAC.

- The audio power amplifier (LM386-1/NOPB)

FRANCAIS

Ensuite, on réalise le PCB de sortie de la carte jusqu'au Haut Parleur.

Les étages notables :

- Le montage du DAC (MCP4821-E/P) qui permet de convertir le signal numérique sortant de la carte DE0-Nano-SoC en un signal analogique.

- Filtre de lissage du premier ordre pour lisser le signal en sortie du DAC.

- Montage Amplificateur de puissance (LM386N-1/NOPB).

Step 3: Connexion À La Carte DE0-Nano-SoC // Connection to the DE0-Nano-SoC Board

ENGLISH

Now that you have the PCB, you can connect them to the DE0-Nano-SoC board. First you can connect the "entry" part to the ADC, included in the card, following the scheme above.

Same thing for the analog part "output", where the two parts are connected thanks to a SPI protocol where the "Master" is the board and the "Slave", the DAC :

- MOSI : Connected to the pin 4 (SDI) of the DAC.

- SCLK : Connected to the pin 3 (CLK) of the DAC.

- SS : Connected to the pin 2 (CS) of the DAC.

- GND : Connected to the ground of the "output" PCB.

FRANCAIS

Maintenant que les deux PCB sont faits on va pouvoir les connecter à la carte DE0-Nano-SoC. On connecte la partie analogique "Entrée" à l'ADC de la carte DE0-Nano-SoC selon le schéma ci-dessus.

De même pour la partie analogique "Sortie", où les deux parties sont connectés selon un protocole SPI où la carte est le "Maitre" et le DAC le "Slave" :

- MOSI : branché à la patte 4 (SDI) du DAC.

- SCLK : branché à la patte 3 (CLK) du DAC.

- SS : branché à la patte 2 (CS) du DAC.

- GND : branché au ground du PCB de sortie.

Step 4: Ajout Des Modules // Addition of Modules

ENGLISH

Ultrasonic Ranging Module HC-SR04 :

Before connecting the 'ECHO' pin to the board's GPIO pin, you have to realize a voltage divider to reduce the voltage on the GPIO pin, since it accepts no more than 3.3V when the 'ECHO' pin delivers 5V.

WS2812 LEDs strip :

LEDs are connected to the GPIO pins of the board. When the program is running the LEDs change their color depending on the distance between the HC-SR04 sensor and an obstacle.


FRANCAIS

Capteur Ultrason HC-SR04 :

Avant de brancher à une pin GPIO, il faut réaliser un pont diviseur de tension entre la pin ECHO du capteur et la pin de la carte, pour ne pas envoyer du 5V sur cette dernière qui n'acceptent que du 3,3V au max.

Ruban de LEDs WS2812 :

Les LEDs sont connectés aux pins GPIO de la carte. Quand le programme est lancé, les LEDs vont changer de couleur en fonction de la distance entre le capteur HC-SR04 et un éventuel obstacle.

Step 5: Partie Numérique : Projet Quartus // Numeric Part : Quartus Project

ENGLISH

STEP 1 : LOAD THE .SOF FILE

- Connect the DE0-Nano-SoC board to your PC via USB BLASTER port.

- Open the .qpf file on Quartus.

- Go to Tools > Programmer > Right click on the files list > Change file > Slect the .sof file.

STEP 2 : FIX THE IP ADDRESS OF THE BOARD

- Connect the DE0-Nano-SoC board to your PC via UART port.

- Launch PuTTY, and connect to the board (COM3)

- Terminal opens, connect as root.

- Enter the following line : ifconfig eth0 IP (The IP that you had configured in your computer's parameters)

STEP 3 : LOAD THE PROGRAM

- On PuTTY, connect to the board via ssh protocol with the IP that you used previously

- Connect as root

- Via and EDS terminal, go to the project directory :

cd /cygdrive/c/quartus_design/HPS_CONTROL_FPGA_LED/software

(The path to the project the in the /software file)

- Enter the following command :

scp ./ULTRA_PROJECT root@IP:/home/root

(with the IP previously specified)

FRANCAIS

ETAPE 1 : CHARGER LE FICHIER .SOF

- Connecter la carte DE0-Nano-SoC à votre PC par le port USB BLASTER.

- Ouvrir le fichier .qpf du projet sur Quartus.

- Cliquer sur Tools > Programmer > clic droit sur la liste des fichiers > change file > sélectionner le .sof

ETAPE 2 : FIXER L'ADRESSE IP DE LA CARTE

- Connecter la carte DE0-Nano-SoC à votre PC par le port UART.

- Lancer PuTTY, et connectez vous à la carte (entrer COM3)

- Un terminal s'ouvre, connectez vous en tant que root

- Entrer la commande ifconfig eth0 IP (L' IP fixe que vous auriez préalablement configuré dans les paramètres de votre ordinateur)

ETAPE 3 : CHARGER LE PROGRAMME

- Sur Putty, connectez vous à la carte via ssh en entrant l'adresse IP que vous avez entré à l'étape précédente

- Connectez vous en tant que root

- Via un terminal EDS, rendez vous à l'emplacement de votre projet (via la commande cd), dans le sous-dossier software (là ou se trouve le main.c). Exemple :

cd /cygdrive/c/quartus_design/HPS_CONTROL_FPGA_LED/software

(Chemin jusqu'au projet puis dans le fichier /software/)

- Compilez votre programme à l'aide de la commande make

- Entrer ensuite la commande :

 scp ./ULTRA_PROJECT root@IP:/home/root

(avec l'adresse IP spécifiée précédemment)