Grove Ultrasonic Ranger
Moderator: Benj
Grove Ultrasonic Ranger
Hi
I am trying to use your Grove Ultrasonic sensor. I have downloaded the example program from the wiki. It appears to work but the example program is set to read in mm and it is more like CM, although it is not very accurate. When I try to read distance in CM or inches then the readings just appear to be random.
Can anyone advise please
Thanks
Gary
I am trying to use your Grove Ultrasonic sensor. I have downloaded the example program from the wiki. It appears to work but the example program is set to read in mm and it is more like CM, although it is not very accurate. When I try to read distance in CM or inches then the readings just appear to be random.
Can anyone advise please
Thanks
Gary
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Grove Ultrasonic Ranger
Hi Gary,
Please can you attach your program and I'll have a look for you. We have had very good results using the sensor so maybe the program needs a small alteration.
Please can you attach your program and I'll have a look for you. We have had very good results using the sensor so maybe the program needs a small alteration.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Grove Ultrasonic Ranger
Hi BenJ
I have attached the program. But it is the one from the wiki with the display type changed. As I said this is set to read in mm but is more like CM
Regards
Gary
I have attached the program. But it is the one from the wiki with the display type changed. As I said this is set to read in mm but is more like CM
Regards
Gary
- Attachments
-
- 361 - ultrasonic_ranger sensor cm.fcfx
- (10.18 KiB) Downloaded 262 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Grove Ultrasonic Ranger
Hi Gary,
I looked at your program but couldn't see anything wrong. I'll dig out a sensor and have another test for you.
I looked at your program but couldn't see anything wrong. I'll dig out a sensor and have another test for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Grove Ultrasonic Ranger
Hi Gary,
Are you running Flowcode version 8.1?
If you are not then you will need to update to get the latest component fixes.
Once you are running 8.1 please load your ultrasonic project and then go to Help -> Check for updates and ensure you have the latest version of the Ultrasonic component.
Are you running Flowcode version 8.1?
If you are not then you will need to update to get the latest component fixes.
Once you are running 8.1 please load your ultrasonic project and then go to Help -> Check for updates and ensure you have the latest version of the Ultrasonic component.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Grove Ultrasonic Ranger
Hi Gary,
I've just tried it here using a BL0032 and the sensor is working very nicely with stable values in the correct range. I'll try again tomorrow with a BL0011 and double check this is also running ok.
What sort of values are you getting from the sensor? There was a bug with this component a number of months back which is why I was asking if you were running the latest version of the component. You should be on v4.
I've just tried it here using a BL0032 and the sensor is working very nicely with stable values in the correct range. I'll try again tomorrow with a BL0011 and double check this is also running ok.
What sort of values are you getting from the sensor? There was a bug with this component a number of months back which is why I was asking if you were running the latest version of the component. You should be on v4.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Grove Ultrasonic Ranger
Hi BenJ
Thanks for this. if the BL0032 is the original EBlocks ultrasonic sensor then I have that one working OK. The grove ultrasonic sensor appears to just give random numbers if you try to measure in CM or inches if you set it to read in mm then it appears to measure in CM but not that accurately.
Regards
Gary
Thanks for this. if the BL0032 is the original EBlocks ultrasonic sensor then I have that one working OK. The grove ultrasonic sensor appears to just give random numbers if you try to measure in CM or inches if you set it to read in mm then it appears to measure in CM but not that accurately.
Regards
Gary
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Grove Ultrasonic Ranger
Hi Gary.
The BL0032 is the upstream dsPIC board. I don't currently have a PIC board handy but it should be similar. I'll double check tomorrow.
Can you confirm you are using component version 4. Just go into help -> Check for updates and then tick the show up to date files checkbox. The problem you are describing sounds a lot like the problem that was previously fixed.
The BL0032 is the upstream dsPIC board. I don't currently have a PIC board handy but it should be similar. I'll double check tomorrow.
Can you confirm you are using component version 4. Just go into help -> Check for updates and then tick the show up to date files checkbox. The problem you are describing sounds a lot like the problem that was previously fixed.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Grove Ultrasonic Ranger
Morning BenJ
We are definitely using Version 4. Can't seem to import the image so saved it as an attachment.
Regards
Gary
We are definitely using Version 4. Can't seem to import the image so saved it as an attachment.
Regards
Gary
- Attachments
-
- ultrasonic.docx
- (32.57 KiB) Downloaded 263 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Grove Ultrasonic Ranger
Hi Gary,
Right the measurements using the BL0011 PIC board are not as good as the dsPIC board and I'm also getting the mm reading as more like cm.
Mainly because it is a significantly slower processor on the PIC board. Saying this the measurement is stable and varies nicely with range adjustments.
I'll have a look at the component code and see if there is a way to make this run better on an 8-bit PIC device.
Right the measurements using the BL0011 PIC board are not as good as the dsPIC board and I'm also getting the mm reading as more like cm.
Mainly because it is a significantly slower processor on the PIC board. Saying this the measurement is stable and varies nicely with range adjustments.
I'll have a look at the component code and see if there is a way to make this run better on an 8-bit PIC device.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Grove Ultrasonic Ranger
Hi Gary,
Right I've had a go at adding hardware based timing using a timer peripheral rather then relying on delays. This will give significantly better accuracy on slower devices e.g. the PIC devices.
There is a new component property to allow you to select the timing method. If you select the timer method then you must also select a timer peripheral to use.
I've pushed the new component update to the update system now.
Here is your program setup for the new component using timer 0 and now working very nicely.
Right I've had a go at adding hardware based timing using a timer peripheral rather then relying on delays. This will give significantly better accuracy on slower devices e.g. the PIC devices.
There is a new component property to allow you to select the timing method. If you select the timer method then you must also select a timer peripheral to use.
I've pushed the new component update to the update system now.
Here is your program setup for the new component using timer 0 and now working very nicely.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel