Rasathus
Posts: 45
Joined: Sat Jun 02, 2012 11:37 am
Location: Reading, UK
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 11:22 am

For anyone interested in the results with the C implementation, I managed to get it all written up last night, with the post available here ...

http://rasathus.blogspot.co.uk/2012/09/ ... 05_27.html
Pi1 - Revision 002 - Used for some circuit experimentation and learning.
Pi2 - Revision 002 - Currently powering the 'Monstrosity Rover' project.
Pi3 - Revision 004 - Raspberry Pi Laptop using a Motorola Lapdock.

Take a look @ rasathus.blogspot.co.uk

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 11:35 am

That's really interesting because from the photograph on your blog it appears that you have connected the sensor unit directly to the GPIO with nothing in between. I had assumed that these ultrasonic thingamebobs sucked up a considerable punch of power when they emit a pulse and that would probably make the Pi go "fzzzt. Arg".
So can you can just connect these things straight to the Pi, run some C and go?
You say it takes the average of ten readings as the program runs. How long does the program take to execute? (to an "ish" - is it under a second?)
Are your running the program from a standard Raspbian OS?

Thanks :)

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 1:42 pm

I've just been playing with the module (kindly sent by Rasathus).

I've connected ground to p1-6 (ground), vcc to p1-1 (3v3 power), trigger to p1-12 (gpio18) and echo to p1-16 (gpio23).

The unit technical specs suggest a current consumption of a couple of milliamps at 5V (from an eBay listing).

I've bunged a usleep(50000) at the start of the loop to allow echos time to die away. The readings still fluctuate more than I'd expect. If I get time I'll put it into an Arduino later to get a comparison.

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 3:11 pm

That's brilliant! As it happens I've got some of those modules too (or damn close anyway) and was expecting to do some sort of hefty-ish electronics and involving a PICAXE in the near future. I assume both you and Rasathus have tested it lots of times by now and nothing has gone "pop".

Without having gone into your code - is there any special reason you used gpio18 (PCM_CLK) or are you just using it as another general gpio?

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 3:50 pm

I wasn't happy with the results so plugged the unit into the 5V supply rather than 3V3. I didn't bother trying to convert the (nominally) 5V echo pin to 3V3 for the Pi. If you are of a nervous disposition add a couple of resistors as a voltage divisor for the echo pin before using the unit powered at 5V. I'd probably do that if I planned to use the unit on the Pi as a permanent fixture.

Quite a difference when pointed at the same wall!

3V3
3V3a.png
3V3a.png (32.8 KiB) Viewed 9278 times
5V
5Va.png
5Va.png (28.46 KiB) Viewed 9278 times
Each graph is of 400 readings taken at about 10Hz.

I think the moral is the unit needs a 5V supply.

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 3:53 pm

morphy_richards wrote:... - is there any special reason you used gpio18 (PCM_CLK) or are you just using it as another general gpio?
Any gpio pins would do.

Rasathus
Posts: 45
Joined: Sat Jun 02, 2012 11:37 am
Location: Reading, UK
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 4:29 pm

So the real moral is "RTFM" :-) Ill rig it up on a 5v supply with some resistors, and see if i can come up with a reading to distance mapping curve for it.
Pi1 - Revision 002 - Used for some circuit experimentation and learning.
Pi2 - Revision 002 - Currently powering the 'Monstrosity Rover' project.
Pi3 - Revision 004 - Raspberry Pi Laptop using a Motorola Lapdock.

Take a look @ rasathus.blogspot.co.uk

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 4:41 pm

It's a bit surprising. I suppose I assumed the unit would not work at all if under volted. When I was scanning the readings on screen nothing leapt out. As soon as I fed them into gnuplot the difference was plain to see!

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Thu Sep 27, 2012 8:06 pm

I hooked out a 330 and 220 resistor and have given the echo line protection. Aren't I virtuous!

The echo pulse seems to conform to the speed of sound at roughly 29.1 microseconds per centimetre.

The graph shows the ceiling at left and right. In the middle I'm slowly moving a piece of cardboard higher and higher. The 30ms peaks at the right must be no object detected. I don't know how it missed the ceiling.
t1.png
t1.png (42.55 KiB) Viewed 9257 times

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Ultra cheap ultrasonics, and a bit of a challenge

Sat Sep 29, 2012 9:42 pm

Joan said:
The echo pulse seems to conform to the speed of sound at roughly 29.1 microseconds per centimetre.

So if, according to the graph, the lowest reaing is about 1000us , then the closest measured distance for that experiment would have been about 35cm?

Can you get any readings that are closer?

This link from ebay http://www.ebay.co.uk/itm/New-Measuring ... 1c2497080b states the unit's accuracy as being 0.2cm and the cosest measurable distance as being 2cm...

So I guess thats your goal to see if you are using this sensor efficiently?

Well done peeps - thanks to you I am considering using this sensor myself...
Ostendo ignarus addo scientia.

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Sat Sep 29, 2012 10:20 pm

A graph showing a piece of cardboard being touched to the sensor and then drawn out to about a foot and back again.
0-20.png
0-20.png (55.61 KiB) Viewed 9235 times
The readings proper seem to start at approximately 90 which would be 1.5 cms (out and back). As for the accuracy you'd need to have a steadier hand than I've got waving a piece of cardboard about.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Ultra cheap ultrasonics, and a bit of a challenge

Sun Sep 30, 2012 6:57 pm

Mission accomplished then?
Ostendo ignarus addo scientia.

Rasathus
Posts: 45
Joined: Sat Jun 02, 2012 11:37 am
Location: Reading, UK
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Sun Sep 30, 2012 7:25 pm

Joan, are you using a bench power supply ? Your readings look very steady compared to mine.

Ive got a resistor divider setup like this ...

+5V Sig --> 220 Ohm resister --> +3v Sig To Pi --> 330 Ohm -- > 0V

But my readings dont look as stable as yours. Are those plots individual readings, or averaged groups ?
Pi1 - Revision 002 - Used for some circuit experimentation and learning.
Pi2 - Revision 002 - Currently powering the 'Monstrosity Rover' project.
Pi3 - Revision 004 - Raspberry Pi Laptop using a Motorola Lapdock.

Take a look @ rasathus.blogspot.co.uk

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Sun Sep 30, 2012 8:01 pm

I'm using a 12V wall-wart as I have a LCD sceen to power. I take the 12V down to 5V with a UBEC and feed that into the Pi and any other gizmos I have at the time. Frankly it's pretty noisy.

That was how I used my resistors. I think that would feed 5V * 330/550 or 3V into the Pi. Higher resistor values keeping the same ratio are probably better (up to a limit) but I had those values to hand.

I didn't do any averaging with the readings.

I tried an experiment in the 0 to 5 cm range.

I put the sensor on a focus slide and moved it between 0 and 5 cm of an obstacle.

When the sensor is touching the obstacle you actually get a very short, perhaps 1-3 microsecond, pulse. Between 0 and, say, 1.5 cms you get ghost echos suggesting the obstacle is further away.

On the plot you can see where I had to rearrange my thumb to move the focus rail. Plot is over 76 seconds @ 20Hz.
0-5cm.png
0-5cm.png (57.93 KiB) Viewed 9210 times
Data is given below. I couldn't find a way of attaching the file.

Code: Select all

0.05 3
0.10 3
0.15 2
0.21 5
0.26 3
0.31 3
0.36 2
0.41 4
0.46 2
0.52 4
0.57 2
0.62 2
0.67 4
0.72 3
0.77 0
0.82 3
0.87 2
0.92 1
0.97 4
1.02 2
1.07 4
1.12 3
1.17 3
1.22 3
1.27 4
1.32 3
1.37 2
1.42 3
1.47 2
1.52 1
1.58 2
1.63 2
1.68 2
1.73 3
1.78 2
1.83 2
1.88 3
1.93 4
1.98 2
2.03 1
2.08 1
2.13 3
2.18 4
2.23 2
2.28 0
2.33 1
2.38 3
2.43 4
2.48 1
2.53 3
2.58 1
2.63 2
2.68 1
2.73 3
2.78 3
2.83 4
2.88 4
2.93 1
2.98 2
3.03 1
3.08 1
3.13 1
3.18 1
3.23 2
3.28 2
3.33 1
3.38 2
3.43 4
3.48 3
3.54 0
3.59 2
3.64 3
3.69 3
3.74 1
3.79 2
3.84 2
3.89 3
3.94 4
3.99 2
4.04 3
4.09 3
4.14 3
4.19 4
4.24 3
4.29 3
4.34 1
4.39 4
4.44 3
4.49 4
4.54 0
4.59 1
4.64 3
4.69 4
4.74 2
4.79 4
4.84 0
4.89 1
4.94 4
4.99 3
5.04 2
5.09 4
5.14 4
5.19 3
5.24 3
5.29 4
5.34 1
5.39 2
5.44 5
5.49 2
5.54 2
5.60 2
5.65 4
5.70 3
5.75 1
5.80 1
5.85 2
5.90 2
5.95 3
6.00 1
6.05 1
6.10 4
6.15 2
6.20 1
6.25 1
6.30 3
6.35 4
6.40 2
6.45 4
6.50 2
6.55 2
6.60 2
6.65 4
6.70 4
6.75 1
6.80 1
6.85 3
6.90 3
6.95 2
7.11 1
7.17 2
7.22 2
7.27 2
7.32 1
7.37 2
7.42 1
7.47 1
7.52 2
7.57 4
7.62 4
7.68 3
7.73 4
7.78 2
7.83 4
7.88 3
7.93 1
7.98 2
8.03 2
8.08 3
8.13 4
8.18 3
8.23 1
8.28 1
8.33 4
8.38 2
8.43 4
8.48 3
8.53 0
8.58 2
8.63 4
8.68 1
8.74 131
8.79 132
8.84 136
8.89 135
8.94 158
8.99 159
9.04 185
9.09 213
9.15 216
9.20 218
9.25 200
9.30 154
9.36 135
9.41 135
9.46 112
9.51 113
9.57 117
9.62 116
9.67 116
9.72 98
9.78 121
9.83 120
9.88 121
9.93 123
9.98 121
10.04 123
10.09 125
10.14 152
10.19 176
10.25 255
10.30 82
10.35 82
10.40 82
10.46 82
10.51 82
10.56 85
10.61 85
10.67 85
10.72 88
10.77 87
10.82 88
10.87 88
10.93 87
10.98 88
11.03 89
11.08 90
11.14 89
11.19 90
11.24 91
11.29 90
11.35 91
11.40 90
11.45 90
11.50 91
11.56 90
11.61 94
11.66 95
11.71 94
11.76 93
11.82 96
11.87 97
11.92 77
11.97 79
12.03 79
12.08 79
12.13 81
12.18 82
12.24 82
12.29 82
12.34 85
12.39 85
12.44 88
12.50 89
12.55 91
12.60 93
12.65 96
12.71 96
12.76 99
12.81 98
12.86 99
12.92 99
12.97 101
13.02 102
13.07 102
13.12 101
13.18 102
13.23 102
13.28 102
13.33 101
13.39 83
13.44 101
13.49 101
13.54 102
13.60 102
13.65 102
13.70 104
13.75 101
14.03 1
14.08 104
14.13 104
14.18 105
14.24 86
14.29 85
14.34 88
14.39 110
14.45 111
14.50 112
14.55 116
14.60 121
14.65 105
14.71 104
14.76 107
14.81 108
14.86 110
14.92 110
14.97 109
15.02 135
15.07 135
15.13 138
15.18 140
15.23 140
15.28 143
15.33 142
15.39 124
15.44 124
15.49 143
15.54 124
15.60 143
15.65 143
15.70 143
15.75 143
15.81 144
15.86 143
15.91 143
15.96 143
16.01 143
16.07 143
16.12 143
16.17 143
16.22 143
16.28 143
16.33 143
16.38 144
16.43 143
16.49 146
16.54 127
16.59 126
16.64 129
16.70 132
16.75 132
16.80 138
16.85 160
16.91 166
16.96 149
17.01 152
17.06 154
17.11 156
17.17 157
17.22 159
17.27 182
17.32 185
17.38 187
17.43 187
17.48 171
17.53 171
17.59 174
17.64 174
17.69 174
17.74 174
17.80 174
17.85 174
17.90 174
17.95 174
18.01 144
18.06 174
18.11 173
18.16 174
18.22 174
18.27 173
18.32 174
18.37 174
18.42 173
18.48 174
18.53 174
18.58 179
18.63 174
18.69 174
18.74 176
18.79 177
18.84 177
18.90 177
18.95 179
19.00 179
19.05 180
19.11 179
19.16 181
19.21 185
19.26 185
19.32 207
19.37 209
19.42 213
19.47 197
19.52 196
19.58 199
19.63 198
19.68 202
19.73 202
19.79 204
19.84 206
19.89 207
19.94 210
20.00 233
20.05 232
20.10 234
20.15 235
20.21 238
20.26 237
20.31 237
20.36 218
20.42 221
20.47 222
20.52 221
20.57 222
20.63 221
20.68 221
20.73 225
20.78 224
20.84 224
20.89 224
20.94 224
20.99 224
21.05 224
21.10 224
21.15 224
21.20 224
21.25 227
21.31 224
21.36 223
21.41 224
21.46 224
21.52 224
21.57 223
21.62 224
21.67 227
21.73 226
21.78 230
21.83 232
21.88 255
21.94 254
21.99 257
22.04 258
22.09 261
22.15 262
22.20 244
22.25 246
22.30 246
22.36 248
22.41 249
22.46 249
22.51 255
22.57 254
22.62 255
22.67 277
22.72 282
22.78 282
22.83 282
22.88 285
22.93 285
22.99 284
23.04 285
23.09 266
23.14 288
23.20 267
23.25 269
23.30 268
23.35 268
23.41 268
23.46 269
23.51 269
23.56 269
23.62 271
23.67 271
23.72 271
23.77 271
23.83 272
23.88 270
23.93 272
23.98 271
24.04 271
24.09 272
24.14 272
24.19 271
24.25 271
24.30 268
24.35 268
24.40 268
24.46 285
24.51 282
24.56 278
24.61 277
24.67 251
24.72 249
24.77 248
24.82 247
24.88 243
24.93 262
24.98 258
25.03 254
25.09 254
25.14 229
25.19 227
25.24 224
25.30 220
25.35 221
25.40 218
25.45 238
25.51 236
25.56 232
25.61 208
25.66 207
25.72 204
25.77 201
25.82 199
25.87 199
25.93 199
25.98 195
26.03 167
26.08 196
26.14 196
26.19 196
26.24 195
26.29 196
26.35 197
26.40 196
26.45 196
26.50 196
26.56 196
26.61 196
26.66 196
26.71 196
26.77 196
26.82 196
26.87 195
26.92 196
26.97 196
27.03 197
27.08 197
27.13 197
27.18 214
27.24 213
27.29 212
27.34 213
27.39 210
27.45 199
27.50 183
27.55 177
27.60 174
27.66 190
27.71 182
27.76 160
27.81 157
27.87 154
27.92 154
27.97 151
28.02 141
28.07 165
28.13 166
28.18 165
28.23 11819
28.41 3
28.46 134
28.51 132
28.88 2
29.94 2
30.00 2
30.05 135
30.10 112
30.15 111
30.21 107
30.26 105
30.31 124
30.36 121
30.42 121
30.47 118
30.52 115
30.57 112
30.62 110
30.68 106
30.73 85
30.78 101
30.83 99
30.89 98
30.94 95
30.99 94
31.04 93
31.10 91
31.15 88
31.20 87
31.25 85
31.30 84
31.36 83
31.41 79
31.46 79
31.51 79
31.57 78
31.62 76
31.67 77
31.72 78
31.78 76
31.83 76
31.88 76
31.93 77
31.98 76
32.04 76
32.09 78
32.14 77
32.19 76
32.25 76
32.30 75
32.35 77
32.40 96
32.46 96
32.51 93
32.56 90
32.61 91
32.66 87
32.72 84
32.77 81
32.82 82
32.87 176
32.93 126
32.98 99
33.03 95
33.08 115
33.14 112
33.19 155
33.24 155
33.29 216
33.35 191
33.40 163
33.45 157
33.50 157
33.55 135
33.61 133
33.66 132
33.71 109
33.76 132
33.82 110
33.87 131
33.92 132
33.97 133
34.03 110
34.08 109
34.13 133
34.18 132
34.24 132
34.29 132
34.34 129
34.39 130
34.44 129
34.50 129
34.55 130
34.60 128
34.65 132
34.71 132
34.76 132
34.81 129
34.86 129
34.92 133
34.97 132
35.02 131
35.07 132
35.12 132
35.18 132
35.23 132
35.28 132
35.33 132
35.39 135
35.44 159
35.49 187
35.54 196
35.60 112
35.65 119
35.70 121
35.75 127
35.80 152
35.86 105
35.91 81
35.96 84
36.01 87
36.07 93
36.12 95
36.23 77
36.28 80
36.33 83
36.38 83
36.44 85
36.49 88
36.54 89
36.59 93
36.65 97
36.70 96
36.75 99
36.80 96
36.86 96
36.91 97
36.96 96
37.01 96
37.06 97
37.12 97
37.17 95
37.22 95
37.27 97
37.33 96
37.38 97
37.43 96
37.48 96
37.54 96
37.59 99
37.64 98
37.69 99
37.75 101
37.80 82
37.85 85
37.90 89
37.95 109
38.01 112
38.06 115
38.11 116
38.16 121
38.22 121
38.27 105
38.32 104
38.37 103
38.42 105
38.48 104
38.53 104
38.58 104
38.63 104
38.69 103
38.74 104
38.79 104
38.84 105
38.89 105
38.95 104
39.00 104
39.05 105
39.10 105
39.16 124
39.21 104
39.26 104
39.31 105
39.37 108
39.42 110
39.47 135
39.52 140
39.58 124
39.63 127
39.68 130
39.73 135
39.78 124
39.84 165
39.89 166
39.94 149
39.99 148
40.05 154
40.10 157
40.15 157
40.20 157
40.26 160
40.31 159
40.36 161
40.41 160
40.47 160
40.52 160
40.57 160
40.62 161
40.68 160
40.73 159
40.78 160
40.83 159
40.89 160
40.94 160
40.99 161
41.04 182
41.10 188
41.15 188
41.20 171
41.25 177
41.30 180
41.36 186
41.41 207
41.46 213
41.51 196
41.57 195
41.62 199
41.67 210
41.72 204
41.78 229
41.83 207
41.88 207
41.93 207
41.99 208
42.04 207
42.09 207
42.14 229
42.20 207
42.25 229
42.30 207
42.35 229
42.41 207
42.46 208
42.51 230
42.56 211
42.62 210
42.67 235
42.72 235
42.77 238
42.83 238
42.88 218
42.93 217
42.98 238
43.04 241
43.09 222
43.14 221
43.19 220
43.25 225
43.30 224
43.35 224
43.40 224
43.45 224
43.51 223
43.56 227
43.61 227
43.66 226
43.72 230
43.77 233
43.82 254
43.87 254
43.93 257
43.98 259
44.03 260
44.08 243
44.14 244
44.19 246
44.24 246
44.29 246
44.35 246
44.40 245
44.45 246
44.50 246
44.56 246
44.61 246
44.66 247
44.71 247
44.76 246
44.82 246
44.87 246
44.92 246
44.97 247
45.03 246
45.08 249
45.13 252
45.18 254
45.24 278
45.29 279
45.34 283
45.39 284
45.45 265
45.50 269
45.55 268
45.60 268
45.66 271
45.71 275
45.76 274
45.81 274
45.87 274
45.92 275
45.97 275
46.02 267
46.08 273
46.13 274
46.18 274
46.23 274
46.29 274
46.34 273
46.39 275
46.44 274
46.50 270
46.55 271
46.60 271
46.65 267
46.71 288
46.76 283
46.81 280
46.86 244
46.92 249
46.97 246
47.02 247
47.07 244
47.13 260
47.18 255
47.23 232
47.28 230
47.34 227
47.39 224
47.44 223
47.49 221
47.55 221
47.60 222
47.65 238
47.70 230
47.76 234
47.81 235
47.86 235
47.91 235
47.97 235
48.02 234
48.07 235
48.12 235
48.18 228
48.23 235
48.28 235
48.33 235
48.39 235
48.44 235
48.49 232
48.54 207
48.60 202
48.65 199
48.70 197
48.75 210
48.81 207
48.86 178
48.91 176
48.96 174
49.02 174
49.07 171
49.12 190
49.17 188
49.22 188
49.28 186
49.33 185
49.38 185
49.43 185
49.49 186
49.54 185
49.59 184
49.64 184
49.70 185
49.75 185
49.80 186
49.85 185
49.91 185
49.96 185
50.01 160
50.06 154
50.12 151
50.17 149
50.22 168
50.27 162
50.33 159
50.38 137
50.43 5908
50.49 2
50.54 129
50.59 127
50.64 126
50.70 127
50.75 126
50.80 127
50.85 127
50.90 126
50.96 126
51.01 127
51.06 126
51.11 126
51.17 127
51.22 126
51.27 126
51.32 143
51.38 141
51.43 137
51.48 135
51.53 110
51.59 107
51.64 108
51.69 10244
51.86 4
51.92 112
51.97 113
52.02 114
52.07 113
52.12 112
52.18 112
52.23 112
52.28 112
52.33 112
52.39 112
52.44 112
52.49 113
52.54 111
52.60 113
52.65 109
52.70 84
52.75 104
52.80 99
52.86 96
52.91 93
52.96 91
53.01 88
53.07 84
53.12 82
53.17 79
53.22 79
53.28 79
53.33 79
53.38 79
53.43 80
53.48 43
53.54 80
53.59 79
53.64 79
53.69 79
53.75 79
53.80 79
53.85 76
53.90 95
53.96 93
54.01 93
54.06 91
54.11 88
54.16 86
54.22 82
54.27 83
54.32 104
54.37 177
54.43 127
54.48 126
54.53 102
54.58 121
54.64 118
54.69 118
54.74 97
54.79 115
54.84 114
54.90 113
54.95 112
55.00 155
55.05 177
55.11 197
55.16 184
55.21 135
55.26 135
55.32 135
55.37 132
55.42 132
55.47 129
55.52 129
55.58 129
55.63 130
55.68 129
55.73 129
55.79 129
55.84 129
55.89 129
55.94 129
56.00 129
56.05 129
56.10 130
56.15 127
56.20 130
56.26 129
56.31 130
56.36 132
56.41 133
56.47 132
56.52 135
56.57 160
56.62 187
56.68 197
56.73 112
56.78 116
56.83 121
56.89 123
56.94 126
56.99 152
57.04 81
57.09 87
57.15 90
57.20 93
57.25 96
57.30 76
57.36 79
57.41 82
57.46 84
57.51 88
57.57 91
57.62 90
57.67 94
57.72 95
57.77 79
57.83 96
57.88 96
57.93 96
57.98 95
58.04 96
58.09 97
58.14 96
58.19 96
58.25 94
58.30 96
58.35 96
58.40 96
58.45 99
58.51 102
58.56 85
58.61 107
58.66 110
58.72 115
58.77 115
58.82 121
58.87 121
58.93 123
58.98 104
59.03 104
59.08 104
59.14 105
59.19 104
59.24 104
59.29 104
59.34 105
59.40 105
59.45 103
59.50 104
59.55 104
59.61 107
59.66 110
59.71 136
59.76 141
59.82 126
59.87 129
59.92 132
59.97 137
60.03 159
60.08 160
60.13 163
60.18 163
60.23 162
60.29 162
60.34 162
60.39 163
60.44 163
60.50 164
60.55 163
60.60 163
60.65 163
60.71 162
60.76 163
60.81 165
60.86 148
60.92 151
60.97 154
61.02 153
61.07 159
61.13 182
61.18 187
61.23 188
61.28 170
61.34 171
61.39 173
61.44 176
61.49 176
61.54 176
61.60 179
61.65 180
61.70 180
61.75 179
61.81 180
61.86 180
61.91 179
61.96 179
62.02 180
62.07 179
62.12 179
62.17 180
62.23 179
62.28 183
62.33 207
62.38 210
62.44 196
62.49 88
62.54 199
62.59 202
62.64 183
62.70 230
62.75 235
62.80 221
62.85 220
62.91 224
62.96 226
63.01 226
63.06 227
63.12 227
63.17 227
63.22 226
63.27 226
63.33 227
63.38 226
63.43 226
63.48 227
63.54 229
63.59 254
63.64 258
63.69 243
63.75 243
63.80 246
63.85 247
63.90 249
63.96 252
64.01 252
64.06 254
64.11 275
64.17 277
64.22 276
64.27 280
64.32 280
64.38 280
64.43 279
64.48 283
64.53 283
64.59 281
64.64 282
64.69 282
64.74 282
64.80 283
64.85 285
64.90 286
64.95 285
65.01 285
65.06 285
65.11 268
65.16 269
65.22 269
65.27 268
65.32 268
65.37 270
65.43 270
65.48 270
65.53 271
65.58 271
65.64 271
65.69 271
65.74 271
65.79 271
65.85 271
65.90 271
65.95 272
66.00 271
66.06 271
66.11 271
66.16 268
66.21 269
66.27 286
66.32 279
66.37 254
66.42 252
66.48 249
66.53 246
66.58 260
66.63 255
66.69 226
66.74 220
66.79 221
66.84 219
66.89 234
66.95 232
67.00 207
67.05 201
67.10 199
67.16 124
67.21 198
67.26 195
67.31 208
67.37 179
67.42 177
67.47 174
67.52 171
67.58 188
67.63 185
67.68 186
67.73 185
67.79 184
67.84 185
67.89 184
67.94 184
68.00 184
68.05 185
68.10 184
68.15 159
68.21 154
68.26 149
68.31 160
68.36 132
68.53 2
68.58 110
68.81 8237
68.99 2
69.04 107
69.09 107
69.14 4159
69.31 1
69.36 99
69.41 93
69.47 89
69.52 90
69.57 87
69.62 88
69.67 88
69.73 87
69.78 88
69.83 88
69.88 86
69.94 81
69.99 77
70.04 96
70.09 93
70.15 87
70.20 2
70.25 85
70.30 85
70.35 85
70.41 85
70.46 87
70.51 85
70.56 84
70.61 85
70.66 104
70.71 152
70.76 124
70.81 120
70.87 115
70.92 113
70.97 198
71.02 213
71.07 158
71.13 129
71.29 1
71.34 4
71.39 4
71.45 3
71.50 2
71.55 1
71.60 1
71.65 3
71.70 1
71.75 2
71.80 2
71.85 2
71.90 1
72.07 1
72.12 2
72.17 1
72.22 4
72.27 4
72.33 1
72.38 2
72.43 4
72.48 2
72.53 2
72.58 4
72.63 2
72.68 3
72.73 3
72.78 3
72.83 2
72.88 2
72.93 3
72.98 1
73.03 3
73.08 1
73.13 3
73.19 3
73.24 3
73.29 2
73.34 2
73.39 4
73.44 2
73.49 1
73.54 2
73.59 1
73.64 4
73.69 3
73.74 3
73.79 1
73.84 1
73.89 0
73.94 2
73.99 4
74.04 0
74.09 4
74.14 2
74.19 4
74.24 2
74.30 3
74.35 3
74.40 3
74.45 2
74.50 2
74.55 3
74.60 2
74.65 0
74.70 3
74.75 1
74.80 3
74.85 2
74.90 3
74.95 2
75.00 2
75.05 2
75.10 2
75.15 1
75.20 4
75.25 4
75.30 3
75.36 3
75.41 3
75.46 4
75.51 2
75.56 3
75.61 4
75.66 4
75.71 2
75.76 1
75.81 1
75.86 3
75.91 2
75.96 1
76.01 3
76.06 0
76.11 1
76.16 3
76.21 3
76.26 2
76.31 2
76.37 4
76.42 1
76.47 1
76.52 1
76.57 2
76.62 1
76.67 1
76.72 4
76.77 4

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Sun Sep 30, 2012 8:28 pm

Could a noisy power supply effect the reading like that? I'm not sure about this but if its all a matter of timing then that would be independent of power, wouldn't it? ... As long as it is reliably powered on. Could it be some other factors causing the noise?

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Ultra cheap ultrasonics, and a bit of a challenge

Sun Sep 30, 2012 9:23 pm

Perhaps Joan means audio noise - I've got a similar supply with a dirty great transformer in it that sounds like an angry mosquito!

I'm fiding all this fascinating regardless of any practical application.

I cant help wondering whether ghost echoes can be used positively. I think advanced ultrasonc set-ups and animals such as bats and dolphins might use them to help map their environment.

E.g. 1st echo represents nearest object and subsequent echoes also represent more distant objects (perhaps by an indrect route) but can only be interprated in relation to other overlapping data and resolve as a probability.
Ostendo ignarus addo scientia.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Ultra cheap ultrasonics, and a bit of a challenge

Mon Oct 01, 2012 1:10 pm

This sensor is £1.37 http://www.ebay.co.uk/itm/Arduino-Ultra ... 20cb11a539

it has a slightly different serial number and has one less pin - perhaps it is an even cheaper alternative.
Ostendo ignarus addo scientia.

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Mon Oct 01, 2012 3:35 pm

I've got a pack of 4 of those SR04 ultrasonic modules (for front, sides and rear of skutter) sitting on my shelf waiting for me to get round to fiddling with them. If you get some too then we could both have a go at bullying them into working on the Pi like Joan and Rasathus did with this other module. I think they have probably done most if not all of the leg work. It would be interesting to see if we can get them to work through a gpio expander too.

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultra cheap ultrasonics, and a bit of a challenge

Mon Oct 01, 2012 3:59 pm

I think the eBay SRF04 module works identically to the eBay SRF05. The out pin of the eBay SRF05 seems pretty pointless. The identically named SRF05 module from http://www.robot-electronics.co.uk/htm/srf05tech.htm has a mode pin instead of the out pin. The mode pin lets you operate so that the trigger and echo use the same pin (i.e. the echo appears on the trigger pin). Useful for a machine with a limited number of gpios.

Rasathus
Posts: 45
Joined: Sat Jun 02, 2012 11:37 am
Location: Reading, UK
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Mon Oct 01, 2012 7:20 pm

What sort of GPIO expander were you looking at ?

I've been playing around with some 74HC595's, which i quite like as you can chain them all together, but im still ironing some bugs out of my implementation.

I've also got some MCP23009's about, which i've been meaning to play with, they should be along the same lines, but work over i2c rather than spi. I wanted to keep the SPI bus free for a display and an mcp3008 for analogue input.
Pi1 - Revision 002 - Used for some circuit experimentation and learning.
Pi2 - Revision 002 - Currently powering the 'Monstrosity Rover' project.
Pi3 - Revision 004 - Raspberry Pi Laptop using a Motorola Lapdock.

Take a look @ rasathus.blogspot.co.uk

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Ultra cheap ultrasonics, and a bit of a challenge

Wed Oct 03, 2012 12:22 am

Ostendo ignarus addo scientia.

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Wed Oct 03, 2012 5:57 am

Rasathus wrote:What sort of GPIO expander were you looking at ?
I was thinking about using something like a PCA9555 because they seem quite well supported. Haven't made any final decision yet. I'll be using an mcp3008 for adc as well.

mikerr
Posts: 2686
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Wed Oct 03, 2012 9:22 am

pygmy_giant wrote:actually make that 93p - http://www.ebay.co.uk/itm/New-Ultrasoni ... 3ccb2f2a15
Heh - those ultrasonics are unbelieveably cheap for what they give you.

Note they are fast/accurate enough to use them for balancing instead of gyro/accel ata a push too

- mount vertically (offset from centre) and measure distance to floor:
http://www.raspberrypi.org/phpBB3/viewt ... 66#p119366
the distance to floor varies by a few mm when it tilts. (that was with arduino at 5v though)

Using a more expensive Gyro/accellerometer combination is the better method, but it was fun to do for grins.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Ultra cheap ultrasonics, and a bit of a challenge

Wed Oct 03, 2012 12:01 pm

I admire your willingness to experiment - I've never really seen the point in replicating tried and tested methods.

My IMU arrived in the post this morning - £6.50 incorporating 3-axis gyro & 3-axis accelerometer and master bus for additional 3 axis magnetometer! Ive said it before and will doubtless say it many times again - God bless the Chinese!

I intend on pointing some kind of sensor at the floor to detect sudden drops and may use a second 93p detector in addition to the one Im mounting on top of a servo for mapping.

God bless the Chinese.
Ostendo ignarus addo scientia.

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Ultra cheap ultrasonics, and a bit of a challenge

Wed Oct 03, 2012 1:22 pm

You can get short range ir rangefinders that are accurate down to a mm or so... Think they are pretty cheap too.

Return to “Automation, sensing and robotics”

Who is online

Users browsing this forum: klricks, wildfire and 10 guests