Shop OBEX P1 Docs P2 Docs Learn Events
read a single 1-wire device with two MCUs — Parallax Forums

read a single 1-wire device with two MCUs

I'd like to read a single 1-Wire device on one Propeller in my house to display temperature and without having to add a 2nd sensor, control a relay with another Propeller in my furnace room outside. I realize there may have to be some code to make sure both readings are not simultaneous.

Is this doable?

Thanks
Aaron

Comments

  • Given the low cost of sensors, it might be best to have two, but you can use one sensor with two micros so long as you can prevent a collision between access attempts.

  • Not that we're talking lots of money but the 1-Wire that I want to read in 2 places is a thermocouple and its amp. So a little more than a DS18B20. Plus needing to mount another in the chimney.

    I can think of a few ways to prevent collision but will have to give it a little more thought and testing.

    Thanks Jon
    Aaron

  • Assuming both boards boot from the same power souce, it would be easy.

    • Let device #1 sample the sensor, say every 10s
    • After boot-up, device #2 watches the DQ line for a signal then does a 5s delay
    • Device #2 now samples every 10s

    Easy-peasy... if both device boot at the same time.

  • I'd like to have a separate battery power supply for the remote unit but could have a common ground wire.

  • Could you not have MCU#1 reading the temperature sensor, and have MCU#1 relay the information to MCU#2 ?

  • For best control of the furnace, I'd like to have the least distance and greatest chance of no storm or lightning damage to screw things up. Overheating of the boiler is a prime concern.

    Aaron

  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2023-06-05 23:23

    The distance would be the same no matter how you slice it. However the communication between the Sensor and MCU would more likely be susceptible to noise than from MCU to MCU. With MCU to MCU you could run RS485 and/or at a lower Baud thus reducing any corrupted signal where as the sensor is probably at a fixed communication rate and probably pretty high in terms of speed. ( <-- Most 1-wire's are)

    Wireless is also an option between MCU's

  • jmgjmg Posts: 15,172

    @AGCB said:
    I'd like to read a single 1-Wire device on one Propeller in my house to display temperature and without having to add a 2nd sensor, control a relay with another Propeller in my furnace room outside. I realize there may have to be some code to make sure both readings are not simultaneous.

    Is this doable?

    Almost anything is 'doable' :)

    If one prop is a master, and is designed to leave gaps between readings, the other prop can easily sync to that, and wait for the master to finish.
    An alternative is to have the second prop always passive and read-only, so it sniffs the bus, and extracts the data being polled by the master.

    The second approach uses least energy, allows higher master poling rates, and would allow any number of read-only units to clip onto the bus, but it is likely to need more coding.

Sign In or Register to comment.