dunnlab / lullaby

A monitor system for laboratory hardware, including ridges, freezers, and incubators
1 stars 0 forks source link

new hardware approach #2

Open caseywdunn opened 5 years ago

caseywdunn commented 5 years ago

One wire temp sensors not reliable enough. Also clear that need battery and cell service.

Got the following:

Thermocouple

Ambient

Display

Particle

caseywdunn commented 5 years ago

Wiring the thermocouple. More here:

https://community.particle.io/t/max31856-example-for-particle/38385/4

and here:

https://learn.adafruit.com/adafruit-max31856-thermocouple-amplifier/wiring-and-test

caseywdunn commented 5 years ago

For ambient sensor, library is here:

https://github.com/adafruit/DHT-sensor-library

Example code is here:

https://github.com/jogleasonjr/particle-dht22/blob/master/particle-dht22.ino

caseywdunn commented 5 years ago

Here is an example of using that display - http://hamradiodesigns.com/index.php/hardware/150-w-dummy-load/

Code is available at the bottom of here - http://hamradiodesigns.com/index.php/content/

That code is using I2C on Arduino pins A4 and A5, per https://www.arduino.cc/en/reference/wire .

On particle, this example uses D0 and D1. See OLED https://docs.particle.io/support/particle-devices-faq/i2c-faq/

Code for that example is at https://build.particle.io/shared_apps/5a1d9e5310c40e5c02001232 . It uses the Adafruit_BME280_RK and Adafruit_SSD1306_RK libraries.

caseywdunn commented 5 years ago

This configuration uses a lot of pins because every external device is using a different protocol. SPI devices are available for all items. Nice overview of SPI here - https://www.analog.com/en/analog-dialogue/articles/introduction-to-spi-interface.html

Devices each need their own CS pin, but share the other 3.

Particle has built in spi support - https://docs.particle.io/reference/device-os/firmware/photon/#spi

More here on using multiple SPI devices with particle - https://community.particle.io/t/spi-ss-and-more-than-1-spi-peripheral/14791/13

Here is an example of using native particle SPI support for the thermocouple board - https://community.particle.io/t/max31856-example-for-particle/38385

caseywdunn commented 5 years ago

SPI pin mapping/ names:

SCLK : SCK, CLK. MOSI : SIMO, SDO, DO, DOUT, SO, MTSR. MISO : SOMI, SDI, DI, DIN, SI, MRST. SS : nCS, CS, CSB, CSN, nSS, STE, SYNC.

from https://forum.pjrc.com/threads/24993-SPI-Data-in-out-naming-clarity

caseywdunn commented 5 years ago

SPI use of LCD backpack - https://learn.adafruit.com/i2c-spi-lcd-backpack/arduino-spi-use

Looks like the library is not compatible with hardware SPI: "This library does not use the Hardware SPI library, which means you can use any 3 pins! However, if you are using the hardware SPI port (such as for Ethernet, WiFi, an LCD, etc. etc) you cannot share those pins with this LCD!"

caseywdunn commented 5 years ago

Display is not working.

Was completely garbled. Adding reset wire led to top half working, but lower half is still garbled. This may be relevant:

https://github.com/olikraus/u8g2/issues/264