Temperature and light, several days

Well, It’s been a number of days since I built the unit and all’s been tested. Here is a picture of some of the data from my living room over the past several days. The purplish is the temperature and the lighter one is the ambient light. You can see that as the light levels get higher, the furnace stops, thus the temperature stops fluctuating.

The living room temperature as seen over 6 days
The living room temperature as seen over 6 days

Sorry about the small scale of the temperature graph, the graphing program is still a work in progress.

Temperature and ambient light tracking

So, since I’m really bored I decided to build a device that tracks ambient temperature and light levels. While this may not seem very interesting, I suspect the relationship between the two, while not directly linked, will be interesting especially when placed outside. Well, I suppose I’ll put a few pictures up and outline some of the stages I went through to get it to this point.

1. Prototyping.

The initial version of the sensor, using older stuff from viscometer project.
The initial version of the sensor, using older stuff from viscometer project.

This didn’t take long. I already had a board with a single supply opamp (JRC 7014D) on it that was already set up for the LM335Z temperature sensor. I used a bread board, as can be seen in the picture, and used a messy bunch of wires coming from the PICKIT2 to the MCU. I chose a PIC16F684 for this job since it has some analog channels and it doesn’t have too many pins.

2. Checking it out. In order to see if the Voltage range will allow for freezing temperatures and room temperature, I had to test it with some snow.

Cup o' snow to check and see if the Opamp is biased correctly
Cup o' snow to check and see if the Opamp is biased correctly

Temperature check with the IR gage
Temperature check with the IR gage

The voltages swung just fine with a bit of extra range. I have about 50C to work with in range, good enough.

3. Making the board. For this I used a board from measurexplorer. I have tons of these but haven’t had much luck using them. The only ones that have worked well for me are the ones with 3 holes per pad. Anyways, here are some pictures.

Start of prototyping the board
Start of prototyping the board
Finished Sensor board with both light sensing and temperature sensing
Finished Sensor board with both light sensing and temperature sensing

Anyways, This board took me a couple hours to make but it works well and required no rework, thankfully. You can see both the LM335X (TO-92) and the CDS for sensing the light. This board interfaces to an RS232 board that I’ve made and that I use for some of my other projects.

4. Getting ‘er running. While the unit itself is already programmed in terms of the MCU. it needs some adjusting for voltage on the pot and that’s about it. now to affix it to something so it doesn’t move around.

RS232 and Sensors glued to a board
RS232 and Sensors glued to a board
Tracking it on the computer
Tracking it on the computer

As you can see, I simply used hot glue to affix both the RS232 board and the sensor board to the block of wood. Its a temporary arrangement while I come up with a good enclosure for outside. I brought my old laptop out into service for this project, works well just for collecting data.

Anyways, here are some images of some collected data.

Living room temperatures (click to see description)
Living room temperatures (click to see description)

Basement (click to see description)
Basement (click to see description)

Well, so far so good. Now I’ll make the enclosure for outside and improve the sampling. hopefully I can leave it out all spring/summer and see the patterns.

Playing around, drawing a valve.

I was a little bored today so I decided to draw a valve. While the dimensions are entirely drawn from my head and the valve itself wouldn’t be very efficient, I like the look of gas compressor valves. It took me a couple of hours to draw but they look OK.

I didn’t tag them or describe them. There is a seat, a guard and a valve plate. I omitted the dowel pin, bolt, center nub and lock nut. I just wanted to see what it looked like in solids. 🙂

Kinda been in a creative funk…

For the last while I’ve been in a bit of a creative funk. Troubles at work and the the weather have made it difficult to concentrate on the things that I like. Anyways, perhaps while I have some time off I might make use of it to do some stuff. Don’t know really.

That brings me to my next topic. What I should do.

Firstly, I think I’m going to start taking more pictures of Edmonton again and post them on Panoramio again. Frankly, this is the reason I started taking pictures in the first place was to provide images of Edmonton for whoever wanted to look and explore both the nice parts and boring parts of our city.

Secondly, I’ll finish that fucking clock. Really not much more to do it it, just make it so you can set the time.

Thirdly, focus on building a working vibratory viscometer. It’s the ideal way to measure Krebs units in an environment as harsh as paints and it will be substantially cheaper.

Anyways, End of Line.

The LED Clock

Well, for the past little while, I’ve been working on a bizarre clock made with LEDs glued into a dollar-store cookie sheet. I got the idea just out of the blue and decided that it would be fun to build. Now, it’s nearing completion so I figured it’d be prudent to document the miserable contraption. I guess I should go through the steps it took to get this thing running.

First, I took one of those dollar store cookie sheets and drilled it through for 40 LEDs. 12 for the hours, 12 for the minutes, 5 for the seconds, 5 more for the div/5 minutes and five more for the outside and the PM light.


Drilling it wasn’t much fun but, when it was finished, I started to insert the LEDs with the grounds all towards the outside of their respective circle. Then I mixed up some epoxy and drizzled it over the backs of the LED’s. Unfortunately, the epoxy didn’t hold very well on the other epoxy surfaces so I used hot glue to tie them down.


As you can see, I labeled it in reverse of the other side so that I could get ‘er working. Thus started the long job of soldering the whole thing.


The image show isn’t the complete one, but it took me several hours to solder it all together. I used 7 groups of 6 LEDs in order to display the image. In this case I used the 7 groups for the duty cycle, thus a 1/7 duty cycle was used. Each of the 7 groups is fed ground through an MPSA13 Darlington transistor. Here’s a picture of the board that controls it.


Pretty fucking ugly, I know. But it works and I used an MCU (PIC18F4685) that was a little overkill but that’s fine, I’ve got quite a few of those. Anyways, so far so good, though it seems a little impractical as a clock and I think I set the rings of the minutes and hours too close together. Oh well.


The lamp I’ve been saying I was going to build

Well, I’ve built it, the useless yet fun, timer lamp. The idea behind the timer lamp is to have a bedside lamp that you can turn on and of but also set it to turn off after a certain amount of time. This task is pretty easy but I wanted it to be controlled by a micro controller. After two years of thinking about it I finally got off my duff and built it.

Here’s a blow by blow of how it was built.

Controller board

First I took the thing apart. The wire itself is pretty tough to chew on so I kept it in there so I can save the lamp itself. The lamp was bought from Wal-mart for about $18.

Controller board

Here’s a blurry pic of the control board I designed. It’s generic in that it can take both digital and switch input and output 200ma per channel on 3 outputs. It’s nothing special but it’s small enough and it works. The MCU on it is a PIC16F505, not a great MCU but it works.

Lamp Husk

with buttons

And here’s the casing on the base. Inside was some sort of bizarre weight made of something I did not want to cut.  I took the guts out and popped two 5/8 holes for the buttons. I didn’t have a proper drill so I used a forstner bit, not ideal bit it worked surprisingly well.

ugly guts

I inserted the guts of the machine and had to follow the existing wire in and keep the controller towards the front. As you can see, it’s pretty ugly, as well I used hot glue to affix the boards to some wood which was then affixed with hot glue to the inner casing. It’s not an ideal solution but it relieves me of having to use bolts and it was fast.



And there you have it, it seems to work. No fire, or smoke and it works as programmed (kind of). Now I’ll have to go to work and build a new base, one to keep the unit steady, also I think I’ll add a little piezoelectric tweeter for audible confirmation of time selected.

Anyways, I’m glad I made it this far on the project in such a short amount of time.

Project Report

Following is a report of my progress regarding the viscometer. Having spent several months on this project and having gone through four mechanical iterations and umpteen electronic iterations of design, it’d be a good idea to go through and describe where I am in the project, and where I have to go in order to follow the project to completion.

Electronic Side

Magnet Drive (click image to see full size)

Magnet Drive

This unit is the main magnet drive. It is responsible for the pulse width modulation control of the four H-Bridges below it. Each H-Bridge is fully optically isolated, can happily push 15A at ~3KHz with any duty cycle. The H-Bridges were also designed in such a way that they don’t produce much power supply noise and very little inductive hiccup. The Board on the top has a microcontroller that controls the four H-Bridges and accepts input from the main control board and the dip switch set on-board for debug purposes.

The unit has been fully tested (waveform, heat and max current) and works, no more modification or re-design is required.

Input Totem (click image to see full size)

Input Totem

This unit was built to stem problems arising from EMF and Static discharge. Earlier versions of the project would suffer from random shutdowns, errant signals and noise. I wasn’t entirely sure for some time why certain events would occur for no reason but even pressing a switch sometimes was enough to roast a microcontroller. I recently tracked it down to long input lines picking up noise and also generating power dips when, say a switch, is activated. This unit isolates the inputs from the faceplate and debounces the signal in order to remove potentially hazardous voltages from making it to the mainboard. This unit also dissipates large transient voltages through the use two voltage suppressors per input line.

Currently this unit works and has been tested. It does require some additional programmatic tweaking.

Main Motherboard (Click on image to see full size)

Visco Motherboard

This unit comprises of a larger PIC18F microcontroller with a 4 digit LED display, this is the primary control board. This board is responsible for controlling the Magnet drive, The LCD Front Panel Display, The Debug Display (The one on the board), calculating the results of data, outputting said result and it also handles the filtered input. This is basically the ‘brain’ of the machine and this particular part of the project has gone through the greatest number of iterations, probably 8 or so.

This unit, circuit wise, works and has been tested. It still requires programming as the entire unit has been redesigned and functions in a different fashion than the previous versions.

General overview (Click on image to see full size)


This is a general overview of what the internals are going to look like when assembled. Of course, these are not the final positions of each unit and a couple of units are missing from this picture (namely the +5v isolated supply and the Serial Out board)

Mechanical Side

The Current Design (click on image to see full size)

Solidworks Viscometer

This is the latest design of the unit. Several design changes have been made in relation to the previous 6 designs (3 were made). Following is a list of changes.

  • Made the magnet units smaller but longer, opting for size in heat-sink area.
  • Magnets are closer together towards the paddle
  • Sensor unit no longer consists of two reed switches and now consists of one hall effect sensor.
  • Timing is found by center point activation rather than activation at extents of travel.
  • Wiring is changed from Single solid-core Teflon coated wire to shielded, multi-lead stranded wire for easier assembly and maintenance. Also the shielding provides protection for outside interference and electrical problems.
  • Top and bottom plates are solid instead of multi-piece in order to simplify manufacturing
  • Paddle is shorter and has less area, PWM will ensure proper shear rates on paddle.

The previous designs had the following flaws:

  • Distance to paddle from magnets was too great, creating a ‘dead’ spot in the center of travel
  • Making a magnet larger does not mean greater field intensity at larger ranges. Each previous iteration was based on the false assumption of larger=stronger.
  • Reed switches were problematic. Either moisture or improper magnetic application proved to create intermittent contact on the switches making for a difficult to track problem.
  • Previous units were susceptible to heat problems. Smaller magnets, lower current and warm-up cycle solved the issue. Plastic sometimes melted under large loads
  • Units were difficult to assemble, thus, difficult to maintain in an industry setting.
  • Units had lots of nooks and cranny s making it difficult to clean.
  • Previous paddles were either too larger or were of the incorrect length at both the signal and Thrust sides.

As far as this part of the unit is concerned, I’m not far from completion, aside from machining.

What is left to do?

So far, not much is left to do on a surface level. I have the following items to complete.

  • Finish design for unit (Decide on arrangement and potting of sensor)
  • Machine parts for prototype
  • Finish some programming on the input totem.
  • Start testing with dummy board
  • Once tests on mechanical portion are done, main board needs programming
  • Program main board (in no particular order)
    • Confirm and program communication scheme
    • Derive algorithms for appropriate sampling and error correction
    • Program debug display
    • Program for parallel LCD display
    • Create initial setup and calibration routines
    • Create run-time user interface and system.
  • Test, test, test.

That’s the list thus far, and completed as per my knowledge.

It should also be noted that I’ve built an automated rotary paddle type viscometer (rudimentary prototype) that is functional and can easily be adapted, with appropriate components, for in-line use. I’ve also produced a working vibratory viscometer, it however doesn’t follow non-Newtonian fluids well.

Hopefully this was informative, thanks for reading.