Example-Code for Adaptor Device to connect Dallas/Maxim DS2438 and DS18x20 1wire Slaves.
More...
Example-Code for Adaptor Device to connect Dallas/Maxim DS2438 and DS18x20 1wire Slaves.
- Author
- drtrigon
- Date
- 2018-08-02
- Version
- 1.0
OWPJON/ARDUINO/Local/SoftwareBitBang/DeviceGeneric/DeviceGeneric.ino
- See Also
- https://playground.arduino.cc/Learning/OneWire
-
https://github.com/jbechter/arduino-onewire-DS2438/blob/master/examples/DS2438TemperatureAndVoltage/DS2438TemperatureAndVoltage.ino
-
https://cdn.shopify.com/s/files/1/0164/3524/files/MultiSensor_Manual_v1.5.pdf?15845834050373852166
* OneWire PJON Generic "OWPG" scheme:
* @ref OWPJON/LINUX/Local/LocalUDP/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
*
* Compatible with: atmega328 (Uno, Nano), atmega32u4 (Yun)
* ID 42: Nano Test Device on outdoor SWBB bus (testing)
*
* Pinout (Uno, Nano):
* 1wire PJON data bus (OWPJON SWBB):
* 1WIRE DATA -> Arduino Pin D12
* GND black -> Arduino GND
* 1wire Dallas/Maxim data bus (MicroLAN):
* 1WIRE DATA -> Arduino Pin D2
* A 4.7k pull-up resistor must be connected to the 1-wire bus (Pin D2).
* Needs a weak pull-up (that the uP cannot provide).
*
* Example sending READ_DS... commands to device id 42:
* $ printf "\x4A" | ./owpshell - - 42 | ../../../ThroughSerial/RemoteWorker/DeviceGeneric/unpack.py BBBBBBBB
* 38, 0, 0, 215, 1, 0, 0, 77
* $ printf "\x4B" | ./owpshell - - 42 | ../../../ThroughSerial/RemoteWorker/DeviceGeneric/unpack.py BBBBBBBB
* 40, 66, 243, 63, 5, 0, 0, 10
* $ printf "\x41" | ./owpshell - - 42 | ../../../ThroughSerial/RemoteWorker/DeviceGeneric/unpack.py f
* 23.03125,
* $ printf "\x42" | ./owpshell - - 42 | ../../../ThroughSerial/RemoteWorker/DeviceGeneric/unpack.py f
* 1.690000057220459,
* $ printf "\x43" | ./owpshell - - 42 | ../../../ThroughSerial/RemoteWorker/DeviceGeneric/unpack.py f
* 4.590000152587891,
* $ printf "\x44" | ./owpshell - - 42 | ../../../ThroughSerial/RemoteWorker/DeviceGeneric/unpack.py f
* 27.125,
* More info can be found in @ref OWPJON/README.md. Confer also the docu of
* following files for info about tests on Ubuntu or Raspberry Pi Server (owpshell):
* - @ref OWPJON/LINUX/Local/LocalUDP/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
* - @ref OWPJON/LINUX/Local/ThroughSerial/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
*
* Using on (minimal/raw) atmega328 w. 16MHz oscil.
* use Uno with ArduinoISP Example and "Arduino as ISP"
* connect (like attiny85) for ISP (SPI) programming, see e.g.
* http://www.gammon.com.au/breadboard
* https://github.com/nickgammon/arduino_sketches
* (for debugging see "Chip not detected", "Alternate clock source")
* select "Arduino/Genuino Uno" board and Tools > Burn Bootloader
* then compile and upload sketch with (Upload button doesn't work)
* Sketch > Upload Using Programmer
*
* Thanks to:
* gioblu - PJON 11.0 and support
* @see https://www.pjon.org/
* @see https://github.com/gioblu/PJON
* fredilarsen - support
*