Author Topic: FPGA Bluetooth Project  (Read 2284 times)

0 Members and 1 Guest are viewing this topic.

Offline Razvan1203Topic starter

  • Newbie
  • Posts: 7
  • Country: ro
FPGA Bluetooth Project
« on: November 03, 2023, 11:33:01 am »
Hello. I want to make a project involving Nexys A7 100T with the Pmod BLE Module attached to it. And separately I want to use an ultrasonic sensor (positioned at the gate outside), which measures the distance to it and transmits the data over bluetooth to my FPGA board.

For this project, which bluetooth module to use additionally near the sensor outside? Which bluetooth module is compatible to Pmod BLE Module?

And how can I make the circuit at the gate outside?

I really need any kind of advice. Thanks in advance!
 

Offline Maister

  • Contributor
  • Posts: 45
  • Country: de
  • Electronics design engineer
Re: FPGA Bluetooth Project
« Reply #1 on: November 03, 2023, 09:18:33 pm »
Hi,

there are some Arduino board with built-in BLE like the https://store.arduino.cc/products/arduino-nano-33-ble.

There us also a conprehensive library for BLE on Arduino: https://www.arduino.cc/reference/en/libraries/arduinoble/.

I would connect your ultrasonic distance sensor to that Arduino and transmit the data over BLE.
I assume you have one of those HC-SR04 sensors. You can read about how to get their data with an Arduino here: https://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-sr04/.

Additionally I found some of my old code for an Arduino to interface to one of those sensors and print over uart:

Code: [Select]
const int SENSOR_MAX_RANGE = 300;
int trigger = 5;
int echo = 2;
unsigned long duration = 0;
unsigned long distance = 0;

void setup() {

 Serial.begin(9600);
 pinMode(trigger, OUTPUT);
 pinMode(echo, INPUT);

}

void loop() {
  digitalWrite(trigger, LOW);

  delay(1);

  digitalWrite(trigger, HIGH);
  delayMicroseconds(11);
  digitalWrite(trigger, LOW);

  duration = pulseIn(echo, HIGH);
  distance = duration/58;


  if (distance > SENSOR_MAX_RANGE || distance <= 0){
    Serial.println("Out of sensor range!");
  } else {
    Serial.println("Distance to object: " + String(distance) + " cm");
  }


  delay(100);

}


I don't know enough about BLE that I cannot say for sure that the BLE Arduino is able to send data to the BLE Pmod. But I would assume it should work.

BR;
Patrick
Electronics design engineer, living in Germany.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf