Thursday, October 8, 2015

Villavent home HVAC automation

So, it`s still a work in progress, but getting there slowly.

New sensors have arrived, but I'm still waiting for the relays to arrive.

Latest status:

- Two new AM2301 / DHT22 sensors, for better accuracy, precision / repeatability, and resolution.
- Updated GUI to display last 24hr temperatures
- Better display on current air readings.
- Only pulling NTP once per hr
- Some error trapping routines for the wifi, preventing NTP request when wifi is unavailable, and also continously checking wifi status to periodically try to reconnect.

I still have left to:
- Implement control algorithms, which is harder than it looks; multiple input variables and priorities, but only controlling one output (fan speed).
- Maybe adding manual overrides
- Putting the hardware together
- Testing

Monday, September 21, 2015

Villavent HVAC home automation with ESP8266

HVAC controller starting to come together.

So far I have the system connect to wifi and host a web page:
- Reading temperature and humidity data from a DHT sensor
- Fetching time from a NTP server
- Polling at interval (presently 1 min) at interrupt
- Controlling digital outputs

Still waiting on some higher spec sensors to accurately measure intake and outlet air, and some relays to control the fan speed.

Friday, May 23, 2014

Simple Modbus Slave

The idea behind thid project was to experiment a little with the serial bus, to have more than one device on s single serial line, aka multi-dropping.

There are several ways of doing this, but one very common way is using the Modbus protocol. The protocol doesn't specify the eletrical interface. I'm going to use RS485. For processing, I'm going to use an ATMEGA8, since it has hardware USART and I2C. The I2C I'm going to use to interface with the sensor, a LM75 temperature sensor. Other hardware bits are LM7805 linear regulator with a Vmax of 30V and a MAX485 for the serial interface. All components except the block connector are surface mount.

The board was laid out in EagleCAD, which was a first for me. I wanted to learn how to use EagleCAD, since so many other hobbyists do. The board came out nicely, I even added a little silk screen art to the bottom in form of a QR code.


The board outline is 5cmx3.5cm, and double sided. I opted for a 1.6mm PCB thickness for rigidity, and green PCB, white silk-screen and HASL for my wallet. I sent away the design to a PCB prototyping service.

A stack of PCBs arrived at the post office a couple of weeks later. By then I had sourced all the components needed to build the ten boards. Well, there was one component I couldn't source, and that was a the one-way SMT DIP switch. If I make another revision of the board, I will make that one through-hole.

I took me a while to hand solder, as I don't have the equipment to reflow solder. Perhaps it is time to invest in one. Anyway, I think the board turned out well.

As you can see, the 1-way DIP switch is unpopulated. If I make another board revision, that would be one of the things I would change. The QR-code works well thought!

Next up is the code...

Saturday, May 17, 2014

DIY EQ-Dir


It is possible and fairly easy to control Synta telescope mounts (Skywatcher, Celestron, Skytech, and more) from a computer. The most common reason for doing this is to autoguide, which was also my motivation.

The mount interface is a standard serial device, but with TTL levels.  TTL is an abbreviation for Transistor Transistor Levels, and means that a logical 1 = 5 volts and a logical 0 = 0 volts.
Normal serial devices usually work with something like logical 1 = -10 volts and logical 0 = +10 volts, thought there isn't a set standard. (Note: standard serial has inverted logic, on a hardware level a negativ value is logical 1.) If you fed your telescope with these levels you would probably damage the mount controller box, so we need a device that can convert between standard serial levels and TTL levels. This is what An EQ-Dir does, if you've heard that name before.

There are sites that sell these devices ready made, for bluetooth, USB, or a standard serial port, but they are very easy to make yourself, and cheap.

Since none of my current computers have a serial port, I had to find another way interface with my mount. I had two options here: a USB to serial adapter with a sort of TTL converter on the serial end, or a direct USB to TTL adapter. The USB to TTL is actually simpler to make, since the former would require a power supply to drive the TTL adapter.

You can a USB to TTL adapter from ebay, dx.com, or similar. Buy one with a chip from FTDI or Prolific, as these work well for this application. They cost as little as a US dollar including shipping.



The next, and only other, thing you'll need is an ethernet cable you can sacrifice. Cut it to desired length, and strip of a length of the outer insulation.

Only three wires are needed, one each for TX, RX, and signal ground. These are the minimum number of connections for a two-way serial interface. (Note:While researching the solution I came across a few posts that claim you also need to connect the RTS/CTS/DTR/DSR lines, but my mount worked happily without them. I almost never see these lines in use, and I suspect they can be left out on all Synta mounts.)


On the ethernet cable, it is the midle pins that are in use (4,5 & 6).


Connect as marked on the adapter, where 4 goes to  GND, 5 to TX, and 6 to RX. The colours on the wires in the ethernet cable are normally blue (4), blue/white (5), and green (6).

That's it. The rest is all software.

Saturday, November 30, 2013

Thesis

Well, the thesis was handed in this summer, and I'm now a Master. I didn't post my progress, simply because It was a mad bussy time.

I may post some of the main results, but at the moment I'd like to do something completely different...

Monday, August 13, 2012

Raspberry Pi meets Invensense MP9150 (Thesis)

I've been playing with the Raspberry Pi for a couple of months now, and I must say it's a wonderfull piece of equipment. The ARM processor is very powerfull, and Debian is a great OS. I've been using gcc to compile my pprograms, which I have some experiemce in. The first stock Debian image didn't have I2C support, and it was quite a chore to compile the kernel. With the new Raspbian distro, I2C should be included, aswell as hardware FPU support. I've not started using it, but probably will soon.

I've managed to port my DCM code to gcc, and it's running well. I'm no longer using my sensor stack, but a development board for the new Invensense MP9150. That chip is basically an MP6150 gyro and accelerometer combo with a magnetometer on the side. I've not started using the magnetometer, but will soon. I'm currently working on a roll/pitch platform that can simulate motion. Will post more about that very soon...


Tuesday, April 17, 2012

LM75 based I2C temperatur sensor PCB

Again Zuken Cadstar has messed up my PCB! I'm sure there must be something I'm doing wrong, but for some reason, the ground plane copper fill that cadstar does ends up separating the plane in parts.

Anyway, apart from finally soldering together a functional board, I was eager to test it out together with my newly aquired buspirate. Not much success thought, but I think I know why: it's a problem with the address lines on the LM75; it's either a too low resistor value between the address lines and the dip switch, or the address selection through a dip switch is not a good idea.