Solar X-rays:
Geomagnetic Field:
From n3kl.org
Today's task is to start planning out the project, how it should function and to get a rough idea of what the hardware will look like.
This will be a long blog (wall of text alert) so settle in with a drink and some tunes and take your time with it. I am sorry to say that I have not prepared any images to accompany this one, but may add some in later.
I will cover three major topics here. First and foremost, we need to plan what the machine will look like and how the machine should operate. Within that scope, we need to know what the various modes are, and how it will operate within each one. Secondly, we need to start planning out our hardware and make some pin assignments for the Arduino. It is much better to discover early on that you may not have enough IO to finish the project. Finally, we should consider the major software routines necessary to complete the project. There is a lot to do, so lets get cracking!
I already built a wooden case, secured with a lock, and mounted the bill mouth in it. The box will also include an LCD screen on the outside (likely a 2x20 charactor display). In addition, there will be just two user interface buttons:
There will be LEDs to illuminate each, which indicate when said buttons are active. We would like to ignore a membership button press when there is only 3000 yen on the ballance, for example.
Inside the machine, there will be one additional button, which activates an accounting mode.
Sitting beside the machine will be a thermal printer, which will print out recepits and order slips. When the user opts to pay a membership, two slips are printed. The first instructs the user to write their name on the slip and deposit it into either a slot placed on the machine (such that bills and slips fall into the same space), or a seperate box near the machine. The administrators use these slips to update membership accounting data. The second slip serves as their receipt.
A matching transaction number is printed on both slips.
This mode should be fairly obvious. The LCD will show messages encouraging members to pay their dues and visitors to make donations. Hopefully it will feature both English and Japanese. In addition, the button LEDs will sometimes flash, as well as the BA mouth.
In the case in which the user has not inserted bills, but just presses a button, we want the attract mode to respond, encouraging them to insert bills to complete the transaction
The machine is now in an active payment mode, and should not exit back to the attract mode without completing a transactions to bring the ballance to zero. In the case that the ballance is between 1000 and 4000 yen, only the donate button is lit and able to respond for the user. In the case that the ballance is 5000 yen or more, both the membership and donate buttons are functional.
The machine deducts 1000 yen from the ballance and thanks the user. It keeps a running total of the donations made (in 1000 yen increments) until the ballance reaches zero. At this point, the machine will ask if they would like a printed receipt of their total donations, and instruct them to press any button, before a timer runs out. If they opt for a receipt, it will be printed.
It is important to note that the running donation tally remains in effect until the ballance reaches zero. If the user were to insert 10000 yen, then select two donations followed by a membership payment, and finally three more donations, the donation tally should read 5000 yen when it asks if they would like a receipt.
The display thanks them for their membership payment and instructs them through the following process (dring this time, the BA will be disabled, and the front buttons temporarily serve new purpose):
The display guides the user through the the audits. By pressing the membership button, the user can step through:
Resetting the audits does NOT reset the transaction numbers in eeprom. It only resets the cash amounts to zero. This is so that when the administrators remove the cash to take to the bank, the box starts counting cash from zero again. The administrator should record the data and verifying against the actual cash count before resetting the data.
The Arduino is limited on pins, and this project will use nearly all of them. Lets review some of the items on the list, before making pin assignments. I at some point mentioned that the receipt printer should show the time and date. While this COULD be a 'code only' clock, those tend to drift out of time quick. Especially when we may not always have complete control of incrementing the tick. I would rather use a battery backed real time clock. Thus, we need to keep I2C pins available.
The other big pin hog is the LCD screen. Consider that the LCD in 4 bit mode needs four data pins, as well as two control pins (RS and E). Here is my pin chart:
In order to realize the complete functionality of this project, we will need to explore several topics on the Arduino platform (some of which even I may not be immediately familar with). Key libraries include Wire, the appropriate RTC library, LiquidCrystal, EEPROM, and the Adafruit thermal printer library.
The following list is neither complete nor set in stone, but covers a few of the more critical functional blocks I belive we will need in order to build a working system:
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer