Sunday, July 27, 2014
Change in hardware.
Due to some issues with the transceiver(rfm12b) that I had originally used, I decided to go with a different and a bit more popular and modern device(NRF24L01+). Originally I had been doing some testing with a set of MSP430's using these new transceivers and wanted to see if I could get these along with the Arduino talking to each other. After about a day and upgrading from an older library(ManiacBug's rf24 library) to one that has seen some nice changes and stability(tmrh20's), I was able to get the arduino talking to the msp430 receiver setup. Now the fun part is to integrate the old setup with the new setup.
Wednesday, June 18, 2014
Integration test problems...
After finishing up the main logic code that would be used I found a few areas where I ran into some issues.
The first thing was naming of functions and vs what they actually did. For example, turnOnServo tells me nothing about what it turns on, it just moves to x position. As the servo is the major part of the control and attached to the valve, a more appropriate name was openValve() and it's companion, closeValve(). This makes more sense for it's function and thus will make it more readable.
This also brought up an issue with the testing env(test system vs final system differences)....something I hadn't considered was bad hardware.
Finally, the testing of the valve itself. As I had done initially tests with it unattached to the servo, I hadn't fully tested it with the settings and the servo throws aside from a dry run.
So after this initial bumpy start, I brought the gear back in to do a bit of a rework....
The first thing was naming of functions and vs what they actually did. For example, turnOnServo tells me nothing about what it turns on, it just moves to x position. As the servo is the major part of the control and attached to the valve, a more appropriate name was openValve() and it's companion, closeValve(). This makes more sense for it's function and thus will make it more readable.
This also brought up an issue with the testing env(test system vs final system differences)....something I hadn't considered was bad hardware.
Finally, the testing of the valve itself. As I had done initially tests with it unattached to the servo, I hadn't fully tested it with the settings and the servo throws aside from a dry run.
So after this initial bumpy start, I brought the gear back in to do a bit of a rework....
Sunday, June 15, 2014
Transmitter, sensors, and valve setup.
Finished up the next phase of the project. I've wired up and started testing the new light level sensor(TSL13S), as well as added sensing for the valve current state(on or off) and now detect when the the charging circuit is active.
I've also wired up the TIP112 darlington transistor, replacing the ULN2803 darlington array. As the array was taking up a bit too much realestate on the breadboard which was needed for the detection circuit of the charge enabled indicator, it had to be removed.
The last part in this is changing the logic that I had planned to use for the on/off switch. Instead of detecting the moisture level while the water is flowing, this will be a timed event. The sequence will go as follows.
Other things that will be taken into account on the above, is light level(water in the morning or at least during sunny times) and making sure the battery is fully charged and can power the servo controlled valve.
Finally, I'll have a manual control valve inline and left open for use when/if there is a battery/circuit failure.
After coding the valve control I'll be able to start testing the setup and track how well it works based on the set of data that is transmitted throughout the process. Exciting!!!
I've also wired up the TIP112 darlington transistor, replacing the ULN2803 darlington array. As the array was taking up a bit too much realestate on the breadboard which was needed for the detection circuit of the charge enabled indicator, it had to be removed.
The last part in this is changing the logic that I had planned to use for the on/off switch. Instead of detecting the moisture level while the water is flowing, this will be a timed event. The sequence will go as follows.
- Detect low moisture level.
- Open valve to let the water flow for X seconds(30 initially).
- Start cooldown period of 2 minutes to let the water permeate the soil.
- Repeat steps 1 and 2 until saturation reaches the predetermined level.
Other things that will be taken into account on the above, is light level(water in the morning or at least during sunny times) and making sure the battery is fully charged and can power the servo controlled valve.
Finally, I'll have a manual control valve inline and left open for use when/if there is a battery/circuit failure.
After coding the valve control I'll be able to start testing the setup and track how well it works based on the set of data that is transmitted throughout the process. Exciting!!!
Wednesday, June 11, 2014
Water Lines, moisture sensor, and added functionality to the servo code.
Did some tweaking of the water lines earlier today and added a higher flow rate dripper to one side. I'm not sure if it's ideal to have multiple drippers for each of the small plants as one of the pots seems a little dry. The flow rate didn't seem work too well but we'll see....this is what the data collection is for anyway, right?
Servo code update
Did a bit more work on the test setup and added a button press action triggered with an int. This only works if the plant isn't currently watering something, but then again, that's the whole point. I also updated the code to use functions instead of the crazy block setup I had. I'm looking at potential integration issues that I may run into, but so far, all looks good. I'll work on the update to the tx/rx code tomorrow. Once that has been tested and verified, I'll move onto the integration of the servo code either tomorrow or Friday. Once that is complete, I'll be able to start collecting data on the setup and see if there are any major issues. So far so good for the plan to have it up and running by the weekend.
Servo on off control setup
This is the wired up configuration for the servo test I was doing. The setup includes the following
This worked perfectly(aside from the area it takes up) bringing the current down from 100ma+ at servo idle, down to 20ma.
The code is fairly simple at the moment for this setup with the primary things being turning off the Darlington array and detaching the servo when no signal isn't needed. If you don't detach( myservo.detach() ) the servo it will try to feed off of this signal to power the servo(though not being able to power it through the low current signal line). You will also hear a constant wining from the setup.
- Arduino pro mini 3.3@8Mhz
- ULN2803 Darlington array(8ch) with 2 channels being used.
- Joystick analog input device
- 9g servo(w/ 1/4 in barbed valve attached)
- 1S 3.7v Lipo 500mah
This worked perfectly(aside from the area it takes up) bringing the current down from 100ma+ at servo idle, down to 20ma.
The code is fairly simple at the moment for this setup with the primary things being turning off the Darlington array and detaching the servo when no signal isn't needed. If you don't detach( myservo.detach() ) the servo it will try to feed off of this signal to power the servo(though not being able to power it through the low current signal line). You will also hear a constant wining from the setup.
Tuesday, June 10, 2014
The Water valve.
Current issue I've run into is the power requirement for an idle servo. As this is pretty high, I've had to figure out a way of powering it down while idle. First approach since I don't have a darlington array powerful enough to power it, I've opted for a ULN2803. Currently still doing some testing with this setup, but have some parts on order that should save some space on my current breadboard setup(Until I find a better alternative or design a pcb for this).
The plan.
Solar Mini Greenhouse
Objective: Create a simple solar powered mini greenhouse with the following features.
For the plants
- Records daily light levels. (every 2 min?)
- Records daily temps. (every 15 min)
- Records Moisture levels .(every 5 mins Starting at sunrise)
- Water plants during light hours.(cutoff at midday)
For the PV panel
- Record temps throughout the day.
- Record light level throughout the day.
- Record PV voltage throughout the day.
- Record current consumption throughout the day.
For Battery backup
- Record Battery charge time.
- Record battery charge events.
- Record Battery voltage throughout the day.
Required:
- Solar panel - purchased a 10W 12V panel
- Microcontroller(MSP430, Arduino)
- Light level indicator.(Look at TAOS)
- Moisture level indicator.(cheapy chinese things)
- Data transportation method (transceiver like an RFM12B or NRF24L01+)
- Watering system.
Thoughts, ideas, and notes.
- Inital idea was to use a cheap water pump that runs on 5-12 v
- Another option is using siphoning
- Other option is to use a gravity feed setup, though the water will need to be above the greenhouse. The thought on this is that a cinder block can hold the water bottle for the gravity feed system
- Another option using the gravity feed is to include a way to pressurize the bottle as well. One thought is to have a water bottle painted black that has a tube connected to the main bottle. During the day, the bottle painted black will increase in pressure thus presurizing the system. A 1 way in valve would allow air to come in, but not go out, so as the water is drained, the system equalizes. Opening the bottle to refill does depressurize the system however. This may or may not work as thought.
Plant nodes.
- A plant node can be a simple device that just measures the plant moisture level and internal temp of the uC. The node would be hooked up to a main base station via a simple servo wire(3 lead).
- Communication via serial transmit only from Node(S) which would wait for a Master(M) send requestion(high -> low), Master would set itself to receive mode and wait for data. Node would be in standby until data was required. Consider options for multiple nodes sharing the same serial port.
- Node uses ADC pin for moisture sensor.
- Node uses ADC for temp aquisition.
- Node uses 1 pin for serial communication
- Other pins free to be used for other things.
- Moisture sensor should be controlled via transistor.
Initial prototype build.
The initial prototype has been built with the following:
- Ikea mini greenhouse
- Arduino pro mini 3.3v@8Mhz
- moisture sensor
- Solar powered
- battery backup
Subscribe to:
Posts (Atom)



