The 4th project, while no where near complete is a capacitance touch iambic keyer. Well, its not really a project but a proof of concept, and it kind of works ok and is going to be something that i develop more as i have time. The micro is an ESP32 which has 10 capacitance touch sensors built in. I used a modified version the the morse library that’s available on the net for the timing and keying and connected a peizo buzzer to act as side tone. To key a radio all you have to do is set a digital pin high and pull it low when you want to key the transmitter. And as the code takes care of the timing, you could use this on any transmitter that uses a straight key and pulls to ground on keying. Most of them LOL.
Easter has been quite productive for me, this is project 3 out of 4 is rechargeable battery powered arduino clock with temp and humidity function. Nothing fancy, but highly practical and accurate. The code is a mess, but i have shared it down below, i know someone out there can clean it up and make it more efficient, but for now, its working and doing what it needs so, show the temp and the time.
Hardware is kind of inefficient for this task, arduino mega and 3.2″lcd are both overkill and power hungry. There is an RTC and temp humidity sensor, 18650 battery, boost and charge controller. As usual i did a really crap job at cutting the hole out, I really should have done this in the CNC, I might even make a how to video on how i do that later today.
#define DHTPIN A0
#define DHTTYPE DHT22
TFT_HX8357 tft = TFT_HX8357();
DHT dht(DHTPIN, DHTTYPE);
const long interval = 60000;
unsigned long previousMillis = 0;
bool Century = false;
unsigned long currentMillis = millis(); //Do stuff here every 60 seconds
if (currentMillis - previousMillis >= interval)
previousMillis = currentMillis;
tft.setCursor(10, 10, 1);
if (L_Date < 10)
if (L_Month < 10)
tft.setCursor(30, 100, 7);
if (L_Hour < 10)
if (L_Minute < 10)
tft.setCursor(20, 280, 4);
tft.setCursor(260, 280, 4);
humid = dht.readHumidity();
temp = dht.readTemperature();
L_Hour = Clock.getHour(h12, PM);
L_Minute = Clock.getMinute();
AmPm = "pm";
AmPm = "am";
L_Date = Clock.getDate();
L_Month = Clock.getMonth(Century);
L_Year = Clock.getYear();
L_Year += 2000;
DAW = Clock.getDoW();
DayOfWeek = "Sunday";
DayOfWeek = "Monday";
DayOfWeek = "Tuesday";
DayOfWeek = "Wednesday";
DayOfWeek = "Thursday";
DayOfWeek = "Friday";
DayOfWeek = "Saturday";
DayOfWeek = "ERROR";
What a day, what should have been a simple job, for a simple man turned out to be an all day endeavor to overcome a litany of problems. In other words it was a fucking disaster. LOL but hey, i got there in the end and now the weather station is about to be put back out in the weather to do its thing. So lets see, what went wrong, well the sensor i was using was different from the previous one, so i needed a different library, then the device address was different to what was in the code, then the micro controller I was using shit itself and died, then i had problems with my computer not recognizing USB devices, then the board library was being a pain in the arse and needed upgrading, and finally there was this problem with crashing because dumb arse here created an array and was causing a stack overflow because the array had no size.
Well, after all that, I now have a pile of crap on my bench destined for the bin and a nice space on my bench where the weather station used to be. This time i have spares and should be able to fix things if something breaks without having to wait months. Its been down for 5 weeks, and thankfully its back up and running. For now, touch wood. LOL. Now I need to create a page that will query the database and display the data.
Its been a while since i have posted anything to do with electronicals and as i have been tinkering with the its been taking forever weather station i thought i would post an update.
The major change has been to the power system. I found these rather cool Wemos 18650 boards that take care of charge, voltage boost etc etc for a couple of bucks. The specs are perfect for all sorts of projects and will match up perfectly with the 6V solar panel i have to go with this and will charge at a max of 0.5amps. The cheep lipos have a combine capacity of 3.5amp hours, and the project atm draws about 0.1 amp hours, so good for say 30 hours without sun, which in Brisbane should be more than enough, if not I will buy some real lipos and use them instead, but, once i start dropping the micro into standby, that current draw will drop dramatically.
I have the code all working for the modules installed, humidity, temp, pressure, rain, I still have Lux and UV sensors to install. The code will poll the sensors every 15mins, save the data to SD card and push a copy of the data to my home server where I am still working on a web interface and graphing to display the data. High and Low data for the day is saved at midnight and pushed to the home server also.
And not to be outdone, I have even done some woodwork and 1/2 built a house for this which will then get installed in the garden. Also I have coming from china a rain gauge and depth module for measuring how much rainfall there has been, the rain sensor i have in the above image just detects rain, not how much or how intense it is.
I ran into a little bit of an issue with the old power management system i had installed. The original design was to use a buck converter to drop the battery voltage to 3.3v, this worked fine except the micro controller would not run with 3.3v it needs 5v, so much for reading the manual which said it ran on 3.3v. So then I added a boost converter, except that the BMS would shut down when it was connected.
So onto plan C, i ripped out the BMS, the charge controller and the converter, and am now using an all in 1 unit that is designed to work as shield board for the wemos mini. USB cable will run to the solar panels to charge the lipo’s, the jst connector goes to the batteries and power out is from the 5v pin on the shield. Yeah its ugly, but will work. The 3.3v needed for the sensors will all run off the regulator on the micro. Its a mess, but will work.
Now that crap is sorted, its time to finish off the code and make it work. Thats a job for another night.
Ok, so i have been slack for quite sometime and have not really been all that interested in many of the projects that I have sitting on my bench. But its summer, well spring but its 32 Deg C outside so its a matter of staying cool and not be totally bored. So today I am going to do some more work on the weather station and at least have all the modules connected and the code done before i make a house for it to live in and put it out in the garden to do its thing.
So this is where things stand, I have a couple more sensors to wire in and then its off to finish of the code, which after having a quick look at is in pretty good order already and will not be all that much effort to complete.
I was kind of thinking that the learning curve might be kind of steep. In fact for me its not all that bad, other than working out where everything is in the menu’s the process is rather familiar. I guess all those years programming on MUDS with GCC, GDB, Valgrind and friends using Kdevelop on Linux were not a total waste of time.
So a week or so ago i was talking with a friend of mine, Simon about how he was wanting to get into embedded programming and what that would entail. He had come across a series of youtube videos that take the unenlightened of us and walk us through many examples of becoming proficient with toolchains that allow for programming ARM micro controllers.
Now, I can do quite a bit of superficial programming in C using the arduino, but it does hold your hand quite a lot and its great for simple things, but if you want to do anything serious you really have to man up and learn how to use IAR Workbench or some GNU C toolchain along with all the associated hassles that come with that.
For sometime I have been using STM32 and ESP8266 micros but wimping out and using arduino for programming those chips, but after seeing this course on how to do ARM programming using the right tools, I have decided that its time to give it a go and see if I can get my head around the whole idea. So i ordered the TI development board from Element 14 and it arrived today so now there are no excuses. Time to start learning ARM programming and perhaps soon i might be able to turn those new found skills into a DSP IF board for homebrewers. No promises, failure is always an option 🙂
And here is the link to the course ware for those who might be interested in all this as well and want to give it a crack. http://www.state-machine.com/quickstart/