Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:58 19 Mar 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : Proximity detector

Author Message
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 349
Posted: 09:30am 21 Feb 2026
Copy link to clipboard 
Print this post

Does anyone know where I can find a circuit for a Proximity detector?

Any help will be appreciated.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3081
Posted: 09:54am 21 Feb 2026
Copy link to clipboard 
Print this post

Depending on the application a basic laser distance sensing module may be suitable.
The circuit is nothing more than I2C data and clock plus 3.3V and ground.
Very cheap on AliExpress.

Example MMBasic code for a VL53L0X on a PicoMite.
For other MMBasic platforms the only difference is likely to be the way I2C is setup. The relevant manual will have the details in the I2C Appendix.
'VL53L0X LASER distance using PicoMite System I2C on I2C channel 1
'change all I2C to I2C2 if System I2C is on channel 2

Dim Integer dist
Const VLaddr=&H29 'VL53L0X I2C address
'
Do
  VL53L0X
  Print dist;" mm"
  Pause 2000
Loop

Sub VL53L0X
  Local Integer dst(1)
  I2C write VLaddr,0,2,0,1   'trigger VL53L0X measurement
  Pause 75  'allow time to perform measurement
  I2C write VLaddr,1,1,30    'prepare to read
  I2C read VLaddr,0,2,dst()  'get the data
  dist = (dst(0)<<8) + dst(1) - 20  'assemble the bytes and subtract the 20mm offset.
End Sub

Edited 2026-02-21 21:57 by phil99
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026