"Stuck at home" projects

WhiteSpace

Well-known member
I was intrigued by @erco 's description of "turkey projects" in a post in December https://picaxeforum.co.uk/threads/erco-laser-range-finder.30127/post-329853. I was just wondering whether enforced time at home for members in some countries is inspiring anyone to make a start on projects that have been waiting for "when I have a bit more time..." It would be interesting to see details. I'm constantly amazed by the imagination and complexity of many of the projects that I see described here. Even when I read what the project is intended to do, and an explanation of some clever bit of code, I often still don't understand how it does what it does. So I'm looking forward to reading about even more impressive projects over the next few weeks. As for me, nothing quite so complex. Hoping to finish the infrared-controlled vehicle that I've posted about, and had some great help with. The bit I'm working on at the moment (coincidentally, given the topic of the turkey-related thread above) is the entirely gratuitous laser proximity sensor - one of the little Hamamatsu S6986 sensors that I see others have used here. I was able to connect it and to get it working surprisingly quickly, but not yet consistently. The difficult bit is aligning laser, lens and sensor precisely so as to detect a red dot at the desired distance, and that is proving very difficult on the breadboard. A bit of drilling, gluing and adjusting over the next few days to get it to work all the time.
 

cpedw

Senior Member
A clinical thermometer.

I've got the 08M2 and DS18B20 in stock. I'm agonising over the display - a 16x2 LCD is a bit much for 3 digits, and to get under your tongue. But can I drive 3 7-segment LEDs from an 08M2? I don't think so but I'm happy to be shown to be wrong!

Derek
 

hippy

Technical Support
Staff member
For thermometer projects; here's one option for the display using AXE131Y or AXE133Y displays -

https://picaxeforum.co.uk/threads/oled-analogue-thermometer.29776

Poundland shops in the UK used to sell quite nice medical thermometers which had a plastic body shaft with, I believe, a thermistor sensor embedded in a metal tip. They included a small 3-digit LCD display and similar did seem widely available elsewhere -


Good luck finding one of those at the moment but if you do have one; that's probably the way to go for the 'under the tongue', 'under the armpit', 'up the wherever' part with wiring soldered to the thermistor leads and extended to a PICAXE and a remote display.

I did tear one down and it wasn't entirely easy. The LCD board unfortunately cannot be easily repurposed, as it only displays body temperature ranges.
 

techElder

Well-known member
If I had the time, the project we need is a simple, easily operated 30 sec timer for timing hand washing. A simple LED display, coin battery and a landyard to hold it around one's neck or clip to a pocket. Using a simple momentary switch, it could light up (viewable in a mirror) for the time period and go back to sleep, providing a hi-tech indication of elapsed time for the impatient hand washer.

Displaying the project externally has an advantage in notifying others that this is the way to kill and wash away a virus.

Hand Sanitizing
 

hippy

Technical Support
Staff member
The AXE103 Safety Light kit may be a short-cut to a hand-washing timer, and with a use once kids are back to cycling again.

http://www.picaxe.com/Hardware/Project-Kits/Safety-Light-Project-Kit

Programming should be easy enough; keep the LED flashing for 30 seconds once it's turned on, stop flashing when the times up. Would make sense to blip the LED every now and again so it's noticed that it's not been turned off when not in use.

But, rather than turning it on and off, which is rather counter to not touching things others have touched - though unavoidable in a family - one could make it light sensitive and go into sleep mode once it times out.
 

neiltechspec

Senior Member
Amazing what can happen with a bit of boredom/inactivity.

I have just completed the onboard lighting for my RC Rockcrawler.
Headlights, Reversing lights, Indicator/Hazards.

All done with a 14m2 using pulsin on Channels 1(steering) & ch3(throttle) in parrallel with servo & esc, plus ch5(aux 1) & ch6(aux2), then depending
on values, driving BCX38C's for the LED's -Ve side. Built on about a 30mm square piece of FR4 style vero.

Neil.
 

techElder

Well-known member
The kit that would be much easier to reprogram would be the AXE101, in my opinion.

All the features and parts are there except a package. The switch could be removed and placed in a way that pressure on top of the package would activate the timer.

Make the package a base to hold one of those foaming soap dispensers (that I use around my house). Pump some soap; start the timer.

The timer now has lights AND music! Who can avoid that? :D

PS. One could incorporated @lbenson 's long term battery saving code to eliminate the power switch! :D


The AXE103 Safety Light kit may be a short-cut to a hand-washing timer, and with a use once kids are back to cycling again.

http://www.picaxe.com/Hardware/Project-Kits/Safety-Light-Project-Kit

Programming should be easy enough; keep the LED flashing for 30 seconds once it's turned on, stop flashing when the times up. Would make sense to blip the LED every now and again so it's noticed that it's not been turned off when not in use.

But, rather than turning it on and off, which is rather counter to not touching things others have touched - though unavoidable in a family - one could make it light sensitive and go into sleep mode once it times out.
If I had the time, the project we need is a simple, easily operated 30 sec timer for timing hand washing. A simple LED display, coin battery and a landyard to hold it around one's neck or clip to a pocket. Using a simple momentary switch, it could light up (viewable in a mirror) for the time period and go back to sleep, providing a hi-tech indication of elapsed time for the impatient hand washer.

Displaying the project externally has an advantage in notifying others that this is the way to kill and wash away a virus.

Hand Sanitizing
 

hippy

Technical Support
Staff member
The timer now has lights AND music! Who can avoid that?
And "Happy Birthday" is programmed in which, sung twice, is what the UK advice is for timing hand washing without a timer - 20 seconds..

"Happy Birthday" does seems to last 10 seconds when simulated under PE6, probably same on a real chip, so two times and you're done.

Can be reprogrammed for one round of "Silent Night" if the outbreak does drag on longer than anticipated, though that does last nearer 40 seconds.
 
Last edited:

AllyCat

Senior Member
Hi,
Remote controlled shopping trolley with a toilet roll detector
Interesting that that comes all the way from Australia, so obviously there's a "Worldwide shortage". :)

Personally, I hope to extend my "family" of projects that are literally "the size of an AA cell", which take advantage of the PICaxe's (08M2) strengths of small size and low supply voltage. Usually just a strip of Veroboard / perf.board, 20 holes long and 4 + 2 (partial) strips wide, sometimes with supply and ground at the two ends. So they fit into a standard battery holder, obviating the need for a custom "enclosure" (box) to keep the project tidy or protected.

Typical applications have been for battery monitoring or logging, for example one can be used in association with a single LiFePO4 cell (3.2 volts) to fit into any device normally powered by a pair of AA cells (and of course anything with more than 2 x AA bays). On the board can fit a (socketed) 08M2, a normal PICaxe programming socket (although the legacy 3 header pins are more practical) and another DIP socket to accept various I2C chips (e.g. EEPROM or a clock chip), or to act as a "GPIO interface" for thermistors, etc., or simply a small "sounder" (for low battery warning).
A clinical thermometer............ I'm agonising over the display
An idea particularly relevant to this thread is to use one of the little I2C SSD1306-controlled 128 x 32 pixels OLED displays (or the squarer 64 x 128 display if the PCB is sandwiched between two other AA cells). They've been discussed on the forum recently (including by the OP) and my "target" is to support a reasonably complete ASCII character set, with extensions to double and quadruple height / width and "character rounding" (12 x 16 pixel cells from a normal 5 x 8 font). The first stage of coding the character rounding is completed, so watch the Code Snippets section (but I'll cross-link from the Active Forum anyway).

Cheers, Alan.
 

hippy

Technical Support
Staff member
my "target" is to support a reasonably complete ASCII character set
If you want a ready-rolled 8x5 character font set you can pull one out from Blockly. Select "Extensions", "Grove Displays" then drag one of the OLED blocks under Start, convert to Basic.

At the bottom you'll find a list of Eeprom and Table definitions for all the printable ASCII set, a few extras at the beginning and many of the Extended 'foreign language' ASCII set at the end.

If you want a more limited set, re-indexed, or in some other form, I am sure that can be provided.

Looking forward to seeing what you've come up with for character rounding. I had a look at that once but wasn't very successful with the little I did. It mostly worked but there were more errors than I would like. The $ symbol is a good example because that shows why filling in L shaped corners is too simplistic -
Code:
..#..
.###.
#.#..
.###.
..#.#
.###.
..#..
Code:
....##....
....##....
..######..
.O######..
##..##....
##..##....
.O######..
..######O.
....##..##
....##..##
..######O.
..######..
....##....
....##....
My thoughts were to use the blank 8th line as a marker for where L's need to be filled but never got round to trying it.
 

AllyCat

Senior Member
Hi,

I haven't tested all characters, but was more interested in getting the algorithm down to a reasonable size - it's basically about 20 bytes of PICaxe program, and less than 100 bytes to completely read, smooth and store a full (12 x 16) character. Apparently the "flaw" in the "diagonal smoothing" algorithm is that the centre of a "hollow diamond" (N, S, E and W pixels) becomes filled-in, so the font in the SAA5050 "Teletext" chip carefully avoided this grouping. Also, I note that the "S" of the basic $ character is a full 7 pixels high with the vertical bar not extending above or below it.

Amazing what you learn from Google; it seems that the font is (now) called "Bedstead".

Cheers, Alan.
 

WhiteSpace

Well-known member
Wow, I'm so pleased I asked this question - what a great set of ideas. I hadn't necessarily been thinking in terms of projects specifically related to COVID-19, but I really like the handwashing and thermometer ideas (as well as the shopping trolley).

For the handwashing timer, I liked Hippy's idea:
But, rather than turning it on and off, which is rather counter to not touching things others have touched - though unavoidable in a family - one could make it light sensitive and go into sleep mode once it times out.
Would an alternative idea be to use an infrared LED/sensor pair - you wave a hand over it and it detects the reflection and starts timing. Then it would work whether you were in a light or dark room. There are some interesting ideas in a thread on detecting trains on model railways in variable lighting conditions which might be useful?

I'm intrigued by AllyCat's
projects that are literally "the size of an AA cell",
It would be interesting to see a photo of one if you have one to hand and it's not too much trouble.

And the thermometer from cpedw:
I'm agonising over the display
I immediately thought of the little SSD1306 OLEDs too (not surprisingly, having spent quite a bit of time over the past couple of months playing with them). They would also lend themselves quite well to a graphic display like the one that Hippy links to in #4. As you map each pixel, it would be relatively straightforward to use a 128 x 32 display to show a temperature bar. Alternatively, just keep it in digital format. Digits 0 to 9 in double height take 200 bytes of storage (or less with AllyCat's compression method), or use the more economical 5x8 characters. 20 more bytes each for a decimal point, degree symbol and upper case C or F (for those of you in the US).

Thanks for the inspiration!
 

erco

Senior Member
Opposite problem here, I'm stuck at the office working on Picaxe projects. I have my own small office/studio and have picked up tons of freelance work since all the shutdowns began. Long days (10-12 hours) but I'm having a blast. Lemons/lemonade. Wish I could show some of the really great stuff I have done with Picaxe but it's all confidential.

Related, one project had a surprising amount of servo jitter in a short, simple loop reading an ADC to control two servos. Finally ended up only having one servo on at a time, turning the other one off. Weird.
 

Hemi345

Senior Member
For the handwashing timer, I liked Hippy's idea:
Would an alternative idea be to use an infrared LED/sensor pair - you wave a hand over it and it detects the reflection and starts timing. Then it would work whether you were in a light or dark room.
The little VCNL4040 ambient light and proximity sensor would be perfect for that. :) Use 4 LEDs to provide feedback, one LED for every 5 seconds...when all of them have gone out, you're done washing.

And the thermometer from cpedw:
I immediately thought of the little SSD1306 OLEDs too (not surprisingly, having spent quite a bit of time over the past couple of months playing with them). They would also lend themselves quite well to a graphic display like the one that Hippy links to in #4. As you map each pixel, it would be relatively straightforward to use a 128 x 32 display to show a temperature bar. Alternatively, just keep it in digital format. Digits 0 to 9 in double height take 200 bytes of storage (or less with AllyCat's compression method), or use the more economical 5x8 characters. 20 more bytes each for a decimal point, degree symbol and upper case C or F (for those of you in the US).

Thanks for the inspiration!
Yeah, those little 128x32 displays would make a good homebrew thermometer and could be packaged to meet AllyCat's requirement of being no bigger than a AA cell.
20200318_203900.jpg
Obviously in a much larger enclosure, but I knocked this together last weekend to sense the temp in my home because our new thermostat seemed optimistic on how warm it was (Ecobee said it was 71F). The combo of big and small fonts are easily readable.
 

hippy

Technical Support
Staff member
Amazing what you learn from Google; it seems that the font is (now) called "Bedstead".
That was interesting to read up on and does raise some interesting issues regarding OLED fonts. 7x5, really 8x5 with a line for underline, has never been great when it comes to the descenders of g, j, p, q, and y.

The traditional HD44780 LCD font aligns the descender to the bottom of the 7x5 allowing for the underline which looks quite bad. If one takes advantage of underline not being used and drop descenders by a line it is a little better but still not great for g and y. And those then collide with the top of the next line down if on an 8-pixel per line spacing, which is what byte mapping of an OLED display tends to give.

Using 9x5 is better, 10x5 with the underline / gap between lines -

https://pbs.twimg.com/media/Dc5Jk2JX4AAot4Z.jpg

But that doesn't fit well with byte handling, use within code, nor with OLED byte mapping, or even with OLED sizing. Though Nx32 and Nx64 display sizes do allow 3 and 6 line displays of 10x5 plus extra pixels of gap between lines.

The alternative is to drop to 6x5 with two lines for descenders but with the collision into the line below, or 5x5 with descenders and a gap. Which just happens to be our earlier 10x5 but compressed in height.

Non-byte sizing isn't a major problem if fonts are being rendered to an internal bitmap; and the 28X2 scratchpad is good for 128x64, 1024 bytes, but probably does then dictate rendering then blatting out.

I don't have an answer to what's best but it's maybe something for people to think about. Nothing to do while sat at home doesn't mean one has to be physically doing something. Thinking about something, keeping one's mind occupied, is as good a way to while away time as anything else.
 

WhiteSpace

Well-known member
Hemi345 I would be very interested to see the code for your display. I see that you have different bits of info sent to the 4 quadrants of the display - I’m sure I could pick up some tips on how to streamline my rather clunky attempt at the same thing. I’ve been so inspired that I’ve ordered a couple of the 128x32s to play with.
 

Hemi345

Senior Member
Sure, the code was thrown together quickly from bits and pieces of other projects and parts written from other folks on this forum, so it's kinda rough but hopefully it'll help. I was reading the temp sensor built into a DS3232 RTC for the "Ambient" temp and a DS18B20 for the "probe" temp (which was unplugged in the pic above).

You'll need an external EEPROM to store the big fonts (program the PICAXE with 'load fonts to eeprom3.bas' first to populate the EEPROM). I used a 24LC512 with the 128byte page buffer. You may need to adjust the hi2cout statements for the page size applicable to your EEPROM. I built all these fonts by hand, so some of them later in the alphabet might look a little wonky because I got tired and impatient. haha
 

Attachments

WhiteSpace

Well-known member
Thanks very much Hemi345 - that's very useful. Returning the favour, in case it's of any use, I've attached my set of large fonts - made using your massively time-saving excel calculator as you may recall. It includes a complete lower case set and some upper case characters, together with all numbers. Just picking up on Hippy's point on descenders, that was one of the challenges of adapting the font design to fit all "above the line", but I think it looks OK. Sending the character to the display works like this:

Rich (BB code):
hi2cout (0x40, @ptrinc, @ptrinc, @ptrinc, @ptrinc, @ptrinc,@ptrinc, @ptrinc, @ptrinc, @ptrinc, @ptrinc, 0x00,0x00) ; this does the top half
      inc row; then move to the lower half.  We add 2 x column space codes (0x00) at the end because the character consists of 10 columns stored in scratchpad plus two space columns which are added here in order to save storage
      gosub SetPosition
      hi2cout (0x40, @ptrinc, @ptrinc, @ptrinc, @ptrinc, @ptrinc,@ptrinc, @ptrinc, @ptrinc, @ptrinc, @ptrinc, 0x00,0x00)
                                    ; this does the lower row
      col = col + 12 ; then move to the next character space, 12 columns further on
      dec row ; go back to the top row, ready to write the top half of the next character
      gosub SetPosition
 

Attachments

AllyCat

Senior Member
Hi,

There might be quite a lot of useful ideas in the Teletext system; the memory and processing limitations in those days may be rather similar to PICaxe now. It also had "block graphics" characters, dividing each cell into 6 rectangles (i.e. 2 x 3, coded into 64 characters) and had the option to display a blank line between these sub-blocks, so that the cell boundaries didn't predominate. The "character rounding" algorithm was applied to interlaced (TV) displays, but interlace refreshes at only 25 Hz (30 Hz USA) so individual pixels can suffer "interlace twitter" and some people preferred to disable interlace to give a more "pixellated", but stable display. Of course Teletext also supported "double height" characters and I plan to post my first trial algorithm in the Code Snippets section soon.

I don't want to hijack this thread, but as the OP asked.....
"projects .... the size of an AA cell".....
It would be interesting to see a photo of one if you have one to hand and it's not too much trouble.
Photo of a few samples attached; there are basically two power supply styles: (1) The end tags receive the full supply voltage from other (AA) cells in the battery pack and the normal power connector terminals / wires can optionally go to an on/off switch. Note that the "tip" (screw) connection to the board is actually earth and the "body" receives the supply voltage. (2) Alternatively, the end terminals can be connected by a low resistance (a few ohms) to allow the PICaxe to monitor the current and the full supply is obtained on a "fly lead", typically terminated with solder tag which can slide in at the top battery terminal. The version with a "sounder" has a second wire to monitor the balance between two cells and a transistor (2N7000) to disconnect the load.

AAexamples_20200321.jpg

However, I can go further: a few years ago, Westaust55 had a few "spare weeks" and we cooperated to update his "Pebble" application to accommodate some of my "pseudo PCB" construction methods. These often use Veroboard (copper-clad stripboard) but can also use naked "perf.board" or prototyping boards with individual (double-sided) pads, linked by Plated Through Holes. My very small Veroboards need numerous track-cuts and there can be problems with the copper lifting (during soldering), so the PTH boards are interesting. But I normally design in Veroboard form, partly because that's what Pebble supports, and also it can be very tedious creating all interconnections at only 0.1 inch (2.5mm) at a time.

The construction method that I use is to fold over the through-hole leads on the underside of the board, to imitate PCB tracks. Longer spans and top-side links for a "double-sided" capability use "BTC" (Bare Tinned Copper) wire with a gauge of around 24 swg. The additions to Pebble allow these links to be routed not only N, S , E and W but, also NE, SE, SW and NW and even some more distant "diagonal" paths. Additional component outlines include a "screw" to represent the positive terminal of an AA cell and an "upright" 3.5 mm Programming Socket which fits across the other end of the board to resist the pressure from the battery holder spring. This Programming Socket is one of the "floating" components (it isn't locked to the 0.1" grid) because it is one hole narrower than the PCB, so can fit with its pins between the copper tracks (also giving better adhesion).

For acceptable design flexibility, the PCB needs to be 6 holes wide (i.e. 4 holes for the DIP socket and typically a supply and ground rail along the sides. That would be a width of 15.25 mm which is greater than the nominal 14 mm diameter of an AA cell, but the "gap" between copper tracks is not needed and the edge tracks can be cut (or filed) back slightly without affecting their function as "rails". In an extreme, the outer tracks could be "broken" along the line of holes, but this is not recommended because it is so much more difficult to locate the component leads during soldering. Of course the cross section of an AA cell is circular but the assembled boards normally have a "square" cross section, so cannot be used in the (few) battery compartments that have a curved contour (or even "end -feed") to accept the cells. But the majority of battery holders have a simple box section, so the PCB can have dimensions of about 14 x 50 mm and still fit near the base of the compartment.

There are a few "design rules": The majority of through-hole components will be mounted vertically; normal MR/CR25 ("quarter watt") resistors (the 25 actually refers to their diameter in tenths of a mm) are intended for 10 mm hole spacing (cf. height) but in practice can be bent to 7.5 mm height / hole spacing. We only need 6.3 volt (electrolytic) capacitors so size shouldn't be much of a problem, but it may be necessary to choose a manufacturer / range with a maximum height of 6 or 8 mm. Also, I try to mount components on the middle 4 tacks and only allow wires / leads to terminate on the two (supply / ground) narrower side strips and sometimes components (and certainly links) may need to be located under the ICs. Both Pebble's 0.1 and 0.2" pitch resistors will be mounted vertically in practice, and it isn't possible to show 0.15" (diagonal holes) or the "handed" nature of vertical resistors (i.e. on which side the body lies relative to the wire), so some interpretation may be required.

PEBBLE does permit a 6 x 20 holes PCB to be designed directly, but it is difficult to show all details of such compact designs. Therefore I normally work with a layout of about 24 x 20 holes "masked" into three strips of 6 x 20. These strips can be used to compare "trial" layouts, but ultimately I usually show the (reversed) underside (solder side) layout in the middle, particularly to indicate the exact positions of "spot face" or track cuts. The "CUT" symbol was intended to show tracks broken by two parallel knife (scalpel) cuts, between a pair of holes, with the intervening copper "popped off" using a hot soldering iron. It's a good way to prepare fully-designed layouts, but cutting tracks once some solder has been applied is difficult. So now, I generally show spot face cuts (made with a twist drill or custom cutter) and find the CUT symbol more useful in the preliminary design stage, particularly in an "overview" of the main parts of the design in the first strip. The final strip may show just the "topside tracks", or a "final view" (e.g. with ICs installed) depending on the nature of the design.

Here is my first trial for an AA OLED display board, which includes a software-controlled HSERIN inverter (when C.4 is low) that can also switch a LED (OFF when C.4 is floating or low). It includes provision for a DIP8 I2C EEPROM which might be used as a "scratchpad" or for temporary or permanent storage of character shapes, or for ASCII text or graphics, etc. The 128 x 32 OLED is rather longer than the 128 x 64 display so the header pins need to be almost at the end of the PCB. That has required a few "cheats": The screw (battery tip) is only allocated one hole (~2.5mm) whilst I normally allow for a 6 mm (1/4") x M3 pan head. However, the row used by the LED and resistor could be omitted and the two I2C bus pullup resistors might be replaced by the internal Weak Pullups (since the "bus" is literally only 1 or 2 cms long, with no earth plane). Another "cheat" is that the four pins along one side of the EEPROM (GND and A0 - A2) are assumed to be all earthed together (which they can be) on the top side of the board, with three (socket) pins cut off so that the solder-side tracks can link the PICaxe and OLED. This is easier with my preferred "turned pin" style of socket (or header strip) than the fully moulded type. Unfortunately, the 128 x 64 pixels OLED effectively has its pins in the reverse sequence so may require a different arrangement, probably with the EEPROM rotated by 180 degrees (which would then make it the same orientation as the PICaxe).

AA-OLED-128x32.png

There's a lot more that could be said, but I think better saved for a dedicated thread, sometime. ;)

Cheers, Alan.
 

AllyCat

Senior Member
Hi,

Just a quick update to my previous post(s). I've discovered a few minor errors in the Pebble layout and was mistaken about the OLED pin connections. But it's not a significant problem because there is space for links under the EEPROM to "unscramble" any connection sequence. However, it does seem that some versions of the OLED modules have their Vcc and GND pins swapped, so any users will need to be careful with their assembly. I'm still refining the exact layout so I won't post an update yet and just mention that my (first) Character Rounding Code Snippet is now posted.

Cheers, Alan.
 

lbenson

Senior Member
AA OLED display board
I have a question about the diagonal links. I have found the crisscross ones like the blue and yellow towards the middle of the left board, but I don't see how to do the single diagonal wire, of which there are many on the middle board. How is this done? I've downloaded the latest PEBBLE from the PICAXE Software page.
 

AllyCat

Senior Member
Hi,

They're all in the "one span specials" just below the three-pin header symbol and to the left of the "CUT" section.

Cheers, Alan.
 
Top