I’m thinking about updating the Standalone Temperature Logger to use an external EEPROM and since one of the ATtiny85 pins which correspond to hardware I2C/TWI is used by V-USB, a software implementation is the way to go. I found Soft I2C Master in Arduino code which allows any 2 pins to behave as an I2C interface.
Naturally I decided to convert that code to pure AVR which is available for download here – AVR_Soft_I2C_Master_v1.0
My modifications to the Soft I2C Master code are:
Made to work directly with AVR (De-Arduino existing code)
Changed from C++ to C
Added soft_i2c_eeprom_read_byte and soft_i2c_eeprom_write_byte
Example code
Here’s my example which writes 1 byte, reads that same byte and blinks the LED if the byte is the same.
The Non-Contact Blackout Detector has been updated to v1.1. The PCB got etched and you can see that the back of the board has a block of exposed copper which acts as our AC interference detector, it’s not as good as using wire. I’ve placed it into a small container.
Now I thought I’d link this project with the Nokia 3120 Keypad SMS Sender to make a project example named the Blackout SMS Sender. Download the Blackout SMS Sender_1.0.
In the above video you’ll see that the Blackout SMS Sender will SMS me once the power is out and then will SMS me once power is restored with how long the power was out for.
Modifications to the Nokia 3120 KSS were:
Use Timer0 interrupt every ~0.5 seconds to keep track of the time PB5 has been high for
Uses delay_ms again as we are using Timer0 to do interrupts and it won’t work well with the watchdog timer
Uses system sleep IDLE instead of PWR_DOWN as Timer0 won’t wake us up in PWR_DOWN
The Nokia 3120 Keypad SMS Sender has been updated to v1.1 to use the ATtiny261 and another ULN darlington array. View the project page.
v1.1 (29 January 2012) – Download
– Uses ATtiny261 to remove the extra transistor / mosfet circuit
– Uses a ULN2003A instead of 4 transistors
– Use a spare output on a ULN2003A to turn the phone on when we want to send an SMS
therefore saving the battery until we need it
– Use the watchdog timer instead of delay_ms
It’s been a while since I etched any boards but I got around to etching the Low Voltage Battery Monitor PCB yesterday.
I did have a slight issue with the 3V battery holder, it was supposed to be mounted on the top but the battery holder that I was using in Eagle was smaller than the real thing so I just mounted it on the bottom. Version 1.1 fixes this issue. Other than that it works well and I can now say is the largest PCB I’ve made.
Today we’ll be making a simple circuit to detect whether a blackout has occurred and when it has we can be alerted, it should be non-contact so we don’t need to plug it into a power point.
From my previous projects I’ve noticed that the ADC in MCUs can be quite sensitive, if you leave the ADC ungrounded and do a reading it fluctuates. When you connect a floating wire and then touch the wire or move it around you can see even more fluctuations.
We can use this to our advantage, by placing a high value resistor like 1 Megaohm to ground then when some interference is detected it will fluctuate from reading 0 (ground). After some testing, it’s best to read the ADC multiple times in a short amount of time rather than just reading once and relying on that reading. We’ll be using it to detect AC interference by placing it near power points or power cords.
I’ve been looking at GSM modems and wondering how I could integrate them into my projects, they are around $50 or so (Sparkfun) to play around with. I’m thinking of using them to send an SMS when an alert is detected for a sensor, this could be a smoke detector, intruder alarm, temperature rise, etc. All you would need is a pre-paid SIM card and some credit to last a few months.
With everything, I want to use something that I already have and in this case I have some old mobile phones. It’s crazy to think that you can buy new cheap mobile phone now for around $26.
One of the old phones I have is a Nokia 3120. I’ve read there is a MBUS/FBUS protocol which you can use to send or receive SMS’s however my attempts to send any data to the phone fell on deaf ears, I could probably figure out what I should be sending if I had a data cable to sniff the traffic. So I was left with the only thing I could do, wire up the keys and make our MCU press them for us.
I recently received a question in regards to the thermistor formula found on one of the SATL build posts asking how I came about the variables used in the thermistor formula. The thermistor formula and variables I used can be found on the Arduino Playground however it made me think if the formula being used was accurate for the Vishay 10K thermistor I was using.
Below we have the Thermistor function in question in which it converts the ADC value to a resistance value in ohms, applies a formula and convert the result to celsius.
double Thermistor(int RawADC) {
double Temp;
Temp = log(((10240000/RawADC) - 10000)); // Minus by 10K as that's the resistor in series with the thermistor
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp - 273.15; // Convert Kelvin to Celcius
return Temp;
}
Steinhart–Hart equation
The formula used is called the Steinhart–Hart equation which models resistance to temperature, there is the “full version” and the “commonly used” one. A, B, C and D in the functions below are called the coefficients.
Full version: 1/T= A + B*ln(R/Rt) + C*ln(R/Rt)2 + D*ln(R/Rt)3
Commonly used: 1/T= A + B*ln(R/Rt) + D*ln(R/Rt)3
Today we’ll be looking at the Cyberguard Snapgear SME530 VPN Firewall Appliance which is used between modems/routers and the network, kind of like a UTM. Cyberguard were bought out by McAfee and then discontinued.
Two screws later and we’re in. If you look near the bottom right, you’ll see a battery probably for the RTC. Interestingly enough the Netgear UTM which I took apart also had one too but routers/modems don’t have them, I guess these kind of appliances where logs are everything you don’t want to re-set the date/time when they power down or reset .
I have some rechargeable batteries which are on their way out as they only seem to last 1-3 weeks but I never quite know when they are flat when they aren’t being used. So Instead of buying new rechargeable batteries (which is the easy solution), I thought why not make a simple project out of it.
(Testing with only 1 AA battery)
Introducing the Low Voltage Battery Monitor (LVBM) – a 4x AA battery monitor which will blink an LED every 4 seconds if a battery is found flat and checks good batteries every 15 minutes.
Today we’ll be making a modification to the Standalone Temperature Logger which will allow us to log voltage instead of temperature. I would like to log the voltage of a 12 volt battery or the small solar panel that’s charging it, so I’m aiming for a voltage range of 0 to 15 volts.
The ATtiny85 in the SATL is powered by a 3 volt battery and the ADC (analog to digital converter) measures 0 – Vcc by default (3V in this case). How can we use the ADC (analog to digital converter) to increase its range to 15V? We can use a voltage divider to divide the voltage by a certain ratio.
AdvanceVGA – Play your GBA on the big screen! Swap out the LCD for our board, solder some wires, connect 5V USB and VGA and you’re ready to go.
GBxCart RW allows you to backup GB/GBC/GBA ROMs, save or restore game saves and re-write supported flash carts. Mini RW option available for GB/GBC only.
Wireless Gameboy Controller – Use your Gameboy, mGB, GBC, GBA, GBA SP, GB Micro, NDS and NDS Lite as a wireless controller on Windows, Linux, Raspberry Pi, etc, and on your NES, SNES, N64, Gamecube and Wii.