57°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • Ultrasonic Sensors - Day 1

    July 27, 2007

    Disclaimer: The posts in this "Ultrasonic Sensors" category are primarily a reference for myself during this project. However, I suspect some of the things I discover will be of use to others doing similar projects, so I will make them public.

    Today I started putting things together for the ultrasonic distance sensor project. Here is a brief overview of the end result.

    Three battery-powered sensors will measure distance, and transmit their data wirelessly to a receiver box. The receiver will interface with a computer via a serial-usb interface. The device appears as a regular serial port, but is connected via a USB cable. I am using the Arduino platform to create the devices.

    The actual sensor is this module. I am reading its PWM output rather than interfacing serially. I am using this wireless module to link the devices together.

    What makes this project a little more interesting is that I accidentally ordered the surface-mount versions of the ATmega168 chips! So now I am going to learn to solder surface-mount devices, and build a custom PCB for the devices!

    Below is my progress made today.

    Task: Read the PWM values from the sensor module into the computer.

    Overall, went pretty smoothly. Using the Arduino board and the sensor, wired everything up, and it went all according to plan.

    Task: Build a standalone arduino, so that I can start testing the wireless connectivity.

    Since I have only one arduino board, I need to wire up the ATmega168 chip on a breadboard so that I can eventually get two of them connected wirelessly.

    I followed this guide to wiring an arduino on a breadboard. I got everything wired up, and then decided to test the serial port.

    I wrote a small program which just counts up by 1 every half second and writes that number to the serial port. Here is where I encountered my first minor setback. I was seeing random characters coming out the serial port instead of sequential numbers. My first (and correct) guess was that it was a timing issue. Although the ATmega168 is rated to run at 20mhz, apparently the crystal on the Arduino board is actually 16mhz. By using the crystal from the real Arduino board instead of my own 20mhz crystal, everything works perfectly. The USB interface and Arduino need to be in sync. So I can't use my standalone Arduino with the USB port until I get my hands on some 16mhz crystals.

    Todo: Link the serial connections of two Arduinos with a wire, and test sending data between them. Then replace the wire with the wireless module.

    Fri, Jul 27, 2007 9:11pm -07:00
Posted in /articles

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv