Pages: 1 [2]   Go Down
Author Topic: Measuring the distance between sensor and moving car/bike  (Read 1240 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For the Sharp sensor, you can read the higher voltage with a simple voltage divider (two small resistors).

Iwas only refering to the input voltage. The output voltage of the sharp sensor is 2.3V max.

Quote
you may eventually end up sampling the voltage right in the middle of the sensor's transition from one voltage to another. If you don't want the occasional erroneous reading, you'll want to power off the sensor and power it back on to make sure you stay synchronized -- this will require two more small inexpensive parts, a current-limiting resistor and a transistor.

I did think about that too, in the datasheet there's a rough timeline that I have measured with a ruler and apparently the time of unstable output before and after a voltage change combined is roughly 1/10 of the overall measuring time of 39ms.
My intial idea (since I read how fast the Arduino is) was to read out the voltage every 10ms (havent given much though on the math yet) and out of five discard all values that haven't come up at least twice.
Since I don't know the exact period of time of the unstable readings this is not a perfect solution and I might go for yours instead.
I'm not sure which parts I will need and how to set them up though?
(The datasheet also recommends a 10yF Cap btw)

Quote
Let's talk about power supply
It will be powered by the hub generator.
Long story short, I got a battery buffered regulated 5V (Recom 7805, max 1A) and unregulated 12V (12.3max).
The 5V is used to charge my Iphone which could let the voltage drop slightly but then theres the capacitator and the sensor has a voltage regulator built in too.
« Last Edit: August 26, 2013, 09:35:57 am by palavro » Logged

Idaho, US
Offline Offline
God Member
*****
Karma: 19
Posts: 859
Special User
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well since the output is less than 3.3v, you can ignore all the stuff about AREF then. Have you seen the discussion on

https://www.sparkfun.com/products/8958

They mention a lot of the things we've already talked about, maps, taking/averaged repeated samples, etc.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the link.

According to the comments it's not working well or at all outdoors, wish I had read that a little earlier.

I've ordered the hardware last night, hope its not that bad.


Edit:

Screw me. Just found this project which is exactly what I want to build and its using ultrasonic.
« Last Edit: August 26, 2013, 01:34:58 pm by palavro » Logged

Pages: 1 [2]   Go Up
Jump to: