Ultrasonic sensor

hi ,

can i connect ultrasonic sensor to the wifi module .

if any one already done can you please share the circuit diagram

Chaithanya reddy

Hi, yes you can connect an ultrasonic sensor to any of the digital pins of the bolt Wi-Fi module.
Although in some cases you may need a voltage divider circuit between the echo pin and the digital pin of the wifi module. I have attached a very crude diagram, hope it helps.
PS : Use the voltage divider circuit if and only if the first circuit connection doesn’t work.

Hi @reddy9698 can you help me in how to get duration(or distance) from echo pin.thanks in advance.

Hi @narrajeevanreddy,

Check this project https://www.hackster.io/bolt-iot-developers-u-p-region/trash-talker-using-bolt-iot-f2af5e

Do let me know in case you need further assistance.

Hi @rahul.singh1
By using the above mentioned circuit diagram. We need to have some function that handles echo and give output as duration. If you know any such function in boltlibrary in python.Happy to know it.
If it doesn’t exists can we write it and include it in library??

this is not working as it is giving random outputs can yoou provide a code for it?

You cannot directly use an Ultrasonic Sensor with Bolt Module.

Even if you manage to connect, the module does not have a builtIn function pulseIn() like Arduino does to calculate the duration (used to calculate distance) when it gets a high input in terms of microseconds.

The random values are the sound pulses from your surroundings hitting the sensors directly.