Category Archives: ATtiny

A Raspberry Pi Moisture Sensor to Monitor Your Plants

For quite a while I am monitoring temperature and humidity in each single room of my apartment. I was inspired by several Raspberry projects, featuring a “Garden Pi“, to monitor my house plants as well, using a probe to measure moisture level of soil.

On the net, one can find many low-cost sensors which are compatible with Arduino or Raspberry Pi. They usually consist of simple PCBs with two electrodes which are pushed into the earth. Moisture is determined by measuring conductivity of the soil which isn’t very reliable for long-term measurements. Cheap sensors are often affected by heavy corrosion, so that  Copper ions will leach out and might poison your plants.

moisture-sensorIn contrast, sensors measuring soil moisture levels by capacitive sensing rather than resistive sensing are much more suitable, because they are made of corrosion resistant material which gives them an excellent service life.

Continue reading A Raspberry Pi Moisture Sensor to Monitor Your Plants

USBasp USB-Programmer Firmware update

I recently purchased a cheap USBasp clone (Made in China), originally developed by Thomas Fischl. It is an USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega88 or ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed.

IMG_6998No driver is needed under Linux in order to program Amtel chips. With the Arduino IDE, it is enough to connect +5V, GND, MISO, MOSI, SCK and RESET to the respective pins of the microcontroller. However, after uploading a sketch, avrdude complained about an outdated firmware version:

avrdude: warning: cannot set sck period. please check for usbasp firmware update

So I decided to attempt to update the firmware on the USBasp using one of my Arduino UNO boards as the programmer. There is a lot of confusing information on the web about how to do this, so here is what worked for me:

Continue reading USBasp USB-Programmer Firmware update

ATtiny/ATmega programming shield

I recently discovered a nicely made Arduino shield for programming Amtel microcontrollers, which was designed by Jeff Murchison. Jeff is sellling the shields on Tindie. Unfortunately, the shield was out of stock at the time of writing. Thus, I dowloaded his fritzing project files from github and ordered a PCB at fritzing.org. It saved me of going through the hassle with German customs as well, since Jeff’s shields are shipping from Canada.

Continue reading ATtiny/ATmega programming shield

Home automation – Driving a relay with RasPi/ ATtiny

So far I’ve attached devices to my Raspberry Pi or Arduino Uno with ratings less than 100 mA. These devices were connected to the output pins through a transistor or optocoupler. However, for heavy load currents a relay must be used. As a noob, it is somewhat difficult to chose parts with the right specs for driving a relay — so here are some hints.

Continue reading Home automation – Driving a relay with RasPi/ ATtiny