Problems with my project for glasses for the visually impaired, I ask for your collaboration

Hello, my name is Lucas and I am developing a project for low-cost glasses for the visually impaired. In this first prototype I made it with an Arduino nano, buzzer, 1027 vibration sensor, an aj-sr04m ultrasonic sensor (works the same as the hc-sr04 ), a basic goggle armor and a 3.7V 3000mAh lithium battery (for a smartphone).
I'm currently having some problems with this project.

The first is with the battery because the 3.7V does not supply the 5V demand of the Arduino Nano, however this is solvable with a dc-dc booster XL6019, but I don't have access to one right now and I wanted to use a homemade voltage booster, with capacitors and diodes, does anyone have a model of one for me to make at home?

The second problem would be related to the ultrasonic sensor, as I want one to put on my glasses, I wanted something more discreet but all the ones I saw on the internet are very large and not at all discreet, I wanted something that would look nice on the armor of the glasses, can you tell me someone or help me reduce mine (if you can disassemble it or something)

The third and final problem is related to the code, every time there is an object at a distance of less than 100 centimeters from my ultrasonic sensor, a buzzer and a vibrator start to work sending a 1 second pulse to each of them at the same time, however my code is only working with the buzzer, my vibrator is not working, I did a simulation in thinkercad so you can see how it is and so that you can help me with my problem. I'm new to this world of Arduino programming and I don't understand much, so I ask for your understanding for silly errors, but this is my current code below:

#define trigPin1 3
#define echoPin1 4
#define buzzer 5
const int motorPin = 2; // Pino do motor de vibração (Motor De Vibração 1027)

void setup() {
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(motorPin, OUTPUT); // Configura o pino do motor de vibração
  Serial.begin(9600);
}

void loop() {
  float duration1, distance1;

  digitalWrite(trigPin1, LOW);
  delayMicroseconds(2);

  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);

  digitalWrite(trigPin1, LOW);
  duration1 = pulseIn(echoPin1, HIGH);

  distance1 = (duration1 / 2) / 29.1;

  float a1 = distance1;
  Serial.println(a1);

  if (a1 < 100.0) {
    ativarMotorVibracao(); // Ativa o motor de vibração se a distância for menor que 100 cm
    ativarBuzzer(); // Ativa o buzzer
  } else {
    desativarMotorVibracao(); // Desativa o motor de vibração
    desativarBuzzer(); // Desativa o buzzer
  }
}

void ativarMotorVibracao() {
  digitalWrite(motorPin, HIGH); // Liga o motor de vibração
  delay(200); // Vibra por 2 segundos
  digitalWrite(motorPin, LOW); // Desliga o motor
  delay(50); // Aguarda 0,5 segundos
}

void desativarMotorVibracao() {
  digitalWrite(motorPin, LOW); // Garante que o motor esteja desligado
}

void ativarBuzzer() {
  tone(buzzer, 523); // Ativa o buzzer (tom de 523 Hz)
}

void desativarBuzzer() {
  noTone(buzzer); // Desativa o buzzer
}digite ou cole o código aqui

You made all that work with a 4v battery?

Done.

Probably due to the batt... you should not connect a motor directly to the Arduino.

1 Like

I'm currently using the notebook's USB port, however I intend to use this 3.7v battery and use a voltage multiplier, raising it to approximately 6V, (I've already used 2 3.7v batteries leaving it at 7.4V and then I managed to get everything works) but I want to compact the project

In this regard I was referring to the sensor on the glasses because currently it is right in the middle of the glasses, I will show you a photo

I didn't know that I couldn't connect the motor directly to the Arduino, thank you, I'll make this change!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.