- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As someone asked for help with CY8CKIT-042, I decided to leave my CY8CKIT-044 version here.
This HC-SR04 sensor module is somewhat affordable and looks simple, but the ICs on the module do nice job!
At first, I set the Timer Clock Frequency to 10MHz, so that the calculation would be simple,
but with the 24MHz source clock, the error is rather large and I ended up to have measurement
errors around 2cm for CY8CKIT-044 and 4cm for CY8CKIT-042.
Then Considering the hint from lukebartol-san, I changed the Timer Clock Frequency to 12MHz
so that the clock error is much smaller, and I got less than 1cm error(s) for both CY8CKIT-044
and CY8CKIT-042.
Last but not least, as the module requires 5V operation, we need to set J9 to 2-3 from 1-2.
moto
- Labels:
-
PSoC 345 LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
本サンプルは CQ出版 インターフェース 12月号に
ふえる今どきセンサNote
その11 距離を測る定番デバイス…超音波センサ
として掲載されました。
I contributed this sample project to a Japanese
technical magazine "Interface" Dec. edition.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I used a bit different approach, to fully utilise the programmable blocks in a PSoC. It has the advantage that no calculation is done in firmware.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear David-san,
Nice work!
I think that my project was porting from my mbed sample where I could not use hardware timer trigger.
And with PSoC although I wanted to use the hardware timer at the time of writing I was still beginner and I could not figure out how.
So I appreciate your posting of sample which is using the hardware timer to count the echo time, it should give us better accuracy.
I would recommend and/or ask you to post this as an individual topic to the Code Examples Page so that others can find it easily.
Last not least, I like you craft work of the case, too 🙂
Best Regards,
19-Jun-2019
Motoo Tanaka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I added a sample for PSoC 6 (CY8CKIT-062-WIFI-BIT) at
HOW TO INTERFACE HC-SR04 ULTRASONIC SENSOR WITH PSOC 6
I learned a timer usage from David-san's sample 😉
moto