You are currently browsing the hack tag archives.

pushpin

Tinkerers’ Rules

Brought to us by Wondermark.com

Quoth the Maker: If you can’t open it, you don’t own it.

pushpin

Chronodot Library for Arduino

When I was working on my Thermostat project, I came across the Chronodot RTC (real time clock) and decided it would be the perfect choice. Not just because it’s incredibly accurate, but because it provided both time and temperature readings in a single package. I could have used another RTC such as the DS1307 which is less expensive, but then I would have had to use something else for reading the temperature.

The only thing about using the Chronodot to get temperature readings was that there wasn’t an Arduino library that could get me that information. The Chronodot communicates using the i2c protocol, and as I hadn’t used it before I was hoping to find some examples and a usable library. Fortunately it’s compatible with the DS1307, but of course that library has no reference to temperature as the ’1307 doesn’t read the temp.

So using the ’1307 library as a starting point, I expanded it by adding two new readings to it: temperature, in both farenheit and celcius.

The library includes an example sketch. If you’re familiar with using the DS1307 with an Arduino then the Chronodot library will be an easy drop-in replacement. The time features are unchanged, I’ve just added the two temperature readings so they’re available within your sketch.

Click here to download the library: Chronodot_Library.zip

pushpin

Hacking My Brain

I just built a Brain Machine kit from Adafruit. Originally designed by Mitch Altman, it reminded me of a bio-feedback brain device I had built some 20-25 years ago, after reading about it in a issue of Radio Electronics magazine.

The basic premise in both cases is that you can guide the brain to synchronize with external stimuli oscillating at a rate that matches one of the brain’s normal wave patterns – Beta (awake / consious), Alpha (dreamy / trancy), Theta (subconsious), Delta (creative), Gamma (intense thought, problem solving).

The Brain Machine is designed so that you can program it with an entire sequence of patterns, changing the waves and durations as desired for a given program purpose. The kit comes with a 14 minute meditation program already written to the microcontroller.

The stimulus given to the brain is in the visual and auditory areas, by way of two red LEDs (one per eye) and a set of standard stereo headphones. The LEDs alternate-pulse at the desired brain-wave frequency while the left and right speakers of the headphones each play a different tone; the offset between the tones (binaural beats) is also the desired brain-wave frequency.

Personally, I found the headphones a bit distracting so I won’t use them as much. Maybe it’s just me but I only experienced the ‘binaural beat’ thing a couple isolated moments, otherwise I just heard two different (slightly annoying) tones. Useful for blocking out external noises, but my home is already a quiet environment, usually.

Using the brain machine is… trippy. I would love to be able to share images of what I saw, but in lieu of that, here are some attempts at describing a few moments.

  • Predominantly I experienced a lot of geometric patterns that were repeated infinitely across my field of view; waves of triangles, squares, pentagonal and hexagonal forms. Sometimes superimposed, eg. my left eye was seeing hexagons while my right was seeing pentagons.
  • Then it was like floating through outer space, surrounded by stars. While flying through a meteor shower. With TRON special-effects. As viewed through a kaliedescope.
  • I became able to see the individual cells of my own eyelids.
  • Then I could see the electrons travelling through my optic nerves, all buzzing about in frantic bio-feedback.
  • Then everything fell away and I could see the entire Milky Way galaxy above me, moving in accelerated time.

It’s amazing just how many colours you can actually experience, given that the only colour used is red. I was seeing blue, green, purple, red, and white, and to a lesser degree, yellow and orange.

After taking a couple trips with the default meditation program, I am thinking it would be cool to create a bunch of different programs. The ATTiny25 chips are inexpensive so you could actually burn a number of them, each with a different program. Then just pop in the one you want at the moment, and let it run.

You could have a chip/program to get your mind stimulated and ready to work; a program for relaxing at the end of the day; a program to get the creative juices flowing; a program to just bounce from one waveform to the next to give your brain a slamming roller-coaster ride. Feed your brain various programs, and see what happens.

Trippy.

pushpin

Updated Already

I couldn’t leave it alone, of course. Had to take it apart again today and make an update.

That thing with the WizNet module hanging sometimes, I had applied a very makeshift fix to yesterday. See, the WizNet doesn’t have its own power-on reset, but it needs it. They suggest you use a digital pin from your uC but I was out of pins. So I used a 10uF capacitor, which was enough to ground the reset line on power-up or manual reboot.

The problem was, I had my WizNet reset tied to my Arduino / ATMega reset, and the capacitor meant I couldn’t update the programming. At least, not without temporarily removing that capacitor.

So it turned out, I did have a spare pin. I had been holding A3 in reserve. Just incase the temperature readings from the Chronodot remained inaccurate due to the heat from the WizNet, I was prepared to add a TMP-36 analog temperature sensor, and dangle that a few inches below the enclosure. Luckily, with the thermostat mounted vertically on the wall, and the Chronodot a good 1″ out with open air around it, the temperature readings are accurate.

So I pulled it open, removed the capacitor, and unhooked the WizNet reset line from the Arduino / ATMega reset line, and tied it instead to A3. A few quick changes to the software, and presto, no more hang-on-powerup and it can be reprogrammed without any soldering. Yay!

Also, I decided to go ahead and show off the guts. Why not? Just be warned, if you’re easily upset by ugly wiring hacks and poorly-planned soldering and random wires and tapes and dead-bug construction… well just don’t look.

And finally, here’s a link to the updated software. The zip file also contains a text file that outlines the pinout & functions for the ATMega chip, the WizNet module, and the function of the HVAC lines — or at least, how they function in my house.

pushpin

The Humble Thermostat

I’m a big fan of the Thermostat. They’re clever, and all they want is for us to be comfortable.

Even the simplest mechanical ones are really little robots, whos only goal in life is to keep you comfortable. You tell them what you want the temperature to be, and they dutifully turn the furnace (or A/C) on and off all day and night so that your house remains in your comfort-zone.

The programmable ones of course take this to the next level – with a programmable, you don’t even have to tell the thermostat what your desired temperature is. Or rather, you tell it once, what temperatures you prefer throughout the day and the week, and from that point on, it keeps you comfortable. It’s like magic.

What else in the home works so hard to keep us comfortable, yet asks for nothing in return? The only thing that I can think of that comes close, is a chair or a sofa.

Despite all this, however, I’ve been starting to want more, from my thermostat…

The first seeds were planted several years ago. I saw a programmable thermostat that came with two remote controls. It was outrageously expensive, but there is an undeniable appeal to the thought of being able to crank up the heat without getting out of bed, on a cold winter night. The cost, however, was beyond my means at the time. And by the time I could afford it, that unit was no longer available.

Then last year, the local utility company sent out offers to get a thermostat that you could program over the internet. It sounded like a good idea, but at the time, I did not persue it. They sent the offer again this  year however, so I did investigate.

Their unit is a normal programmable thermostat, that has an RF receiver in it – basically a numeric pager unit. This allows one-way communication, so you can send commands to the unit but not retrieve any information. It’s free, but you have to give up some control: they’ll give it to you, if you agree to let them turn off your air conditioner if the demands on the power grid are too high.

Still, it looked hackable so I filled out the application. They never got back to me; I figure its because I use so little power that they’d never recoup their costs of giving it to me.

Finally, last week I spotted a thermostat at Canadian Tire that came with a remote control. It wasn’t too costly so I grabbed it, with the intent of hacking it. It was a Noma model, which I think is CT’s house brand? Whatever. Let’s look inside!

Aside from the generally poor construction, here’s some things to note: The unit uses RF communications, at the 915MHz band. Comms are one way only, with data going from the remote to the base. This allows the base to display the temperature info from wherever the remote is, but the remote cannot display the temperature, mode, current function, or anything else, from the base. The remote allows you to override the base to a maximum of +/- 6 degF (3degC). Finally, both the remote and the base use a cheap thermistor to determine temperature.

So, it’s not perfect. The one-way comms is a real limitation I think. An additional pisser is that you can easily hack into the comms on the base (since the RF is on a daugher board) but on the remote, it would be much harder as none of the communication lines are accessable (damn those black blobs.) So anything you hack in, is easiest to add at the base, meaning you lose the remote aspect – or have to roll your own remote anyways.

Indeed, when I tried to use it as it was intended, it didn’t really work well anyways. It’s a novelty, but not really a very good thermostat. Verdict: Fail.

So what is it that I really want?

Putting together all the various ideas, I want a thermostat that is programmable and runs fine as a stand-alone unit. I also want it to be able to be accessable via remote control, but with two-way communications, so that a remote unit can at least display everything that the base unit can display, plus the remote should be able to alter the temp, maybe switch modes to hold / run, that sort of thing. Finally, it would be really nifty if it could be wired into my home network, so I could access the data and control through my computer, laptop, iPhone, etc.

The solution, then, is to build my own thermostat, from scratch!

Stay tuned, this story is not over.

pushpin

Dingoo A330

It’s the new release from Dingoo Technologies. I got one to satisfy my curiosity, but sadly it disappoints on many levels.

Dingoo A330

I made up a new version of Dingux that takes advantage of the added memory and faster clock speed. To do that, I needed to get a serial port in there for testing. Unlike the A320, the 330 seems to just have half a port; TX but no RX. So you can get debug data out, but you can’t interact with it. Sucky.

Probing for the RX Line

The TX data is found on a single unmarked testpoint that lies beneath the LCD screen, in the upper middle part of the motherboard. In hopes of finding the RX line, I did some probing to the copper traces around the CPU in the area of the TX line, but neither of my two most-promising candidates proved to be RX data. It is probably not connected at all. More sucky.

A330 Motherboard

I stuck the serial port on the left-hand side of the Dingoo, above the reset button. It was the only clear spot on the motherboard, but it turns out the left speaker wants to sit there, and the serial port keeps failing on me – I have to take it apart and fiddle with it to get it working again. The A330 disappoints on many levels.

pushpin

Dingoo Serial Port Step-by-Step

I added another serial port to another Dingoo and this time I took pics of the process all along the way.

Click the thumbnails for enlarged images and details.

Cheers!

P.s. I forgot to publish this earlier, sorry for the delay.