some thoughts on the general input- and output requirements for the final project
In the input and output-device week I had to decide which part of my "solar driven water- and energy supply system for rural areas-project (for further information please refer to my final project page) I would like to focus for my final poject. This week's (input devices) as well as next week’s project (output devices) - which can be combined and used or the final project - gave a good opportunity to think about the function of the final device - and here especially regarding its requirements from the electronic side. So I had to choose between realizing the PV-system or the hydro-generator/storage-system system; for some reasons (mainly relevance and USB for a further implementation) I decided for the later one. Figure 1 shows a first sketch I did on the electronic inputs and outputs, figure 2 shows a referring block diagram.
The outputs from the hydro-generator/storage system are from the following nature:
- valves to control the water flow during the day- and night circle
- day power supply - for driving the DC-pump-motor as well as the power-supplies for devises (5V/24V dc)
- night power supply - for driving the light engine for LED-lighting as well as the reduced power-supply (5V dc)
the output device
For the output device I choose the motor drive (h-bridge) and added some additinal functions. The original hello.H-bridge.44 is shown in figure 10); it uses the already well known micro-controller tiny 44 and an A4953 H-bridge dc-motordriver.
designing with eagle
figure 11 shows my schematic design in eagle; please note that the original hello-h-bridge designed was modified; from the tiny44 I used the pins PB0 und PB1 as additinal inputs at J2, to communicate with my input device. The pins PA0 and PA1 function as additional outputs an J3. In addition I added a protection diode between J2 and the voltage regulator for the case that the input voltage drops below "5V".
pcb - ready for milling
testing the board
pre-programming
to test the hello-button board I downloaded the two respective .c-file (hello.H-bridge.44.DC.c) and .make (compiler) files (hello.H-bridge.44.DC.make) from the class-page and connected the new board with my fab-isp. Then pointing in the terminal to the directory containing the files mentioned above, I run the following programs:
1: make -f hello.H-bridge.44.DC.make //does the compiling - watch for error messages
2: make -f hello.H-bridge.44.DC.make program-usbtiny (dont forget to add the external power source!)
successfuly pre-programmed!! - as can bee seen in the prompt-message below (figure 15).
testing: after varifying the maximum current fromm the 4953 (which is impressive 2A in the continues mode), I dare to take a "bigger" dc-motor; the hello-program brings the motor alive (figure 16)
programming outputs
Function of the program: There are 3 outputs and 2 inputs in my small program; the inputs are 2 sensors or switches indicating if a givem water tank is empty or full; the outputs are a dc motor drive whereby the power is controlled via pulse wide modulation pwm, and two drivers for two separate voltage supplies.
The program begins to run when it gets powered (day begins, solar energy available), and the primary task of the solar driven pump is to fill the tank as quick as possible. However, if the water level reaches a given value (e.g. 50% filled), the power of the dc-motor driver can be decreased, and available power can now be supplied (which is indicated by the first LED); again, when the water reaches a second mark, (e.g. 75%), the dc-power for the pump is again reduced and a second power supply can be used (indicated by a seconds LED).
you can find the source code of my c-program here: c-file
The setup runs fine (see images below), and gave me some valuable inputs for the electronic part of my final project.