Welcome to Part 8, before we get starting with making the PCB I thought I’d review my code/hardware plus add some more functionality to our project.
We don’t need a Watchdog f_wdt variable
On review of my code and the example watchdog code I used, I found that the watchdog f_wdt variable wasn’t adding any value to our code. I came to this conclusion because when you run the system_sleep() function and it reaches sleep_mode(); it sleeps there. When the Watchdog timer wakes it up, it heads to the watchdog vector (ISR(WDT_vect)) and now since it’s awake again it continues to run next bit of code.
// This will work because we are initialising the watchdog vector and
// once the watchdog times out, it will wake up, go here,
// do nothing and continue our code
ISR(WDT_vect) {
}
Now I’ve give you an example of where we might need the f_wdt variable.
Welcome to Part 5, in this part we’ll talk about enabling brown out detection to our Standalone Temperature Logger as a safety mechanism. The information below about brown out detection is also available as a video explanation, I recommend viewing the video whilst reading below.
Before we do anything let’s take a look at the ATtiny85’s datasheet, we want to check what voltage range works on.
Welcome back to Part 4, we now get to see some results of our work :). The video below shows the ATtiny85 running at 5 volts with our standalone temperature logger software and retrieving the data from the ATtiny’s EEPROM and printing it on our computer screen.
Why did I mention “ATtiny85 running at 5 volts”? It’s because we aren’t quite done yet with this project, the next step which is Part 5 is to adjust our code and schematic to run the ATtiny85 on 2 AA batteries. Then after that we need to make a PCB of it!
Lets begin with Part 3 in which I’ll hook up the ATtiny85, program the simple LED blinking test, take it away from the Arduino, run it on a 9V battery and also how we are actually using the thermistor to calculate the temperature.
Firstly we’ll visit the website I gave in the first part, which shows us how to hook up the ATtiny85 to the Arduino so the Arduino can program it. Here is a mirror of the site and download files in case it’s down: HLT wiki Arduino A Ttiny 4585_files
We choose from the Arduino program to open up the ArduinoISP sketch which is below the “8. Strings” selection. Now just upload that to your Arduino.
Welcome to Part 2, here we’ll test our implemented code out on the Arduino for a proof of concept. As you’ll recall the Standalone Temperature Logger’s function is to record temperature every x minutes defined by the user and log this to the EEPROM.
The code is fairly simple and will be explained in this post. What hasn’t been coded is my implementation of a simpler 2 Wire protocol as this actually requires an ATtiny85, so I’d like to make sure the code is functional before continuing.
I plan to build a Standalone Temperature Logger with the minimum components as I can, I’ll be using the ATtiny85 and Arduino software to program it. Firstly I’ll have it run on the Arduino to confirm it’s working, then migrate it to the ATtiny85, make it run on battery and make a PCB of it all. It sounds like a simple concept, but I know there’s going to be more to it that meets the eye.
Design Characteristics
Use the minimum components possible
Power the project with batteries
Specify the logging delay time
Write temperature to EEPROM on-board
How to extract data from EEPROM
Now lets go through all these design characteristics.
So I’m playing around more with the Scanalogic 2 Pro and thought instead of just reading the Logitech LX310 receiver’s EEPROM I would actually probe it and see what’s going on when it starts up. My plan for this post is to make it as simple and easy to follow as possible.
As you might know it’s a ST 95160 16Kbit EEPROM which is uses SPI protocol; I’ve found that SPI is harder to understand and use than two-wire (I2C) protocol. I used the Arduino SPIEEPROM page to assist me as well as the datasheet which once you read parts of it enough times and see what’s happening in the logic actually starts to make sense 😛
Download the complete timeline of SPI communication here: Logitech LX310 Reciever SPI 10Mhz
You’ll need to download the Scanalogic software in order to use the above file. Please note that the ms timeline shown in these pictures may be different to the timeline you download, however all queries are still the same.
Here is an overview of the first 10ms upon connecting to my computer.
What I suspect we see up to the first millisecond is the chip in the receiver is initialising itself by looking at the CS line as it’s going high and low very quickly, plus it could just be the rush of power to it causing the CS to go all funny.
I’ve finally got around to wiring up my 8×8 LED Matrix and now it’s time for some fun with it. Though out playing with this I’ve learnt about shift registers and how we can use them along with a transistor array chip.
First things first, have a read and look through the Arduino’s ShiftOut guide as they are very well put together (keep re-reading it if it doesn’t make sense): http://www.arduino.cc/en/Tutorial/ShiftOut
To summarise the guide:
A shift register allows you to have 8 outputs while only using 3 pins on the Arduino
You send a byte to the shift register which has 8 bits (e.g. 10010000)
You can combine shift registers so instead of having only 8 outputs you can have 16 when using 2, 24 when using 3, and so on
When combining shift registers, instead of sending out the 8 bits to the first register and 8 to the second register it’s actually reversed, so the first 8 bits you send are actually for the second register and the next 8 bits go to the first register
Following on from Part 1, we’ve done our design and now it’s to put our prototype to the test, this will post won’t be as long as the design because all we need to do is test.
This is how our circuit looks to power 1 motor in 1 direction only.
So we’ve got our robot moving in different directions and now we need it to move to the directions we want which is away from walls. We do this using Phototransistors which is sort of similar to a Light Dependent Resistor (a component that changes resistance due to lighting) except Phototransistors actually use infra-red and have two components, the emitter and detector. The emitter well emits the infra-red (which we can’t see) and the detector detects how much of that infra-red is coming back.
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.