We have been asked where to find the most current software that has been released for ProjectCuracao.
This software is hosted at github.
http://github.com/projectcuracao
There will be a new release this weekend.
Pages
- Switch Blog
- RasPiConnect
- Project Curacao Introduction - Part 1
- Project Curacao - Solar Power Subsystem - Part 2
- Project Curacao - Battery Watchdog - Part 3
- Project Curacao - Environmental Subsystem - Part 4
- Project Curacao - Camera Subsystem - Part 5
- Project Curacao - Software System - Part 6
- Installation of Project Curacao- Part 7
Thursday, December 26, 2013
Wednesday, December 18, 2013
GPIO and I2C mappings for Project Curacao
We have been asked to put together tables showing the i2c and GPIO mappings for both the Raspberry Pi and the Arduino Battery Watchdog in Project Curacao. While you can figure it out from the software and comments, it would be great to have the mappings in one place. We are also putting this in Article 5, Project Curacao Software. Updated with solar/wind GPIOs on 01/07/14.
Arduino Battery Watchdog i2c Mappings
Arduino Battery Watchdog GPIO Mappings
Arduino Battery Watchdog A/D Mappings
RaspBerry Pi i2c Mappings
i2c address | Device | Function |
---|---|---|
0x29 | BM017 / TCS34725 | RGBC Color Sensor |
0x39 | TSL2561 | Luminosity Sensor |
0x40 | INA219 | Raspberry Pi Input Voltage/Current |
0x41 | INA219 | Battery Input Voltage/Current |
0x44 | INA219 | Solar Panel Output Voltage/Current |
0x48 | ADS1915 A/D | 12 bit A/D converter |
Channel 0 | Pi Battery Temperature | |
Channel 1 | Camera Servo Feedback Potentiometer | |
0x77 | BMP085 | Baro/Temp readings |
RaspBerry Pi GPIO Mappings (GPIO.setmode(GPIO.board))
RPI.GPIO | Raspberry Pi Name | BCM2835 | Pin Number | Function |
---|---|---|---|---|
7 | GPIO7 | GPIO4 | P1_07 | Rising Edge Interrupt to Arduino |
8 | TXD | GPIO14 | P1_08 | TXD to Arduino |
10 | RXD | GPIO15 | P1_10 | RXD to Arduino |
12 | GPIO1 | GPIO18 | P1_12 | Software PWM for Camera Servo |
15 | GPIO3 | GPIO22 | P1_15 | Pulse to Turn Fan Off |
16 | GPIO4 | GPIO23 | P1_16 | DHT22 Temp/Hum Interface |
18 | GPIO5 | GPIO24 | P1_18 | Pulse to Turn Fan On |
22 | GPIO6 | GPIO25 | P1_22 | Activity LED |
Arduino Battery Watchdog i2c Mappings
i2c address | Device | Function |
---|---|---|
0x40 | INA219 | Arduino Input Voltage/Current |
0x41 | INA219 | Arduino Solar Cell Voltage/Current |
0x44 | INA219 | Arduino Battery Voltage/Current |
0x5C | AMS 2315 | Outside Temp/Humidity |
0x68 | RTC1307 | Real Time Clock |
Arduino Battery Watchdog GPIO Mappings
GPIO | Function | Comments |
---|---|---|
22 | Interrupt Pi | Level |
27 | Pi Latched Relay Reset | Pulse |
29 | Pi Latched Relay Set | Pulse |
35 | LED Pi Interrupt On | Arduino Battery Voltage/Current |
41 | Select Wind Set | Wind Turbine |
43 | Select Solar Reset | Solar Panels |
Arduino Battery Watchdog A/D Mappings
Channel | Function |
---|---|
A3 | Pi Battery Voltage |
A5 | Regulated Wind Voltage |
A7 | Unregulated Wind Voltage |
A9 | Pi Solar Voltage |
Tuesday, December 17, 2013
Project Curacao Deployment Date Set
March 7th, 2014 has been set as the Project Curacao deployment date in Curacao. The box will fly down with us in checked luggage with the batteries removed. We will provide the TSA with a description of the box (it is bound to be inspected) and articles that we have written about the project. A friend of ours has flown technical gear many times and always provides a list of materials and what are the devices in the luggage. He has even gotten thank you notes from the TSA.
We have to work out an attachment mechanism as the flat of the tower does not face directly south and we want to be facing south to maximize the solar power.
Here is a picture of the tower to which Project Curacao will be attached. The camera will certainly have a good view.
We have to work out an attachment mechanism as the flat of the tower does not face directly south and we want to be facing south to maximize the solar power.
Software Status on Project Curacao (12/17/13)
As of today, the current state of the software in Project Curacao is as follows:
- Arduino Battery Watchdog: The watchdog is reading and reporting data back to the main software in the Pi via a serial link through level shifters.
- Arduino Battery Watchdog: The watchdog is reading and reporting data back to the main software in the Pi via a serial link through level shifters.
- The read from Pi to Arduino fails occasionally (and is logged on the Pi) but not often enough to worry about at this point. The next three things to be implemented
- Pi power control - Complete and now in system testing. Implemented own alarm system (instead of using Time/TimeAlarms) using RTC because putting the Arduino to deep sleep also puts the internal software clock to sleep.
- Watchdog logging - Partially implemented in SRAM. Next is to put in logging in the Arduino for major events and implement sending the log to the Pi. Then we will put together the software in RasPiConnect for showing the last 20 Arduino log entries.
- Watchdog function complete in Project Curacao main program and Arduino. Tested pretty throughly. Purposely crashed the main program every hour and and the Arduino rebooted the Pi after 15 minutes as expected.
- Project Curacao Pi main program: The main program is generating all the graphs, camera pictures, environment sensing as required. It is also regulating the Fan automatically now. Not yet reading log files from the Arduino Watchdog. Next three things to be implemented:
- Watchdog implementation complete
- Logging Arduino Watchdog Data - in progress
- Improving sensor error detection
- RasPiConnect: We have a few more graphs and dials and buttons to implement on the RasPiConnect software, but it's pretty close to final. We use this all the time now to monitor what is going on in the project remotely. We are thinking it might be good to put in a process monitor graph and reboot function. Both are easily done.
- Added support for the new RasPiConnect alarms, but they really don't do anything yet.
- Will add Arduino Battery Watchdog log print shortly.
Tuesday, December 10, 2013
Bootloader Issues with Arduino Mega 2560
Hit a significant roadblock on the Battery Watchdog last week. During one development session, the Arduino Mega 2560 we are using for the Watchdog stopped taking programming, giving a series of errors:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
After eliminating the possibility of a bad Arduino Mega, bad programming environment, bad cable, and others, we determined that we had run into the "!!!" bug. The "!!!" bug can happen because you have "!!!" in an text string or, unfortunately, generated by the compiler as part of the code. Eliminating the text string, we suspected that the code contained 0x212121. We verified this by looking at the battery watchdog hex file and found a sequence of "212121" which in ascii, is "!!!". It is generated by the code and not part of a text string in the program.
We used "hexdump" on the mac command line and then searched for the value. We found the location of the compiled file by turning on the additional compilation output (on the Arduino preferences menu) and then looking through the compile information to find the .hex file.
The Bootloader that is shipped with some Megas (we bought ours early in 2013) detects the "!!!" sequence and goes into a monitor mode, hence timing out the loading process.
This is fixed in the latest boot loader (which also reenables the internal watchdog timer, Yes!).
We have now completed the process of flashing a new boot loader into the Arduino Mega by using a Arudino Uno as an ISP programmer as shown in these links. Use the following boot loader:
hardware/arduino/bootloader/stk500v2/stk500boot_v2_mega2560.hex
The new boot loader image we used was in the Arduino directory. If you are on a Mac, open up the app bundle in Finder.
This fixed our problem, but still with a verification error, but the boot loader is working and we can program the Mega again. (note: We suspect the following will remove the verification error, but we haven't tested it yet: disable the -D command to auto erase the chip and add the -e instead.)
We used the tutorial on:
http://arduino.cc/en/Tutorial/ArduinoISP
for the IDE procedure.
Remember that the pins to be used changed from the Uno to the Mega, so use the following wiring diagram:
Now the Arduino is working fine in the system. Here is a picture from the RasPiConnect App (www.milocreek.com) of the functioning Arduino system.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
After eliminating the possibility of a bad Arduino Mega, bad programming environment, bad cable, and others, we determined that we had run into the "!!!" bug. The "!!!" bug can happen because you have "!!!" in an text string or, unfortunately, generated by the compiler as part of the code. Eliminating the text string, we suspected that the code contained 0x212121. We verified this by looking at the battery watchdog hex file and found a sequence of "212121" which in ascii, is "!!!". It is generated by the code and not part of a text string in the program.
We used "hexdump" on the mac command line and then searched for the value. We found the location of the compiled file by turning on the additional compilation output (on the Arduino preferences menu) and then looking through the compile information to find the .hex file.
The Bootloader that is shipped with some Megas (we bought ours early in 2013) detects the "!!!" sequence and goes into a monitor mode, hence timing out the loading process.
This is fixed in the latest boot loader (which also reenables the internal watchdog timer, Yes!).
We have now completed the process of flashing a new boot loader into the Arduino Mega by using a Arudino Uno as an ISP programmer as shown in these links. Use the following boot loader:
hardware/arduino/bootloader/stk500v2/stk500boot_v2_mega2560.hex
The new boot loader image we used was in the Arduino directory. If you are on a Mac, open up the app bundle in Finder.
This fixed our problem, but still with a verification error, but the boot loader is working and we can program the Mega again. (note: We suspect the following will remove the verification error, but we haven't tested it yet: disable the -D command to auto erase the chip and add the -e instead.)
We used the tutorial on:
http://arduino.cc/en/Tutorial/ArduinoISP
for the IDE procedure.
Remember that the pins to be used changed from the Uno to the Mega, so use the following wiring diagram:
UNO to Mega pins
Arduino Uno Target Mega2560
D10 (SS) Reset
D11 (MOSI) D51
D12 (MISO) D50
D13 (SCK) D52
Gnd Gnd
+5V +5V
Now the Arduino is working fine in the system. Here is a picture from the RasPiConnect App (www.milocreek.com) of the functioning Arduino system.
Arduino Based Battery Watchdog |
Picture of the location of Project Curacao |
Subscribe to:
Posts (Atom)