For my home-monitoring setup I would like an Arduino to measure the supply voltage it is getting from a DC battery UPS (Uninteruptible Power Supply). Unfortunately (actually by design, but that’s another story), the power supply is 24V, which means it will put out anywhere from 21.3V-29.8V (according to the manufacturer), which is far too much to measure with the Arduino’s 0-5V input range. For simplicity’s sake, lets assume we want to measure a 20-30V voltage.
The immediate answer is to use a voltage divider, which will bring a voltage in the 0-30V range into the 0-5V range. The general formula for the resistor divider is:
We want to give , so
Now, just as a sanity check we should calculate the current of the resistor divider, to make sure we’re not converting too much electricity into heat. Ohm’s law gives us
which in this cases gives
No problems there.
This works okay, but we lose a lot of precision, as only ~1/3 of the Arduino’s range is actually used: the Arduino’s ADC has 1024 different readings between 0-5V, so when reading the 0-30V range the precision is just about
over the range.
If only we could move the lower bound, so that 20V would map to 0V on the Arduino. A wild Zener Diode appears! One use of a Zener diode is as a voltage shifter.
The closest Zener diode I could find was an 18V of the BZX79 series. This resulted in the following circuit:
which I hacked into my Arduino box.
Now, theoretically the formula for translating an voltage at the Arduino to the supply voltage should be:
I then did some quick measurements of various input voltages and the resulting voltage at the Arduino pin:
Plot it into a spreadsheet, create a graph and add a linear regression gives:
Now, this formula is a bit different compared to the theoretical one, mainly in the Zener diode drop. However, the datasheet for the BZX79 actually has the 18V C-type () as between 16.8-19.1V, so this is well within spec. Since this is just a one-off, I’m happy to just use the measured formula, as this will be more accurate.
The final precision should be . The current should be around , which again is ok.
You need to modify the variables at the top: set currentDay, currentHour, currentMinute according to the present time.
The pre-programmed schedule is to clean at 03:00 on Sunday, Monday, Wednesday and Friday. You can change this if you wish, by altering the daystorun and times variables.
If you don't modify the schedule, the Roomba should start automatically after 2 minutes.
Put it all together
You should now have a partially undressed Roomba, and a programmed Arduino. Now it is time to connect them. With both unpowered, connect the following:
Arduino GND to Roomba ground (pin 6)
Arduino TX (pin 1 on e.g. Uno) to Roomba RX (pin 3)
It should look like this:
Now, the moment of truth. Press the "CLEAN" button on the Roomba, the light should go on. Plug in the USB for the Arduino. The Roomba light should turn off briefly, and after a few seconds the Arduino should blink it's LED. The schedule is now programmed, all done!
Følgende er dagsordenen til den ordinære generalforsamling i foreningen HAL9k torsdag 2014-05-15 kl. 19:30 på Sofiendalsvej 80, 9200 Aalborg SV.
Inden generalforsamlingen er der fællesspisning ca. kl. 18.30. Tilmelding til spisning (menu/pris ikke kendt endnu, forventet max 50,-) foregår på https://doodle.com/xgcy9i9nd77s95z6 af hensyn til antallet.
Dagsorden: 1. Valg af ordstyrer. 2. Valg af referent. 3. Valg af to stemmetællere. 4. Bestyrelsesformanden og kassereren aflægger beretning, samt præsenterer planer for den kommende sæson. 5. Kassereren fremlægger det reviderede regnskab til godkendelse. 6. Forslag fra bestyrelsen eller medlemmerne, herunder vedtægtsændringer, behandles. – Forslag om nedsættelse af kontingent fra sidste generalforsamling: 100kr pr. md, (75kr for stud.). 7. Behandling af eksklusionssager. 8. Valg af revisor. 9. Valg af bestyrelse. 10. Valg af op til to suppleanter. 11. Behandling af indkommende forslag.
Indkomne forslag skal være bestyrelsen i hænde senest syv dage før generalforsamlingen.
Jeg havde to billige wake-up lamper fra Harald Nyborg der begge fejlede med samme symptomer: lyset var permanent tændt så snart strømmen var sat til, i stedet for at kunne slukkes og dæmpes. Grunden til nr. 2 blev købt var at nr. 1 fejlede efter garantien udløb, og til 200,- kunne det jo knapt betale sig at kigge på det. Da nr. 2 fejlede med samme symptom blev jeg stædig og irriteret over kun at kunne lave “brug-og-smid-væk”.
Hvor svært kunne det være at reparere noget billigt Kina-skrammel? Ikke ret svært viste det sig. Skidtet blev åbnet, og viser ret tydeligt hvor meget kvalitet man får for ikke ret mange penge:
Efter lidt konsultation af nogle af de mere elektronik-kyndige fik vi lokaliseret fejlen til en Triac der nok var brændt af. Desværre havde producenten valgt at slibe teksten af, så det var umuligt at se hvilken chip det var (sådan noget svineri!) — det virkede dog heldigvis med en helt standard BT137. På den ene lampe var der også brændt en modstand af: den var helt forkullet, men heldigvis kunne vi se på den anden hvilken modstand det var.
Efter at have loddet ny triac og modstand på, virkede lamperne som nye 🙂 Kan det betale sig at reparere billigt Kina-skrammel der er gået i stykker? Måske ikke økonomisk, til gengæld risikerer man at lære noget. Og så er det jo ret fedt at kunne fixe ting selv, i stedet for kun at kunne købe og smide væk!
Upgraded belts to GT2, in our case with a 20-tooth pulley, all ordered from 3dnielsen.dk (although the GT2 belt seems quite expensive). This has definitely improved our accuracy, now the X- and Y-axis are at a nice even 80 steps/mm, as calculated by the very awesome RepRap Calculator.
Replaced some of the LM8UU ball bearings on the Y-axis because they were very unstable. This was probably the most important modification, although I don’t know if there is a difference in quality between the old and the new bearings. We still use the old bearings on the X-axis, they seem okay.
Added cork mufflers to the motors. I doubt this is essential or even provides much benefit on the Printrbot Jr because the motors touch the chassis at multiple points, but they are cheap and can be retro-fitted with little effort.
Made sure the circular ball bearings were properly tightened such that the middle part, that is not supposed to turn (as I learned), does not turn. Additionally, add wafers to get the bearings height aligned with the belts.
Replaced the Z-axis threaded rod with a metric one: This is an almost too easy upgrade to not do, as an M8 rod fits the Printrbot Jr without any problems. The benefit (as can be calculated by the very awesome RepRap Calculator) is that the Z-axis will need an even number of steps to move from one layer to the next. As an example, consider a layer height of 0.3 mm with the old 5/16″ rod: this will result in an error of +1.1217541105598867mm over 10cm, where with an M8 rod there is no such error.
At this point our main problem is with adhesion of the first layer. We have experimented with a glass plate because we want to add a heated bed. We learned a couple of lessons from that, namely:
Kapton tape on top of glass is not very adhesive, if it is not heated.
We experimented with hair-spray. Hair-spray on painter’s tape is not a good idea, it makes the tape bubble and dissolves it a bit.
Printing on glass with hair-spray is almost doable, but not quite convenient.
Adding the glass plate on top of the original wood plate adds quite a bit of height, and the plate adjustment screws cannot be tightened too much because two of them will then hit screws on the chassis, resulting in the X-axis crashing. A good solution could be a longer Z-axis stop screw.
At this point we are back to printing on painter’s tape directly on top of the original wood plate. It seems sufficiently flat for the small prints we have done until now. A heated bed is definitely a thing to do, we plan to mill a PCB on our Bungard machine, following something like http://www.thingiverse.com/thing:91403 (however note that I read double-sided PCB is recommended, because heating only one side will result in the PCB warping).
The following information concerning steps/mm adjustments is outdated. It has since been agreed that steps/mm should be set to the exact calculated values since printing with non-ideal steps/mm results in an accurate test piece, but makes the dimensions on every other part even more inaccurate.
… which sort of appeals to me because it is less labor, and the correct solution can be calculated. Thus, we are now using calculated values from the very awesome RepRap Calculator: X-axis: 80 steps/mm, Y-axis: 80 steps/mm, Z-axis: 2560 steps/mm. The extruder is currently at 600 steps/mm, but this is per calibration; the PrintrBot documentation mentions a default of 569 steps/mm.
With all this effort we are now able to print various small items improving the printer:
4 bed levellers: http://www.thingiverse.com/thing:90336. Nice little addition, and additionally it validated that our calibration was not totally off: one nut could be inserted by hand, the three others only needed a little “Jysk kærlighed” aka. a very small smack with a hammer.
New gears for the extruder: http://www.thingiverse.com/thing:26243. Our large gear already has a small crack from the original assembly, and some of the teeth on the large gear have started grinding leading to slips in movement, so we will need new ones at some point. We have printed the small gear, and will go for the large one soon.