Skip to main content

Posts

ChatGPT Voice Assisant on Raspberry Pi using custom data, ChatGPT, Whisper API, Speech Recognition and Pyttsx3

Raspberry Pi can be used to build a voice assistant using Chat GPT and Whisper API as shown here . This article shows how to customize the voice assistant application using your own data, e.g., pdf documents, financial data etc. Now, to train and create an AI chatbot based on a custom knowledge base, we need to get an API key from OpenAI. The API key will allow you to use OpenAI’s model as the LLM to study your custom data and draw inferences. The Chat GPT  library needs to be configured with an account's secret key which is available on the   website . Set the api key  OPENAI_API_KEY.   This API key let you  use OpenAI’s model as the LLM for any  custom data and draw inferences. os.environ["OPENAI_API_KEY"] = 'YOUR API KEY' Copy the custom data documents on a specific directory on Raspberry pi. e.g., /home/pi/Documents Use the  Recognizer class from the Speech Recognition library to recognize spoken words and phrases. if __name__ == "__main__": ...
Recent posts

ChatGPT Voice Assistant for Raspberry Pi Using ChatGPT, Whisper API, Speech Recognition and Pyttsx3

  OpenAI provides API for ChatGPT and Whisper models that would enable developers to access cutting-edge language and speech to text capabilities. This article shows how to use the ChatGPT and Whisper APIs from OpenAI along with Speech Recognition and text to Text-to-Speech libraries to build a voice-enabled chatbot.  Th e i nstallation instructions required Chat GPT and Whisper etc., libraries are provided  here  . First Connect USB Microphone and USB Speaker to Raspberry pi. The Chat GPT  library needs to be configured with an account's secret key which is available on the   website . Set the api key  OPENAI_API_KEY. OPENAI_API_KEY = 'Your API Key Here' openai.api_key = OPENAI_API_KEY Use the  Recognizer class from the Speech Recognition library to recognize spoken words and phrases. if __name__ == "__main__": # create a recognizer recoginzer = sr.Recognizer() mcrophone = sr.Microphone() # start the bot voice_bot(mcro...

Raspberry Pi Setup for Voice Assistant Applications Using ChatGPT, Whisper API, gTTS and Pysstx3

  Raspberry Pi can be used for providing voice assistant capabilities by integrating with ChatGPT and Whisper APIs from OpenAI. This article shows how to set up the required libraries such as Chat GPT, Whisper API, Text-to-speech Pysttx3 etc., on Raspberry Pi for enabling voice  assistant  applications.   Hardware components Raspberry Pi Micro SD Card Power Supply USB Speaker USB Microphone Recommended for initial setup USB Mouse USB Keyboard HDMI Cable Monitor Software Apps: Python ChatGPT, Whisper, Speech Recognition, Pysttx3 libraries Raspberry pi operating system needs to be installed on a micro SD card before installing any ChatGPT based libraries. Raspberry Pi Imager running on another computer can be used to copy the operating system into the SD card.  Click on 'CHOOSE OS' button and select Raspberry Pi OS (64-bit) option and select 'WRITE' button to install the operating system on the SD card. After installing Raspberry pi os on SD card, it can be insert...

Remote monitoring and notifications for temperature, pressure, humidity and air quality measurement using BME 680

This project shows how to monitor and send alert notifctaions for high accuracy gas, pressume, humidity and temperatue using BME 680 sesnsor and Hologram Nova. Things used in this project: Hardware components: Raspberry Pi Zero  BME 680 Sensor Hologram SIM Software Apps: Python Hologram CLI Install Python library required from BME 680 breakout as show in Pimoroni portal  article . The installation instructions for Hologram SIM are provided  here   First  establish  a cellular connection  using the credentials that uses a devicekey obtained from  Hologram  dashboard and the i mport BME 680 and time libarries. As described in the Pimoroni portal    article ,  sensor = bme680.BME680()  creates an instance of the sensor and it is used for taking the readings for pressure, humidity etc. #!/usr/bin/env python import bme680 import time from Hologram.HologramCloud import HologramCloud import datetime import logging # Prov...

Temperature and Humidity Monitoring Notifications

Temperature and Humidity Monitoring Project with GrovePi and Hologram Nova A Temperature and Humidity Grove sensor is used in this project to measure relative humidity and temperature. It provides relative humidity measurement expressed as a percentage of the ration of moisture in the air to the maximum amount that can be held in the air at that temperature. The relative humidity changes with temperature as air becomes hotter and it holds more moisture. Things used in this project: Things used in this project: Hardware components: Raspberry Pi Zero  WH GrovePi Zero  Gove -Temperature and Humidity  Sensor Grove LCD RGB Backlight Hologram SIM Software Apps: GrovePi  Python Hologram CLI GrovePi Zero is a HAT from  Dexter Industries   that allows Grove PIR motion sensor to connect to Raspberry Pi zero with out needing soldering or breadboards. One can plug in the Grove water sensor start programming. Grove Temperature and Humid...

Moisture Sensor Notifications

Moisture Sensor Project with GrovePi and Hologram Nova This project uses the Grove Moisture Sensor that can be used to detect the moisture of the soil or there exists water around the sensor. The sensor can just simply be inserted into the a plant’s soil and measure the moisture in the soil. Based on the data, it is possible to determine if the soil is humid or dry and it can send a notification ‘Feed me some water’ to the owner of the plant. This project shows how to use a cellular modem purpose built for IoT development from Hologram to send alerts/notifications. Things used in this project: Things used in this project: Hardware components: Raspberry Pi Zero  WH GrovePi Zero  Gove -M oisture Sensor Grove LCD RGB Backlight Hologram SIM Software Apps: GrovePi  Python Hologram CLI Grove Moisture Sensor measures soil moisture based on soil resistivity. It has the following specifications to determine if the soil is dry of humid based on th...

Motion Detection Notifications

Motion Detection Project with GrovePi  and Hologram Nova This project uses the Grove Motion Sensor that can be used to detect movement of people, animals or other objects. It also can send notifications using cellular network. Things used in this project: Hardware components: Raspberry Pi Zero W or WH GrovePi Zero  Grove PIR Motion Sensor Grove LCD RGB Backlight Hologram SIM Software Apps: GrovePi  Python Hologram CLI Grove - Adjustable PIR Motion Sensor - It uses passive infrared  motion sensor, which can detect infrared object motion up to 3 meters. It is an electronic sensor that measures infrared (IR) light radiating from objects in its field of view.  Animals, people or various objects emit heat energy in the form of radiation. This radiation is not visibile to human eye as it radiates at infrared wavelengths, but it can be detected PIR-based motion detector. These are commonly used in burglar alarms. GrovePi Zero is...