New User Get $30 User Coupons https://jlcpcb.com/CYT
Other Users Get SMT Coupons via Contacting JLCPCB Facebook
The OLED and nRF24 radio tower added to my EasyEVSE
Subscribed to my 2nd channel? Watch all my 3 minute videos on Julian's Shorts: https://www.youtube.com/channel/UCeewzdnwcY5Q6gcbnZKIY8g
Interested in my new garden workshop? Follow the entire build on Julian's Shednanigans:
https://www.youtube.com/channel/UCXfDjPehpC7B7lW2JFxeS4w
Join me on Odysee/LBRY: https://lbry.tv/$/invite/ @julian256:d
Octopus Energy referral link: share.octopus.energy/aqua-birch-918
(We each get £50)
#EasyEVSE
#ElectronicsCreators

Morning. All do you remember these things. This is a sort of arduino um with with displays and under transceiver. So this is the receiver let's switch it on uh this displays have lit up.

But they've got zeros on that's because the transmitter is not on this is an arduino nano set up as a transmitter with a transceiver unit. Let's switch it on the relay briefly flickers and now this thing has a temperature and humidity sensor. It is sensing temperature and humidity and transmitting it via the wireless link to the receiver. And you can see the data here this is just a duplicate of that one now.

Although. This is the receiver and has the displays on it it also has a toggle switch. If i press that the relay clicks in if i press it again relay clicks out so although this is the receiver. It can also transmit back to the transmitter.

Some amount of data. So i originally intended that this would be used in my shed and the idea being that if the humidity went above a certain value then this either manually or automatically could click the relay and that would turn on a fan and clear the moist air out of the shed. But it didn't really work because when moist air was in the shed there was also moist air in the environment and so all i was doing was replacing moist air with moist air. As well as that the fan in the shed was extremely noisy uh it could be heard from quite a distance so it never really happened.

But i'm gonna use this wireless system transmitter and receiver on my evse because the car charger part is going to be outside and the bit that's monitoring power coming from my solar array. It's going to be inside the house. So today what i'm aiming to do is to put this lot on here. So what i'm going to do here is turn off the receiver.

Now you can't turn these off with the push button. Which is a bit strange so i'll just slide that out and back in again. But i'm going to leave the transmitter running somewhere in the room. So that when i get a new receiver on my evse.

I can test it by just receiving whatever this transmitter is sending out so i'll leave that bit switched on so evse back on my desk. Now if we take a look at the receiver unit. You can see that there's a board here called arduino nano dual oled and touch and i think the first thing. I'm going to do on this nano is put an oled on um.

It doesn't strictly need an oled. But since i'm putting the receiver on i really need something to show that we're receiving data and that can be the oled. I found another one of those pcbs here it is i've put some connectors on it and some pins that will go on the nano. So this has a couple of links which if you mount vertically like this it takes an oled and i found this one um.

That goes vcc ground scl sda. If you put the links horizontal. You can use an oled that's ground vcc scl sda. Which there are some about but this one is vcc ground so i put my links vertically.

So my oled will plug oh not misaligned. We'll plug in there. Now this happens to have an si7021 temperature and humidity sensor mounted on it. Because the v in ground scl and sda just happen to be in the same sequence um.
But i'm not going to be using that it won't be communicated with now when i plug this into the nano which i can do in that little six pin array. I do need to take the scl and sda wires. And run them over to the points on the arduino. And i have a little two pin cable for that uh well now scl and sda c.

Is the third letter of the alphabet. So orange d. Is the fourth letter of the alphabet so yellow. Why not now this board does support the second o lead.

But i don't need that so i don't need these links the connector that this fits into the arduino with actually only has vcc and ground on it scl and sda have to come on this wire. Don't need the touch switch. So that's that should be all we need because i need to put the code in this arduino that drives the oled also i'm going to need a usb cable that is connected to my pcb so that i can upload uh code into this nano so that's powered that up so here's the code for the evse. It's very simple it reads the pot maps the pot values to the limited range of values that i need for pulse widths for the car.

Charging and then does an analog right of that to change the pwm output. Pretty straightforward now i've got another window here. Which contains the code for that receiver. When i was developing code for that shed device so that's there and i'm just going to pinch bits out of that because i know that this works first thing i'd need to do though is make sure in my library manager that the u8g2 library is installed and here it is uh g2 by oliver krauss and it's installed.

And it's a library for oleds and lcds and e ink displays and i'm using the 8x8 character part of the library. Which is the quicker. It's quicker to render on the oled. So that's installed that's fine.

I can close the library manager. Now let's get that other window back up and start pinching bits out of here well. I'm going to need to include the. Library which is this one new 8x8 libh.

So we'll copy that paste it into my evse code bring this one back. I'm going to need this constructor. Call. U8x8 ssd 1306.

That's the display 128x64 that's the size of the display and then there's this no name hardware. I squared c. The name of the oled is oled 78. I don't need 7a actually so well i do need a semicolon so let's take all of that copy paste it in here put in a couple of spaces just to make it nice and neat like i say i don't need oled 7a.

Because that's only necessary if you've got two oleds and i've only got one back to here uh. This is to do with the radio. So i don't need that i do need an oled 78. Begin.

I don't need the oled 7a begin. Let's just bring that out a bit so oled. 78 begin. Which is in setup.
Which does a set font to select the font that comment is just an alternative font. So i don't need that let's copy that out put it in setup well let's put it in after the adjustments to the pwm hardware paste that in oh we got two unnecessary spaces take them out and the final part. I think i need is just an oled 78 print statement. So set where you want to print on the display print.

What you want to print and then print. Some gubbins after it so i'll take this line copy that we'll put that in here after the analog right cursor to naught naught. We don't want to print packet naught. Because it doesn't exist so i'm actually going to print.

The pop value so let's put pot in here and then we'll print. What it actually is so we'll put a space. And it's the pot value so we'll print a number and then just the word pot. So that we know that's the pot value now that should be it if i've got my semicolons all in there which i think i have so i'm going to compile and upload that and see if it works and yes.

It does we've got a zero pot on the display. But it's very dim and if i turn that up that goes all the way to the top pot value. Which is 102 3. Of course as the number gets smaller.

And the word pot shifts left the t's for pot remain over on the right so we have pot with lots of teas. But that's just aesthetics. We're not too worried about that so yes that means that i'm now displaying the pot value on the oled. That's awesome um.

Maybe we could also display because i've got three more lines on here um. The pwm value which if you remember goes from 17 to 29 decimal. Let's do that so that simply means taking another. Oled 78.

78. Incidentally as the address on the i squared c. Bus of the oled display. We'll take a second line.

Here um. And that is in cursive position zero comma. Two which is the next line down copy that paste it in here. Now one thing i don't need is the serial print because i don't need to send data back over the to the serial monitor because we've got an oled now and it's a better way of seeing things so i can take that out i can also take out the serial begin because we just simply don't need uh serial data transmission.

Now. I just need to change this it's oled print so it's going to be pwm p w m and we'll put here space p w m. Upload and compile and upload that right we've now got pot zero to 1023 and pwm 23. Oh.

This is the decimal version isn't it 241. I was previously looking at the hexadecimal version but anyway we've got two sets of data. This is very dim this display. I'm going to hike it out and because it's blue.

I don't know whether it's because it's blue that it's dim now i've got a feeling one of these is set to 78 and one set to address 7a. So i'll take out the first one because that'll be 78. And the way you change. The address is you lift that resistor off so the resistor is currently on 78.
If you move it over to 7a it readdresses the display. So i obviously did that on the other one let's poke it in here and just see if this is a bit brighter. Now we need to reboot it because there's no library information. There's no setup information on this display.

Ah. That is a lot better. So zero part up to 1023 and pwm values. Go from 23 through 41 courtesy of the map command.

Which we looked at in the last video. Okay. So that is a working oled that's good now also on this um shed receiver that i built i've got this it's a little pcb that sits in some pins on the nano or on this board that i made myself. And it houses an nrf uh 24l01 plus transceiver module.

So what i've done is i've found the pcbs for that put some pins in made or found another transceiver and so this oh and we need uh vcc and ground so i'm going to use black and white. There this plugs in there i need to find these out the two pins just to the right of these two actually will be vcc and ground. I'll plug those in all right let's plug those in now little blue light should come on on the radio tower board. If i've got this correct.

There. It is can you see the blue light. I'm not sure anyway. That's lit up.

I can see the blue led um. So the radio tab should now be working. Now we need to port over some code related to radio reception and see if we can also get that the transmitter incidentally is still running so all i'm proposing to do is get some radio data coming in and displayed it won't relate in any way to the evse. It will just simply receive the i don't know the temperature.

Perhaps that's being sent out by the transmitter let's do some coding so once again just need to make sure. The library is installed this one is the rf24 library. Um. By tmrh20 and this is a library for nrf24l01 brackets plus modules so that is installed that's fine.

We can close the library manager bring in my other window and what we need here is the include library rf24 h. Copy that paste that in let's have another line constructor call is rf. 24 radio. Now pins.

9. And ten are the chip select and oh. What are they they're the two pins that are used in addition to the spi to make the radio work. But anyway.

All i know is that this line works so we'll copy that paste that in there we need a construct we need these um a constant. Which is a pipe. Number now that so that you can put a code on your transmissions. And you have to use the exact same code on your receiver otherwise it won't receive anything we've got a packet.

Which has a float and that's because the temperature from my shed. Sensor used uh floating point for the temperature and humidity. And there's a boolean for the payload. Which is the relay on and off.

But i'm just going to copy that line in its entirety copy paste that in at the top here. And what else do we need we need a setup. Which is the radio begin open reading pipe set data rate. Enable ack payload and start listening.
I need all of that lot copy that now that's all in setup. I'll put that since i'm doing this second. I'll put that after the oled stuff put it in there. That's fine and finally we need this thing in loop.

Which is while radio. Available read packet size of packet write and acknowledge payload. We don't really need that but we'll do it anyway. I don't think it's going to work if we don't we do have a declaration for payload.

It's up there what the value is in it is i don't know but anyway. We'll take this while loop. I think it needs that bracket there copy that and put it in loop. Oh.

Should i put it after the oled. Why not let's do it should work shouldn't it uh okay that should be it that's the end bracket for the while loop. This is the end bracket down here for the loop well. I think that should work let's uh.

Compile and upload that and see what happens oh of course that won't work because we're not actually displaying anything so on the next line down let's take another oled display command copy that paste it in we'll display it first doesn't really matter because this runs in a loop. Doesn't matter that we display it before we've actually received it it's all sequential uh okay so on line four. We will print oh it will be packet zero uh. We don't need volts.

We actually need degree c. So i'll just put a c in there uh. I might put a space in actually and how did that get there i probably made a mess of it so let's do that okay so on the next line down. We print.

The packet that comes in and then a degree c if i could remember how to do degrees. I'd do it but i can't right let's oh it's uploading still the previous one actually i think we can just override that call me yes compiling sketch upload that's if it works and that does work i just had to change something i pasted in an oled 7a command. And of course. That wasn't declared.

So it said undeclared variable. Uh oled. 78. Is the one i want oh that's flickering isn't it that's odd that's something to do with the camera's shutter.

Rate but. Anyway there's the line of. Data we're getting 6035 degrees celsius now that's coming from the transmitter that has a temperature sensor on it it's completely irrelevant to this project. But it just shows that the radio is receiving data and putting it on the oled now the next step of course is to take the pot off this board and put the pot on the transmitter.

So that i can have the pot at a remote location from where this is and get the pop value transmitted over the radio displayed on here. But also to drive the cp line driver. That's the purpose of this that i can change the pulse width. That the car is receiving originating from the potentiometer.
But the the two parts of the system will be in different locations. That's what i aim to do and of course later on the evse will live outdoors. The solar monitoring will be indoors. And so there will be this radio link between the two so that the cars charging power tracks the power of the solar panels.

But i think for today just to get the radio receiver working and the oled working that's good enough for me so i'm going to call it there cheerio.

By Julian

Youtuber, shed dweller, solar charge controller aficionado

13 thoughts on “Evse gets oled and radio”
  1. Avataaar/Circle Created with python_avatars fumthings says:

    had you thought yet about turning the charging off entirely when the available solar falls below the minimum charging value?

  2. Avataaar/Circle Created with python_avatars fumthings says:

    is SHED device, the Shed Humidity Environment Device???

  3. Avataaar/Circle Created with python_avatars WanJockey says:

    I am learning a lot in these videos, giving me great ideas I want to play with at work, and if successful spring it on my boss so he can share it much more with less dirt and grease to the CFO tho don't worry, our cfo knows me and my work ethic I just don't like being up in front of people. Thanks Julian 🙂

  4. Avataaar/Circle Created with python_avatars Rambozo Clown says:

    I think you should just bring the car into the house.

  5. Avataaar/Circle Created with python_avatars Andy Timmons says:

    I assume you know about ctrl t in the arduino IDE. Makes your code line up with one click at the end instead of manually deleting spaces as you go.

  6. Avataaar/Circle Created with python_avatars David _1 says:

    yay

  7. Avataaar/Circle Created with python_avatars andymouse123 says:

    Coming together nicely, it seems like ages since you bolted a bunch of Arduino stuff together and did a bit of code 'munging'…cheers.

  8. Avataaar/Circle Created with python_avatars david mcclare says:

    hi have you tried the esp now communication between 2 esp modules?

  9. Avataaar/Circle Created with python_avatars Roy Douce says:

    Put a oled78.clearDisplay(); in the loop before printing any data on the oled and should stop the potttttttt

  10. Avataaar/Circle Created with python_avatars ultracurvenl says:

    as i think of this project julian,
    this is the true green revolution…
    probably not intended this way but it is..

    lots of electric vehicle owners say to drive green but they dont cause their energy is still produced 'grey'

    you are actually making and creating that difference with this project.

  11. Avataaar/Circle Created with python_avatars Krzysztof Cygan says:

    You might want to make pot value on receiver side be a variable that gets updated by radio packets, so when radio stops for whatever reason, you will not end up with pot value of 0 or something nonexistent, but rather it would carry on with last received pot value.

  12. Avataaar/Circle Created with python_avatars Okurka says:

    What happened to the vocoder project?

  13. Avataaar/Circle Created with python_avatars Fred Flintstone says:

    Hmm will be interesting to see when you get it working showing voltage and charge??

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.