im useing raspberry pi 3 with ultrasonic sensor and normal usb camera . so i will connect the raspberry pi to AZURE IOT HUB so ive setted the ultrasonic sensor in a place so if any car pass that place with very shot time so the camera will take picture and send it to Iot hub and than to azure database so . i want to know if this possible if it is . can anyone make code for me please :/ cause i have very short time and im busy on the other side of project and cause im new into this one so its will take time cause i have to search programs etc so i hope i get a nice replay :}

closed as too broad by Aurora0001, Milliways, Steve Robillard, Dmitry Grigoryev, Darth Vader Mar 28 at 16:09

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hello, sounds like a cool project and welcome to the Raspberry Pi stack exchange. If you haven't already, please take the tour and visit the help center. This question is quite broad an it is not completely clear what your asking. Please add more details and show that you have done your own research already. Thanks! – scitronboy Mar 18 at 16:20
  • @scitronboy the sensor and camera will be connected to the rasberry pi . and if the sensor detect a value so the camera will take picture and send it to iot hub and like that so i need some help in codeing or how ever cause i need to finish this project in 2 weeks and im still at the beggining – Iker Hameed Mar 19 at 10:53
  • Ok. Could you edit you answer and add some more details, for example what type of sensor and camera you have, and what part you're having trouble with? And while you're waiting for a response, you should go and learn python programming language if you haven't already. Just search google for "python tutorial" and choose one that you like. – scitronboy Mar 19 at 17:34


This can be good start for you. This example gives the time and distance calculations. You can trigger the Image capture of camera with your specified time.


I'd look at somethign like Motion https://motion-project.github.io/ to watch the camera stream and save the image if motion is detected in view of the camera. Motion can read the pi camera.

Getting the detected speed from a sensor and writing that value onto the image as an overlay would make it look more professional.

Saving images of vehicles that aren't speeding could be useful data too, depending on your requirements.

A quick google returns this https://gregtinkers.wordpress.com/2016/03/25/car-speed-detector/ as a starting point, but the example images do not capture a licence plate and do not show date/time overlay.

The speed sensor you choose will determine other things, so start there and progress forward.

  • the thing is im useing normal usb camera . not the motion detection – Iker Hameed Mar 20 at 8:36
  • @IkerHameed URL added - the motion software can read the pi camera, and call a script to do the reading of the sensor.. But sounds like your idea is to monitor the sensor for things travelling above a set speed (so not to trip on cats and people) and only take a photo when the detected speed is above some minimum. Sounds like two different design concepts. – Criggie Mar 20 at 18:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.