Public projects 3

Arduino Control Center

Project tutorial by Chip McClelland

  • 29 respects

Garage Parking Sensor

Project tutorial by Chip McClelland

  • 11 respects

Toolbox 2

Replicated projects 0

 Chip McClelland hasn't replicated any projects yet.

$20 Zigbee Door Chime

Project tutorial by BuddyC

  • 39 respects

Smartwatch car remote

Project tutorial by Mika Wee

  • 72 respects

IoT Garage Door Monitor/Opener with Finger Print Scanner

Project tutorial by

  • 34 respects

  • Arduino I2C Multi-Master Approach - Why and How 6 months ago

    Yes, you could use one line for both clock and busy. But, I am concerned about the edge case of two "masters" both taking control at the same time. I also wanted to make the code as simple as possible.

    To that end, one change I made from the example code in this article was to use the digitalWriteFast library to speed all the reads and writes.

    Thanks, Chip

  • Arduino I2C Multi-Master Approach - Why and How 6 months ago

    Thanks for the question. I guess I can think of two ways to make this happen.

    First, let me recap for those who are reading from here. This project shows how you can arbitrate between two masters on an i2c bus running the Wire.h library. I have been using this approach with great success in my projects. The model has two shared lines - a 32k square wave "clock" line, and an open-drain "talk" line. The question is how this could be extended beyond two masters.

    As you alluded to in your question, older networking technologies like Token Ring were connected to a common wire and had to take turns talking on the network. The way they did this was with a "token" which was passed from one computer to the next and you can think of this simply as a rule like - "you can't hold the token for longer than xxx" AND "you can't talk unless you are holding the token".

    As you suspected, you could use this model to connect more masters to the i2c bus as long as you wrote code on each master that ensured they would not hold the token for more than some reasonable amount of time. The issue with this approach would be to make sure that two or more devices would not grab the bus at the same time. You could solve this by implementing this approach:
    1) Test the bus to see if the token is taken (ie "talk" is HIGH)
    2) Wait until you see the "clock" line go HIGH
    3) Delay a fixed - unique time assigned to each Master
    4) Test the "talk" line again and, if it is still low, take the token by setting it "HIGH".
    I believe this approach would work as long as your application can tolerate the i2c latency that this approach would introduce.

    This approach would not require you to change the wiring of this circuit but it would require a more complex "take the bus" function. Still quite doable. If you implement this, please share.

    Thanks for reading my article,


  • Garage Parking Sensor 6 months ago

    Thank you for your comments, I am glad you liked the project. I have added a link to the RGB LEDs - thank you for catching that.

    I do think this approach would work when ceiling mounted just as you described. Here are a few thoughts.

    1) Cars reflect ultrasonic signals so using the more expensive Maxbotix sensors will be even more important as they can be "chained" to prevent cross-talk.
    2) You will need to "tune" the signal so it tells you when the car is pulled in the right distance. If you hood or car top is near horizontal, you may need to adjust this carefully. You may also try detecting where the hood meets the front window but, experimentation will be required as the return signal will be weak.

    3) You can place the sensors on the roof of your garage, but for the tuning above and for the indicator lights, you will need to place the Arduino somewhere where you can get to it.
    4) You could use sound instead of LEDs to signal with a sound beeping more quickly and going steady when the car is properly parked. It could then turn off after 10 seconds of no movement.

    Have fun, and if you build this, I would love to see what you came up with.


Add projectSign up / Login