Arduino project 1a: parking sensor

I’m doing small Arduino projects to become better at working with Arduino. Project 1a: a parking sensor!

Since I followed the Arduino workshop from Seb I’m playing with my Arduino, but didn’t have any concrete things I wanted to make. Just playing with components is educational, but won’t lead to an actual ‘thing’/product I could use.

Ever since I came across the term ‘domotica’ I’ve been curious of what it could bring to our homes. It may be a very ambitious goal, but my first Arduino project will be a domotica system which can make the lights in my home switch on/off using my smartphone. It’ll be a project that offers a lot to learn about Arduino and Domotica, and since I came up with it I can’t stop Googling for information about parts I might need, and ways I should approach this. I think I’ve found a project which I’m very excited about!

Project 1: a domotica system which can make the lights in my home switch on/off using my smartphone.

Making this first project with my novice Arduino skills will be very hard. Therefore I decided it would be better to separate Project 1 (which I officially called it) into smaller chunks I can work on, and merge these chunks together later on, making the end product of Project 1.

For domotica you need sensors. I’ve got a bunch of them, and the first one I’ll experiment with will offer me a way of measuring distance: an ultrasonic distance sensor! It looks a bit like Wall-E’s eyes and has the codename HC-SR04.

Anyway, after experimenting with the code this was the result:

Lessons learned:

  1. If you only do Serial.print() it will put everything on one line. I tried printing out the distance, but everything was mashed together (something like this: 37373737404040414141 etc). Serial.println() or Serial.print(‘\n’) will print a newline so you can check the distance via the COM port much easier.
  2. You can’t start the name of an Arduino .ino file with a number. The software doesn’t like it.
  3. I should pay more attention to where I put the wires, since I put the GND wire into the AREF port. Nothing’s broken fortunately.

Useful links:

Conclusion:
Off to project 1b! I’ve ordered a relay switch, so let’s check that out!