Arduino based Temperature and Humidity/Humidex meter with DHT22 sensor and color LCD

IMG_1980

This project consist of Arduino board, serial TFT LCD 128×160 display, DHT22 sensor and obviously bread board and jumpwires.

Project features:

Continue reading

Reading temperature from LM92 digital sensor with Arduino

IMG_1416

LM32 is digital temperature sensor manufactured by Texas Instruments. It stands out with maximum +/- 0.33° C accuracy (at 30° C) and thermostat functions with hardware output and I²C interface.

Continuous LM92 temperature reading.

I’ll show you how to just read  temperature while ignoring other LM92 capabilities.

lm92schematic

A0 and A1 pins define LM92 address for communication, by connecting pins to GND or Vss you get 4 address combinations so you can connect 4 LM92 sensors to one I²C bus. If you are planning to use only one sensor per bus just ground A0, A1 as it is shown in wiring diagram.

Other wiring is standard, although manufacture recommends 0.1 µF bypass capacitor if sensor is not near CPU.

LM92 have 7 bit slave address. Five most significant bits are “10010″. 2 least significant bits are set by A0 A1 pins. If they are connected to the ground 7 bit address is 100 1000 – 64 +8 = 72 or 0×48 (hex).

slaveaddress

char lm92address = 0x48; //A1 A0 are grounded

I²C communication is quite simple, Arduino invoke communication by sending correct LM92 address and reading 2 bytes containing temperature data.

 Wire.requestFrom(lm92address,2); 

  if (Wire.available()) 

  {
    for (int i=0; i<2; i++) {

      buffer[i]= Wire.read();
    }

From received 16 bit temperatures register content is formated 12 bit temperature code.

tempcode

And converted to Celsius.

tempcode= ((buffer[0] << 8) + buffer[1]) >>3;
temp = tempcode * 0.0625;

Temperature from LM92 can be read at any time, but if temperature conversation is in progress reading interrupts it and it starts from beginning after reading is finished. Therefore if read request is to frequent temperature conversation never finishes. Temperature conversation time is 500 ms, so there is 500 ms delay to protect from reading to frequent.

delay(500);

Full code:

//Reading LM92. electronicsblog.net 
#include <Wire.h>
#include <Serial.h>

char lm92address = 0x48; //A1 A0 are grounded
char buffer[2];
int tempcode;
float temp;

void setup() {
 Wire.begin();
 Serial.begin(9600);
} 

void loop() {

 Wire.requestFrom(lm92address,2); 

  if (Wire.available()) 

  {
    for (int i=0; i<2; i++) {

      buffer[i]= Wire.read();
    }
 
tempcode= ((buffer[0] << 8) + buffer[1]) >>3;
temp = tempcode * 0.0625;
 
 Serial.print("t = "); 
 Serial.print(temp);
 Serial.print(" C");
 Serial.println();
}
delay(500);

}

terminal

How to connect to diagnostics port of AC Stag gas controllers without special cable

diag

Stag gas controllers have 4 pin socket for diagnostic purposes. AcGasSynchro software can be downloaded free, but you need cable/adapter to connect USB port of computer to this special socket. If you don’t planning running automotive businesses and just curious to play with diagnostics software once or twice is not worth to buy special cable for about 30 USD.

Good news that Stag gas controller use standard UART TTL level interface. So you need just easy findable USB – UART converter. Connect RX<->TX, TX<->RX, GND <-> GND, that is all.

I prefer to use Arduino board, because it also has integrated USB – UART converter, and You don’t need write any code, just load example “blink” project to make sure that Arduino RX, TX ports won’t interfere. You need to connect RX<->RX, TX<->TX, GND <-> GND.

13090033

Connect Arduino board or USB -UART converter with USB cable to computer, turn on ignition and start AcGasSynchro software.

You can turn off ignition after few second, because diagnostic interface works without ignition, but goes sleep after several minutes without ignitions is turned off.

Go Port – Connect.

Software should find proper COM port what is associated with USB – UART converter and connect. If it fails to connect check if you didn’t mix up RX and TX connections, and ignition is on.

gassycnc

Now you are on your own, just remember that controller tracks logins and changes, so you can void you warranty.

You could make electric connection less messy buy using SuperSeal plug.

STM32F4DISCOVERY – great board for starting learn ARM microcontrollers

STM32F4DISCOVERY is evaluation board with 32 bit ARM microcontroller and I’m surprised what features it can offer for around 11 euros.

Main features:

  • STM32F407VGT6 32-bit ARM microcontroller @168 MHz with 1 MB Flash, 192 KB RAM.
  • Hardware debugging(limited On-board ST-LINK) via USB
  • USB OTG port for connecting mouses, keyboards, USB flash drives
  • 3 axis digital accelerometer ±2g/±8g with programmable triggers
  • Digital microphone
  • DAC with microphone socket
  • 4 user controllable LED’s

Continue reading

Atmega328 Development Kit

This is a very basic Atmega328 development kit It includes:

  • Atmega 328 8 bit microcontroller with 20 MHz crystal resonator
  • PCB board with place for external components
  • Power circuit  that allows powering Atmega directly(2.7-5.5 V), or through a L7805 voltage regulator(8-35 V).  L7805 circuit includes a thermal fuse.
  • 10 pin ISP connection for programming.

A kit comes as true kit, and components must be soldered  by user.

Continue reading