Sunday 30 June 2019

Watch what you are doing

"In a crystal we have clear evidence of the existence of a formative life principle, and though we cannot understand the life of a crystal, it is nonetheless a living being."
Nikola Tesla

What a mind we had in Nikola Tesla - head and shoulders above us all. AND he liked crystals - that is a deal sealer for fave nerd. We love crystals as well, and in fact have been tinkering with quartz watch crystals

These little fellows oscillate around the 32768 Hz mark - which is great because 215‎ = 32768. Seeing as how microcontrollers love to process in binary it is remarkably easy to convert all those hertz to a simple 1 second oscillator by repeated binary division. So we can slap a crystal on the XTAL clock pins of an AVR and with a little tweaking it's possible to mostly snooze the chip and let the crystal oscillate quietly in the backgoround, which gives rise to the idea of keeping time without an external RTC.

We are VERY early in that process, but have proof of concept using the Atmega88 guinea pig as a test case - and it works fine blinking a light at 1 Hz. Next is to write some code to make use of that regularity - and finally some method of tweaking the code to exactly match the crystal's frequency for far greater accuracy.

Here is the little guy crushing it at 1 Hz - see the silver tube at the back of the shot? There should be some capacitors helping out as well, but this is a rough circuit mainly to test the code side of things - much more development to come.



We'll keep you posted. On time, every time (er, that is if it works, otherwise we may be a few seconds late).

Meanwhile the passata queen of Tasmania has been churning it out today, and here is a selection of the 15 containers to flow from the kitchen this afternoon. Impressive and yummy!

Last of the home grown tomatoes - passata!




Saturday 29 June 2019

Rustic routine

"Follow your dreams, work hard, practice and persevere. Make sure you eat a variety of foods, get plenty of exercise and maintain a healthy lifestyle"
Alexandra Pauline "Sasha" Cohen

There are a couple of approaches to exercising up here in the hills. One option is to gloriously sleep in, wait until the conditions are just right, put on the exercise gear including short shorts and a headband, and then go for a 10 minute jog up the road and back. Done!

Alternatively, one could be rudely awoken on Sacred Saturday to be told "We're ahead of schedule, your three tonnes of wood will arrive in 20 minutes." Then you race outside in whatever clothes you have lying on the floor and spend the next four hours lugging wood hither and thither about the place while the wind and rain threaten to derail the whole deal.

Which method do you think prevails in these parts?


The mid-winter delivery of wood is a little OTT given that we have so much already stored, but squirreling away while the going is good is our method of keeping sane, and it is so nice to have good seasoned wood when we need it. So who can blame us for "exercising" away our precious Saturday.

Stay warm y'all.


Saturday 22 June 2019

The slow guy

"There is more to life than simply increasing its speed."
Mahatma Gandhi

We have been trying to reduce the power requirements of the solar candle project by increments in order to extend the useful available light after the big yellow goes down for the night, and one possibility that seemed promising was buried deep in the datasheet for the attiny13a.

We always thought that people who pore over datasheets need to get out more, but here we are looking at reducing the current requirements of a microcontroller by telling it to process commands at the rate of 128kHz instead of the previous 1.2MHz. The datasheet (page 125 onwards) makes the following observation.

Reduce speed and voltage = reduced current
The promise is like every typical electronics quest we have embarked upon in that various technical requirements must be met in order for any possible magic to occur. Firstly, there must be a way of communicating with such a slow sleepy chip - and this is done by updating the firmware on a typical usbasp programmer and bridging a couple of jumpers as per this excellent tutorial from our good friend Łukasz. The resultant programmer can then communicate safely and effectively with the attiny13a at tortoise speeds.

Two programmers connect and a slow guy emerges
So a quick breadboard experiment showed that a standard chip galloping along at 9.6MHz consumes 4.3mA doing candley-goodness, but that it's current reduces to 1.3mA at 1.2MHz and finally a miserly 400μA at 128kHz. Setting the clock fuses using this very useful site results in a command line for avrdude along the lines of "avrdude -c usbasp -p t13 -P /dev/ttyS0 -b 250 -U lfuse:w:0x7b:m -U hfuse:w:0xff:m" (yep, that'll do your head in).

Finally the new code should contain the line "#define F_CPU 128000UL" and then after compiling and uploading - presto a slow guy doing the same stuff as usual, but using less current - noice!

This aspect of the project coincided nicely this week with the arrival of PCBs from China which have been slightly redesigned to include a 100nF decoupling capacitor for stability of voltage to the microcontroller, as well as smd sized diodes (circled below) to further reduce the footprint of the PCB - simply awesome (and fun to solder with our new soldering station).

The finished product flanked by the bare PCBs, note SMD diodes
There is little more to do now apart from fiddling a bit with the inductor specs (shown above as 1/4W and 47uH), and then looking for a nice container for the electronics which throws a warming light and has room somewhere for the solar panel. Some more sunshine would be great but then again if these slow guys work well in the depths of a Tassie winter then that augurs well for longer burn times as the sunshine increases later in the year.




Monday 17 June 2019

Adaptation

"To live is to exist within the boundaries of what is permissible and what is not. Adaptation to this is called life." 
Elmar Hussein

We bundled the pups into the Dmax and drove down to Franklin about 7am this morning (a minor variation on the work routine). It was around 0°C and the pups were in an unheated canopy with the window ajar for airflow. How could they possibly cope with the frigid conditions?

Well, they have all adapted in their own way. Jess eats anything that moves (or doesn't) and so she has a healthy (?) layer of insulation. Kelly bounces continuously, thus generating enough heat to power a small village. Oskar has grown a peculiar undercoat that makes him look like a shabby old man.

Insulation factory
He doesn't like you pulling it out either - he finds it highly offensive when we grab his tufts, yank out handfuls and then roll about the place laughing. Despite all of that - he remains warm and in fact even when the temperature dips below zero in the wee hours of the morning you can often find him outside on the frosty lawn surveying his lands by starlight. After telling him to "Get to bed!", he shambles off, only to reappear a few minutes later and take up station again. Now that's adaptation.

For our part we still enjoy the heater on in the car, but we must admit we often find ourselves commenting about the nice warm day only to realise that the mercury is yet to hit 10°C! Perhaps you have noticed we have a slightly disheveled thick coat now? If so, please don't pull out handfuls of fluffiness - it's needed this time of year!



Sunday 9 June 2019

Same as it ever was

"Too bad that all the people who know how to run the country are busy driving taxicabs and cutting hair."
George Burns

We have eschewed recent discussions about politics both in the real world and also via this medium since the 2019 Federal election. With the howling twits on twitter providing all the commentary that you will ever need in just a few rabid bytes, it seems unlikely that our contribution could ever TRUMP their, er, insight. We can say that given a choice between Tweedledum and Tweedledumber, it was no surprise that Tweedledumber got up for the prize in the end.


Whilst we continue to hover around 50% for Tweedledum and the same for Tweedledumber, there is always going to be a lot of angry voters (and disillusioned non-voters) out there in this moribund country. Meanwhile trifling matters such as a tanking economy and existential threats go unnoticed, but non-existent threats are dealt with bizarrely, for example using the AFP as a political weapon. So when do you frogs realise that you have boiled? Over to you citizens!

And to lighten up the mood, here is Kelly munching on a mate (a Christmas present from her sometimes carer Ruby)

Death to the lion!



Saturday 1 June 2019

(UN) Efficient Chips

"There are no small accidents on this circuit."
Ayrton Senna

With the recent deaths of Niki Lauda and Robert J Hawke, we are feeling a little like the old world is slipping away one soul at a time. Despite that perception, however, Ayrton Senna's warning about race circuits still feels very current (small joke) as we explore the wonders of the LM317 chip and associated circuits.

At around AU9c each delivered, they perform the improbable double act of being able to control voltage in one configuration and current in another. We did have a few accidents in these circuits along the way, and thus we bid farewell to a few LEDs and a trimpot that let out the magic smoke in the pursuit of understanding.

Constant Current
Assuming the supply is up to the task, the LM317 can keep current constant as the load changes (in this case more LEDs added to the mix). The current can be selected and maintained using a variable resistor in the following configuration.



Variable Voltage
In another guise, this versatile unit can also be used to select a voltage output, again being careful to get the connections right to avoid the stinky fails.



We're not convinced that these are particularly efficient circuits, but given that the LM317 datasheet boasts stats of 1.25-37 V output from 3-40V input, and current peaks of 1.5A, we'll forgive any problems in exchange for cheap and versatile. It's been around since 1976, and likely to stay in our kit for a few more years yet.

Nice one.